Download as pdf or txt
Download as pdf or txt
You are on page 1of 37

LOGIC

1
GET READY !

For each of these statements, list the students for which the statement is true:

a) I am wearing a green shirt.


b) I am not wearing a green shirt.
c) I am wearing a green shirt and green pants.
d) I am wearing a green shirt or green pants.
e) I am wearing a green shirt or green pants, but not both.

In the fourth century BC, Aristotle formalized a system of logical


analysis, in which a complicated argument was reduced into simpler
statements, which were themselves used to determine the truth of the
argument.

Leibniz is credited as the philosopher who first developed symbolic


logic. The basis of this method is to take the sub-statements and
represent them with a letter.

2
Logic refers to the validity of given statements (other name as propositions). In mathematics we
use many of these in proofs, so it is necessary to be able to decide when propositions are true or
false.

A proposition is a statement that makes some declaration and is either true (T) or false (F). A
proposition cannot be both true and false at the same time.

PROPOSITIONS

Propositions are statements that can be true or false.

Questions are not propositions.

Comments or opinions that are subjective, for example, ‘Green is a nice color’ are also not
propositions since they are not definitely true or false.

Propositions may be indeterminate. For example, ‘your father is 177 cm tall’ would not have the
same answer (true or false) for all people.

The truth value of a proposition is whether it is true or false.

Exercise 1 ________________________________________________________________

Which of the following statements are propositions? If they are propositions, are they true, false,
or indeterminate?
a) 20  4 = 80

b) 25 . 8 = 200

c) Where is my pen?

d) Your eyes are blue.

3
Exercise 2 ___________________________________________________________

Which of the following statements are propositions? If they are propositions, are they true, false
or indeterminate?

Statement Validity
12  7
İstanbul is in the southern hemisphere.
37 is a prime number.
A square has two diagonals.
What is your name?
Put your bicycle away after using it.
(2 + 3) × 5  25
x = 6 is the solution of the equation 2x – 5 = 7
Joan sings loudly.
The longest side in a right triangle is called hypotenuse.

NOTATION USED FOR PROPOSITIONS


We represent propositions by letters such as p, q and r.
For example, p: It always rains on Tuesdays.
q: 37 + 9 = 46
r: x is an even number.

NEGATION (The negative of the proposition)

The negation of a proposition p is “not p”, and is written as p. The truth
value of p is the opposite of the truth value of p.

 If p is true then p is false

 If p is false the p is true.

Proposition: Negation:
p: The capital of Turkey is Ankara. p :The capital of Turkey is not Ankara.

q: It is not raining q : It is raining.

4
r: I will visit my relatives tomorrow. r: I will not visit my relatives tomorrow.

This information can be represented in a truth table. The first column


contains the possible truth values for p, and the second column contains the
corresponding values for p.

Truth table of p and p

Exercise 3 _________________________________________________________________

Write down the negation for each of the following propositions. Use the table:

a) p: √5 is an irrational number.

p:

b) r: 7 is a rational number.

r:

c) q: 23 – 14 = 12

q:

d) m: The biggest negative integer is -1.

m:

e) n: x < 7

n:

5
f) s: x  4

s:

g) t: a > 9

t:

h) v:  10

v:

EQUIVALENT PROPOSITIONS

If the truth values of any two propositions p and q are the same they are
called equivalent propositions denoted by the symbol p ≡ q.

Example _________________________________________________________________

p: Pentagon has five sides. q: Square has 4 equal sides. pq1


r: Hexagon has three sides. s: Rectangle has 4 diagonals. rs0

COMPOUND PROPOSITIONS

Compound propositions are statements which are formed using


connectives such as “AND” and “OR”.

CONJUNCTION

When two propositions are joined using the word AND, the new proposition is
the conjunction of the original propositions.

If p and q are propositions, p  q is used to denote their conjunction.

For example, if p: Ali had soup for lunch


q: Ali had a pie for lunch
then p  q: Ali had soup and a pie for lunch.

6
We see that p  q is only true if Ali had both soup and a pie for lunch, which means that both p
and q are true.

A conjunction is true only when both original propositions are true.

The truth table below shows the conjunction “p and q”.

Exercise 4 _________________________________________________________________

Write conjunction (p  q) for the following pairs of propositions:


a) p: It is windy, q: It is raining.

b) r: x is greater than 15, s: x is less than 30.

Exercise 5 _________________________________________________________________

Decide which of the following are propositions and which are true (T), which are false (F).

Statement (TRUE / FALSE) Validity Reason


Summer is warm and winter is cold.
TRUE T and T  TRUE
TRUE TRUE

London is the capital of England and France is in Europe.

Thailand is in Asia and Thailand is in Africa.

7
A triangle has three sides or a square has five sides.

12 is less than 10 and California is a state of the USA.

23 – 10 < 7 and 60  10  20

March is in winter or January is 29 days.

52 = 35 and √𝟒𝟗 = 𝟖

HOMEWORK ____________________________________________________________
Decide which of the following compound propositions are true and which are false.

Statement Validity
a) A whale is a mammal and an eagle is a bird.

b) A pentagon has five sides or 32 = 10

c) A sphere has 6 surfaces or 15 = 9

d) There are 10 millimeters in a centimeter and 100 millimeters in a meter.

e) A right angle is 90° or a scalene triangle has all angles equal.

f) Hexagon has 6 sides and square has 4 sides.

g) Ireland is an island and Beijing is a country.

8
DISJUNCTION

When two propositions are joined by the word OR, the new proposition is the
disjunction of the original propositions.

If p and q are propositions, p  q is used to denote their disjunction.

For example, if p: I will order a pizza.


q: I will order a burger.
then p  q: I will order a pizza or I will order a burger.
p  q is true if I order a pizza or a burger or both.
So, p  q is true if p or q or both are true.

A disjunction is true when one or both propositions are true.

Alternatively, we can say that

A disjunction is false if both propositions are false.

Exercise 6 _________________________________________________________________

Write disjunction (p  q) for the following pairs of propositions:


a) p: Mary has an apple, q: Mary has an orange.

b) r: x is a multiple of 3, s: x is a multiple of 5.

9
Exercise 7 _________________________________________________________________

For the following propositions, determine whether p  q is true or false:

Proposition “p” Proposition “q” pq


24 is a multiple of 4 24 is a multiple of 6

8 > 10 12 < 14

There are 7 days in a week There are 10 months in a year

1 hour = 70 minutes 1 km = 100 m

EXCLUSIVE DISJUNCTION

The exclusive disjunction is true when only one of the propositions is true. The
exclusive disjunction of p and q is written p  q.

We can describe p  q as “p or q, but not both”, or “exactly one of p and q”.


So, if p: Sally ate cereal for breakfast
q: Sally ate toast for breakfast
then p  q: Sally ate cereal or toast, but not both, for breakfast.
(In other words: Sally ate either cereal or toast.)
The truth table for the exclusive disjunction p  q is:

10
Exercise 8 _________________________________________________________________

Write the exclusive disjunction p  q in words for the following pairs of propositions:
a) p: Meryn will visit Japan next year, q: Meryn will visit Singapore next year.

b) p: Ann will invite Kate to her party, q: Ann will invite Tracy to her party.

Exercise 9 _________________________________________________________________

For the following propositions, determine whether p  q is true or false:

Proposition “p” Proposition “q” pq

17 is a prime number 11 is a prime number


9 is an even number 9 is a multiple of 3
2,6 is an integer -5 is a natural number
23 = 8 60 = 6

Exercise 10 _________________________________________________________________

Consider r: Kelly is a good driver, and s: Kelly has a good car. Write in symbolic form:
a) Kelly is not a good driver ………………….
b) Kelly is a good driver and has a good car ………………….
c) Kelly does not have a good car and is not a good driver ………………….
d) Kelly has a good car or Kelly is a good driver ………………….

Exercise 11 _________________________________________________________________

If p  q is true and p  q is false, determine the truth value of:


a) p b) q

11
Exercise 12 _________________________________________________________________

Read the description of Ed’s day:


“Ed slept in, then had pancakes for breakfast. He went to the gym in the morning, then ate a
sandwich for lunch. He played golf in the afternoon, and had steak for dinner.”
Consider the following propositions:
p: Ed got out of bed early r: Ed ate steak for lunch
t: Ed ate fish for dinner v: Ed went to the movies
q: Ed ate pancakes for breakfast s: Ed ate steak for dinner
u: Ed went to the gym w: Ed played golf.

Determine whether the following are true or false:

a) p b) p

c) q  u d) p  w

e) r  s f) r  s

g) r  s h) t  v

TRUTH TABLES AND LOGICAL EQUIVALENCE

Example ___________________________________________________________________

Truth value of a proposition depends to its certainty. For example:

p: Ankara is the capital of q: İstanbul is in the Karadeniz r: I will play basketball


Turkey. region. today.

Proposition p is a TRUE Proposition q is a FALSE Proposition r can be TRUE or


statement. Therefore, its truth statement. Therefore, its truth FALSE since there is no
value is 1. value is 0. certainty. Therefore, we need
a truth table to identify its
possible situations.

12
Suppose, we don’t know whether p and q are true and want to explore all the possible
combinations of p and q being true or false. We then must use these truth tables:
There are 2 x 2 = 4 possible situations (4 rows in the truth table) when
there are 2 different truth values for each statement.

If a proposition is TRUE than its truth value is 1.


If a proposition is FALSE, then its truth value is 0.

Exercise 13 _________________________________________________________________

1) p: All even numbers are divisible by 2.


q: All odd numbers are divisible by 3.

a. Translate these propositions into words:


p ∧ q:

p ∨ q:

b. Complete the following truth table.


(Use 1 for True and 0 for False):

13
2) p: I will study math today.
q: I will study chemistry today.

Construct a truth table showing p ∧ q and p ∨ q. (Note that the table must include all 4
combination since we don’t know the truth value of both propositions.)

3) Construct a truth table for p  q.

TAUTOLOGY AND LOGICAL CONTRADICTION

A compound proposition is a tautology if all the values in its truth table column are
true (all values in the column are 1).
A compound proposition is a logical contradiction if all the values in its truth table
column are false (all values in the column are 0).

Exercise 14 _________________________________________________________________

a) Show that p  p is a tautology.


Note that:
(p)  p 1  0 0  1

14
b) Show that p  p is a contradiction.

LOGICAL EQUIVALENCE

Two propositions are logically equivalent if they have the same truth table column.
Logical equivalence is denoted by the equivalency symbol “”.

Example _________________________________________________________________

Show that (p  q) and p  q are logically equivalent. (De Morgan’s Law)

After comparing their truth table columns, we can conclude that: …………..  …………..

Example _________________________________________________________________

The same logical equivalency can be demonstrated by using the same truth value table for both
propositions.

15
This means that (p ∧ q) and p ∨ q are equivalent statements:

Exercise 15 _________________________________________________________________

a) Complete the following truth table to show that (p ∨ q)   p ∧ q (De Morgan’s Law)

b) p: I have a cat.
q: I live in a İstanbul.
Translate each of the highlighted statements to show equivalence.

HOMEWORK ______________________________________________________________

1) s: 4 is an integer. t: 5 is an even number.

a) Translate into words:


st:
st:
s  t :
s  t :

b) Complete the following truth table:

16
2) c: It never rains in Trabzon. d: The sun shines in Antalya.

a) Write the following using logic terminology.

i. It rains in Trabzon. ………………


ii. It rains in Trabzon and the sun shines in Antalya. ………………
iii. Either it never rains in Trabzon or the sun doesn’t shine in Antalya. ………………
iv. It rains in Trabzon and the sun doesn’t shine in Antalya. ………………
v. Either it never rains in Trabzon or the sun shines in Antalya. ………………

b) Complete the following truth table to decide which of the propositions in (a) are true.

3) Complete this truth table using all the possible combinations of p and q

A BRIEF SUMMARY: The truth tables for negation, conjunction, disjunction, and exclusive
disjunction can be summarised in one table.

17
HOMEWORK ______________________________________________________________

1) Construct truth tables for the following propositions. And then determine whether the
proposition is a tautology, a logical contradiction, or neither.
a) p  q

b) (p  q)  p

c) p  (p  q)

2) Complete the table below.

3) Use truth tables to establish the following logical equivalences:

a) (p)  p b) p  p  p

18
c) p  (p  q)  p  q d) p  (p  q)  p  q

e) (p  q)  p  q f) (q  p)  q  (p  q)

g) (p′ ∨ q) ∧ p ≡ q ∧ p

19
TRUTH TABLES FOR THREE PROPOSITIONS
When three propositions are under consideration, we usually denote them p, q
and r.
The possible combinations of the truth values for p, q and r are listed
systematically in the table alongside.
Note that; there must be 2n number of rows in the truth table when the
number of propositions is “n”.
If there were 4 propositions, then there would be 16 rows in the truth table.

INVESTIGATION
_____________________________________________________________

Complete the truth tables showing outcomes for all possible combinations (2number of propositions).

20
 Are there any similarities between these results and those in other branches of
mathematics? Consider, for example, the following statements:

Associative property:
(5 × 3) × 4 = 5 × (3 × 4) (5 + 3) + 4 = 5 + (3 + 4)
 (p  q)  r =

 (p  q)  r =

Distribution property:
5.(x + y) = 5.x + 5.y 5.(x – y) = 5.x – 5.y

 p  (q  r) =

 p  (q  r) =

21
IMPLICATION AND EQUIVALENCE

If two propositions can be linked with “If ...., then ....”, then we have an implication.

The implicative statement “if p then q” is written p  q and reads “p implies q”.

p is called the antecedent (1st) and q is called the consequent (2nd).

IMPLICATION
An example of a conditional statement would be:
Suppose p: I pass my exams.
q: My father will buy me a new watch.
The original statement: If I pass my exams then my father will buy me a new watch.
antecedent consequent

That can be written as: pq

So the statement p  q is true unless p is true and q is false.

22
The truth table for a conditional statement is:

Exercise 16 _________________________________________________________________

m: It will rain today.


n: My golf game will be postponed.
a) Translate the conditional statement m  n into words.

b) Complete a truth table for this conditional statement.

Exercise 17 _________________________________________________________________

e: Tony is in Europe. g: Tony is in Germany.


a) Translate the statement g  e into words.

b) Translate the statement g ∨ e into words.

23
c) Complete the truth table below for this conditional statement.

d) What can be said about the statements g  e and g’ ∨ e?

Exercise 18 _________________________________________________________________

f: The weather is fine.


t: Sam will play tennis.
b: Sam will go to the beach.
a) Write the compound proposition b ∨ t in words.

b) Write the conditional statement f  (b ∨ t) in words.

c) Write the conditional statement (f  b) ∨ (f  t) in words.

d) Complete the truth table below to show that f  (b ∨ t)  (f  t) ∨ (f  b).

24
Exercise 19 _________________________________________________________________

Find the truth value of the propositions by using the given logical equivalency:
a) p ∧ (p′ ∨ q) ≡ 1

b) Given 𝑝 ∨ (q ⇒ r) ≡ 0

EQUIVALENCE

If two propositions are linked with “.... if and only if ....”, then we have an equivalence.
The equivalence “p if and only if q” is written “p  q”.

p  q is logically equivalent to the conjunction of the implications p  q and q  p.


Consider p: I will pass the exam q: The exam is easy.

25
We have p  q: If I pass the exam, then the exam is easy.
q  p: If the exam is easy, then I will pass it.
p  q: I will pass the exam if and only if the exam is easy.

THE TRUTH TABLE FOR EQUIVALENCE


We can find the truth table for p  q by constructing the truth table of its logical equivalent:

p  q  (p  q)  (q  p)

The equivalence p  q is true when p and q have the same truth value.

Example _________________________________________________________________

For the following propositions p and q:


i. read the equivalence p  q
ii. state whether the equivalence is true or false.

a) p: Rome is the capital of Italy q: Paris is the capital of France

b) p: 2x +3 = 10 is an expression q: 2x +3 is an expression

c) p: Cows have nine legs q: Horses have five heads

26
Exercise 20 _________________________________________________________________

Construct truth tables for:

a) p  q

b) (p  q)  p

Exercise 21 _________________________________________________________________

By constructing the truth table, show that:


a) 𝑝  𝑞  (𝑝  𝑞)  (𝑝  𝑞)

b) (𝑝 ⇔ 𝑞)′ ≡ 𝑝′ ⇔ 𝑞

27
CONVERSE, INVERSE AND CONTRAPOSITIVE

THE CONVERSE

If there is a statement as p  q, then the converse of this statement is q  p.

Exercise 22 _________________________________________________________________
p: All sides of the triangle are equal.
q: The triangle is equilateral.
a) Write the statement p  q in words.

Equilateral Triangle

b) Write the converse of the statement in symbol and in words.

THE INVERSE

If there is a statement as p  q, then the inverse of this statement is p  q.

Exercise 23 _________________________________________________________________

p: Two angles of the triangle are equal.


q: The triangle is isosceles.

a) Write the statement p  q in words.


Isosceles Triangle

b) Write the inverse of the statement in symbol and in words.

28
THE CONTRAPOSITIVE

If there is a statement as p  q, then the contrapositive of this statement is q  p.

Exercise 24 _________________________________________________________________

p: One angle of the triangle is 90 degrees.


q: The triangle is right.

a) Write the statement p  q in words.


Right Triangle

b) Write the contrapositive of the statement in symbol and in words.

SUMMARY

29
Complete the truth table to examine the equivalency relationship above.
p q p q pq qp p  q q  p

Mathematical Modeling

Bank Robbery

A bank was robbed by unidentified people when the electricity went off. Policemen came to scene of
crime in time but didn’t catch the thieves. After investigation; they put Ahmet K.(35), Burak M.(24)
and Cem T.(34) under surveillance. The prosecutor makes three inferences about the robbery:

 If Ahmet is not guilty, both Cem and Burak are guilty.


 Burak or Cem are not guilty.
 Ahmet is not guilty or Burak is guilty.

Help the prosecutor to find a way to decide who the guilty is.

(Hint: You may use truth value of guilty as 1, the truth value of not guilty as 0.)

30
MATHEMATICAL QUANTIFIERS (, )

OPEN PROPOSITION

An expression which contains at least one variable and which for each values of the
variable is either true or false, is called open proposition.

An open proposition is shown in symbol according to number of its variables.

p(x): x+1 = 7 (one variable)

p(x , y): x + y > 7 (two variables)

If an open proposition is true for a given number, then this number has a truth value 1.

If an open proposition is false for a given number, then this number has a truth value 0.

Exercise 25 _________________________________________________________________

p(x): x2 < x is an open proposition. Examine the proposition for -1 and 1/2. Discuss the
truth values of p(x) for these numbers.

Solution:
 For x = -1 (-1)2 < (-1) 1 < -1 which is a false statement.
Then the proposition has truth value 0 for the number -1. p( -1 ) = 0

1
 For x = 2 ………

In our daily conversations, we use some words such as some, all, every, each, at least
etc. These are named as quantifiers because each indicates quantity.

 : Means “for all”, “for every” (named as Universal quantifier)

 : Means “at least one”, “for some” (named as Existential quantifier)


31
 Natural numbers are denoted by N.
 Integers are denoted by Z.
 Rational numbers are denoted by Q.
 Real numbers are denoted by R.

The symbol ∈ is used to show belonging an element to a set.

Exercise 26 _________________________________________________________________
Write the statement in words:
a)  x  R, x–1 < 0

b)  x  Z, x2 + 3 > 0

Exercise 27 _________________________________________________________________

Write the given statements in symbolic logic:


a) Every integer is less than the square of itself.

b) Three more than some real numbers are greater than 7.

NEGATION OF QUANTIFIERS

[ , p (x) ]  , p (x) [ , p (x) ]  , p (x)

Exercise 28 _________________________________________________________________
Negate each of the followings given below.
a)  xZ, 2x – 3 < 5

b)  x, y ∈ N, x.y = 6

32
AXIOMS AND THEOREMS

To determine the truth values of some propositions, we need to know some definitions of terms,
need to assume the truth of some propositions at the beginning. Those propositions which are
assumed to be true are called “axiom” and “postulate”. We prove some other propositions using
axioms. Those propositions which are proved are called “theorem”.

Example _________________________________________________________________

“Only one line passes through certain two points on a plane” is an axiom
“If two lines are perpendicular, then they form congruent adjacent angles” is a theorem.
Here, the first part of the theorem is known as “hypothesis” and the second part is known as
“assertion” which must be proved.

Exercise 29 _________________________________________________________________

a) Given 𝑝′ ∧ (𝑞 ⇒ 𝑟)′ ≡ 1, find the truth values of p, q and r.

b) Given (𝑝 ∧ 𝑞 ′ ) ⇒ (𝑟 ′ ⇒ 𝑠) ≡ 0, find the truth values of p, q, r, s

c) Given (𝑝 ⇒ 𝑞) ∨ 𝑞 ≡ 0, find the truth values of p and q.

d) Given 𝑝 ≡ 0, 𝑞 ≡ 1, 𝑟 ≡ 0, then find the truth value of  p  (q  r ) .

e) If p  q ≡ 0 and r  q  1, then find the truth value of q  (p  r).

33
HOMEWORK ______________________________________________________________

1. Find the result of 1  0  1  0  1

2. Find the truth values of the following if p  1 , q  0 , r  1



a) p  q   r b) p  q   r c) p  q  r 

3. Express the following each sentence in p, q, r,..etc and identify its truth value.

a) The sum of the exterior angles of a triangle is 360 0 and square is a


quadrilateral.

b) 5 is an odd number or “ 3 2  4 2  5 2 ”

4. Find the truth value of ( p  r)   (q  p') if p  ( r  q')  0

5. Find the negation of compound propositions.


 p  q   r p   q  p

 p  q

34
6. Construct a truth table for the given proposition p  p  q

7. Simplify the given proposition (pq)

8. If  p  q  r  s  0 then find the truth value of (𝑝′ ∨ 𝑞) ⇔ (𝑟 ′ ⇒ 𝑠)

9. If (𝑝′ ∨ 𝑞) ∨ 𝑟 ≡ 0 then find the truth value of  p  q '   r '  r 

35
10. If (p ∨ 𝑞)   r  q   0 then find the truth value of ( p  r )  q

11. Find the negation of  p  q '   p  p ' .

12. If  p '  q   r ' s  '  0 then find the truth value of  p  q  r  s

13. If  p  q '   r  s   1 then find the truths value of p,q,r,s

36
14. If p ∨ ( p' ⇒ q ) ≡ 0 then find the truth value of (𝑞 ′ ⇔ 𝑝)

15. Show that p '   q  p '  p  q by using the truth table.

16. “If a3 is an odd number, then a is an odd number”


Write the inverse, converse and contrapositive of the given compound proposition

17. Write the statements and find the truth value of followings:

 p(x): ∃𝑥 ∈ 𝑅, 𝑥 2 + 𝑥 − 2 = 0

 q(x): ∀𝑥 ∈ 𝑍, 𝑥 + 3 > 0

18. Find the negation of ( x, x 2  1 )   x, x  0 

37

You might also like