28 · PDF file6 LOGIC (Chapter 28) We can see disjunction in a Venn diagram. The union P [ Q...

12
Logic 28 Chapter Contents: A Propositions B Compound statements C Constructing truth tables

Transcript of 28 · PDF file6 LOGIC (Chapter 28) We can see disjunction in a Venn diagram. The union P [ Q...

Logic

28Chapter

Contents: A Propositions

B Compound statements

C Constructing truth tables

IB MYP_4magentacyan yellow black

0 05 5

25

25

75

75

50

50

95

95

100

100 0 05 5

25

25

75

75

50

50

95

95

100

100

Y:\HAESE\IB_MYP4\IB_MYP4_28\001IB_MYP4_28.CDR Tuesday, 1 April 2008 10:04:49 AM PETERDELL

2 LOGIC (Chapter 28)

Logic is a member of the mathematics family. It is a subject concerned with reasoning.

Aristotle (384 - 322 BC) wrote on every known subject of

his time. Many of his books are still studied in courses on

philosophy today, more than 2300 years after his death.

Aristotle was a famous teacher, his most infamous student

being Alexander the Great. It was only after Sir Isaac

Newton (1642 - 1727) used his now famous law of gravity

to demonstrate that the Earth moves around the Sun, that

Aristotle’s ideas of physics were finally abandoned.

The logic we study in this section contains modern language

and symbols, but it is only a small part of the logic Aristotle

taught all those many years ago.

A proposition is a statement that can be either true or false.

Whether it is true or false is the truth value of the proposition.

Here are some statements: ² All birds can fly. ² a2 ¡ b2 = (a¡ b)(a + b)

² 3 + 4 = 7 ² All boys are right handed.

² 69 £ 86 = (60 + 9)(80 + 6)

² It is raining.

All of these statements can either be true or false, and therefore they are all propositions.

These statements are not propositions: ² Is it raining? ² Pass my book.

² Have a nice day.

NEGATION

Propositions are usually denoted by letters such as p, q and r.

For example: p : Paris is in France, q : Elephants are grey. r : The glass is half full.

The negation of statement p is “not p” and we write this as :p.

The truth value of :p is the opposite of the truth value of p.

For example: if p : Pat is a boy then :p : Pat is not a boy

if p : Monday is a holiday then :p : Monday is not a holiday

if p : All fish float then :p : All fish do not float.

PROPOSITIONSA

IB MYP_4magentacyan yellow black

0 05 5

25

25

75

75

50

50

95

95

100

100 0 05 5

25

25

75

75

50

50

95

95

100

100

Y:\HAESE\IB_MYP4\IB_MYP4_28\002IB_MYP4_28.CDR Tuesday, 1 April 2008 10:11:25 AM PETERDELL

LOGIC (Chapter 28) 3

EXERCISE 28A

1 Which of the following are propositions and which are not?

a 2

3+ 5

6= 7

9b 2

3+ 4

5= 10+12

15c 10 + 3 = 7

d 6 + 2 = 7 e Keep quiet. f Polar bears are white.

g All fish live in the water. h How are you? ip

22 + 42 = 2 + 4

j Brush your hair. k 3 < 5 l What is the time?

2 Write five propositions of your own.

3 Write five statements that are not propositions.

4 Write the negation of the following propositions.

a The computer is blue. b Lindy is doing her homework.

c 2 is a prime number. d A cat has nine lives.

e A square is a rectangle. f The sun is orange.

g All cars are black. hpa2 + b2 = a + b.

i The glass is half empty. j Robbie is a smart boy.

VARIABLES IN PROPOSITIONS

In mathematics we often deal with statements that include variables or unknowns, for

example 2x + 3 = 9: Unless we know the value of the variable x, we cannot tell whether

this statement is true or false.

² If x = 2 the statement is the false proposition 4 + 3 = 9:

² If x = 3 the statement is the true proposition 6 + 3 = 9:

² If x = elephant the statement is elephant + 3 = 9 which is meaningless.

We cannot decide whether this is true or false, so the statement is not a proposition.

The statement 2x + 3 = 9 is only a proposition if x is a number. In a case like this we

normally assume that this is so.

The universal set U is the set of values which the variables in a proposition are allowed to

take. In the above example, U is the set of real numbers R .

The truth set P of the proposition p is the set of members of U for which the proposition p

is true. In the example above, P is f3g.

Using truth sets we can represent propositions on

a Venn diagram.

If the region P represents the proposition p,

then the region P 0 represents the negation :p:U

P

P'

IB MYP_4magentacyan yellow black

0 05 5

25

25

75

75

50

50

95

95

100

100 0 05 5

25

25

75

75

50

50

95

95

100

100

Y:\HAESE\IB_MYP4\IB_MYP4_28\003IB_MYP4_28.CDR Tuesday, 1 April 2008 10:11:55 AM PETERDELL

4 LOGIC (Chapter 28)

TRUTH TABLES

Truth tables are used in logic to show and evaluate all possibilities as either true or false.

Consider the proposition p : Today is Friday. Its negation is :p : Today is not Friday.

Its truth table is:p :p

If today is actually Friday: T F

If today isn’t actually Friday: F T

Notice how if p is true then :p is false, and if p is false then :p is true.

A negation turns a true value into a false and a false into a true.

When there are two or more propositions, it is possible to combine them in several ways to

form a compound statement.

THE CONJUNCTION

A conjunction is a compound statement formed by joining two propositions with

the connector and.

The conjunction “p and q” is denoted by p ^ q.

For example:

² For p : Alex is on the softball team, q : Judy is on the students’ council, we have

p ^ q : Alex is on the softball team and Judy is on the students’ council.

² For p : Ann is small, q : Bob is big, we have

p ^ q : Ann is small and Bob is big.

² For p : Coal is black, q : Dogs bark, we have

p ^ q : Coal is black and dogs bark.

² For p : Ed is a teacher, q : Fred is a teacher, we have

p ^ q : Ed and Fred are both teachers.

A conjunction is only true when both propositions are true.

COMPOUND STATEMENTSB

We can show a conjunction

on a Venn diagram.

The intersection P \ Q

is where both p and q

are true. This region

represents p ^ q.U

P

Q

IB MYP_4magentacyan yellow black

0 05 5

25

25

75

75

50

50

95

95

100

100 0 05 5

25

25

75

75

50

50

95

95

100

100

Y:\HAESE\IB_MYP4\IB_MYP4_28\004IB_MYP4_28.CDR Tuesday, 1 April 2008 10:14:10 AM PETERDELL

LOGIC (Chapter 28) 5

For p : Alex is on the softball team, q : Judy is on the students’ council,

the conjunction p ^ q is true when both Alex is on the softball team and Judy is on the

students’ council. Both propositions must be true for p ^ q to be true.

The truth table below shows the conjunction “p and q”. It covers all of the combinations of

p and q being true or false.

p q p ^ q

T T T

T F F

F T F

F F F

p ^ q is true when both p and q are true.

p ^ q

EXERCISE 28B.1

1 Write p ^ q for the following pairs of propositions:

a p : Alice is quiet, q : Brian is loud

b p : The tiger has stripes, q : The turtle has a shell

c p : Bats fly, q : Bats eat fruit

d p : 2 is a prime number, q : 2 is an even number

e p : The earth is flat, q : The moon is made of cheese.

2 Given p ^ q, write down p and q.

a Rome is in Italy and Liverpool is in England.

b Petra is a dog and Chilli is a cat.

c Billy plays soccer and Bob plays golf.

d Today is hot and dry.

e Newton and Pythagoras were both mathematicians.

THE DISJUNCTION

A disjunction is a compound statement formed by joining two propositions with

the connector or.

The disjunction “p or q” is denoted by p _ q.

For example:

² For p : Bruce gets an A in maths, q : Phil gets an A in maths, we have

p _ q : Bruce gets an A in maths or Phil gets an A in maths.

² For p : All birds can fly, q : Crocodiles eat fruit, we have

p _ q : All birds can fly or crocodiles eat fruit.

A disjunction is only false when both propositions are false.

is false whenever one or both of and are false.p q

IB MYP_4magentacyan yellow black

0 05 5

25

25

75

75

50

50

95

95

100

100 0 05 5

25

25

75

75

50

50

95

95

100

100

Y:\HAESE\IB_MYP4\IB_MYP4_28\popup\005IB_MYP4_28.CDR Friday, 11 April 2008 4:48:24 PM PETERDELL

6 LOGIC (Chapter 28)

We can see disjunction

in a Venn diagram.

The union P [ Q is where either

p or q or both are true.

The entire region shaded pink

represents p _ q.

We can also construct a truth table for the disjunction “p _ q”.

p q p _ q

T T T

T F T

F T T

F F F

p _ q is true when p or q or both are true.

p _ q is false when both p and q are false.

EXERCISE 28B.2

1 Write p _ q for the following pairs of propositions:

a p : Trees are green, q : The sky is blue

b p : Executives own expensive cars, q : Executives have

c p : I will go to the beach, q : I will study French

d p : The answer is 10, q : The answer is a factor of 30

e p : Polar bears live in Alaska, q : Tigers live in Africa.

2 Given p _ q, write p and q.

a David will pass his science test or James will give me $100.

b I will win the lottery or elephants will fly.

c Joe will buy a television or a stereo.

d Tomatoes are fruit or tulips are flowers.

e Rectangles are quadrilaterals or circles are polygons.

3 If p : Tim is in the kitchen, q : Tim is eating cookies, r : Tim is studying maths,

write the meaning of the following:

a :p b :q c :r d p ^ q e p ^ r

f r ^ q g p ^ q ^ r h p _ q i p _ r j q _ r

k p _ q _ r l (:p) ^ q m p _ (:r)4 If p : I study at home and r : I pass mathematics, write in symbolic notation:

a I do not study at home b I do not pass mathematics

c I study at home and I pass mathematics

d I study at home or I do not pass mathematics.

5 If p : I like to drink tea and q : I like to eat cakes, write in symbolic notation:

a I do not like to drink tea b I do not like to eat cakes

c I like to drink tea and eat cakes

d I do not like to drink tea and I do not like to eat cakes

e I like to eat cakes but I do not like to drink tea.

U

P

Q

chauffeurs

IB MYP_4magentacyan yellow black

0 05 5

25

25

75

75

50

50

95

95

100

100 0 05 5

25

25

75

75

50

50

95

95

100

100

Y:\HAESE\IB_MYP4\IB_MYP4_28\006IB_MYP4_28.CDR Tuesday, 1 April 2008 3:00:08 PM PETERDELL

LOGIC (Chapter 28) 7

IMPLICATION

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

an implication.

The implication “if p then q” is denoted by p ) q and reads “p implies q”.

For example: ² If it rains tomorrow then I will stay at home.

² If I pass mathematics then I will be happy.

² If x is a multiple of ten then x is divisible by 5.

For p : We have electricity and q : I will use my computer we have

p ) q : If we have electricity then I will use my computer.

We can see implication in a Venn diagram.

For example, given p : x > 3 and q : x2 > 9,

P = fx j x > 3gand Q = fx j x < ¡3 or x > 3gNote that P \Q = fx j x > 3g = P:

This means that P is a subset of Q, and can be represented on a Venn diagram as shown.

To illustrate the construction of the truth table for an implication, we again use the propositions

p : x > 3 and q : x2 > 9:

p q p ) q

T T T

Suppose p is true, for example, x = 4:

q being true, i.e., x2 > 9, is correct.

Hence p ) q is true.

T F F

Suppose p is true, for example, x = 4:

q being false, i.e., x2 6 9, is incorrect.

Hence p ) q is false.

F T T

Suppose p is false, for example, x = ¡4:

q being true, i.e., x2 > 9, is correct.

Hence p ) q is true.

F F T

Suppose p is false, for example, x = ¡2:

q being false, i.e., x2 6 9, is correct.

Hence p ) q is true.

Look at the first two lines of the table. If we start with p being

true, we must get to a true proposition q, since on the second

line we see p being true and q being false is impossible. We

can also see this on the Venn diagram because if we are in

the region P , we are definitely in region Q.

Now look at the second two lines of the table. If we start

with p being false, we do not know if q will be true or false,

since either way the implication p ) q is true. We can also

see this on the Venn diagram because if we are not in the

region P , we may or may not be in the region Q.

U

Q

P

P µ Q

U

QP

IB MYP_4magentacyan yellow black

0 05 5

25

25

75

75

50

50

95

95

100

100 0 05 5

25

25

75

75

50

50

95

95

100

100

Y:\HAESE\IB_MYP4\IB_MYP4_28\007IB_MYP4_28.CDR Tuesday, 1 April 2008 10:33:08 AM PETERDELL

8 LOGIC (Chapter 28)

The last two rows in the truth table do not say anything

about the proposition q. They tell us that if you start with

a false proposition, you can conclude anything. This has

passed into everyday use in the expression, “If pigs can

fly then ....”, or that anything is possible.

An implication is only false when the first proposition is true and the second is false.

EXERCISE 28B.3

1 Write implications for the following:

a p : x is divisible by 4, q : x is an even number

b p : The sun is shining, q : It is hot

c p : Roses are red, q : Violets are blue

d p : The bell rings, q : Class will finish

e p : The winter is cold, q : The summer is hot.

2 Look at the propositions in question 1 and answer the following:

a Is p always true? b Is q always true?

c If p is false can q be true? d If q is false can p be true?

3 For p : The animal is an elephant, q : The animal is grey,

write the following implications:

a p ) q b q ) p c (:p) ) q d (:q) ) p e (:q) ) (:p)

EQUIVALENCE

If two propositions are linked with ‘.... if and only if ....’ then we have an equivalence.

The implication “p if and only if q” is denoted by p , q:

Consider the propositions: p : The positive integer is divisible by 10,

q : The positive integer ends in a 0:

If p is true then q is true. Hence p ) q:

If q is true then p is true. Hence q ) p:

Since p ) q and q ) p, we have the equivalence p , q:

The positive integer is divisible by 10 if and only if it ends in 0:

Equivalence is seen in a Venn diagram.

Consider p : The positive integer is divisible by 10and q : The positive integer ends in a 0.

P = f10, 20, 30, 40, ......g and

Q = f10, 20, 30, 40, ......g.

Notice that P = Q:U

P Q

IB MYP_4magentacyan yellow black

0 05 5

25

25

75

75

50

50

95

95

100

100 0 05 5

25

25

75

75

50

50

95

95

100

100

Y:\HAESE\IB_MYP4\IB_MYP4_28\008IB_MYP4_28.CDR Tuesday, 1 April 2008 10:54:55 AM PETERDELL

LOGIC (Chapter 28) 9

We use this example to construct the truth table for p , q:

p q p , q

T T T

Suppose p is true, for example, n = 40 fdivisible by 10gq being true means that n ends in 0, which is correct.

Hence p ) q is true.

Suppose q is true, for example, n = 50 fends in 0gp being true means that n is divisible by 10, which is correct.

Hence q ) p is true.

Since p ) q is true and q ) p is true, then p , q is true.

T F F

Suppose p is true, for example, n = 40 fdivisible by 10gq being false means that n does not end in 0, which is incorrect.

Hence p ) q is false.

Since p ) q is false, p , q is also false.

F T F

Suppose q is true, for example, n = 40 fends in 0gp being false means that n is not divisible by 10, which is incorrect.

Hence q ) p is false.

Since q ) p is false, p , q is also false.

F F T

Suppose p is false, for example, n = 67 fnot divisible by 10gq being false means that n does not end in 0, which is correct.

Hence p ) q is true.

Suppose q is false, for example, n = 67 fdoes not end in 0gp being false means that n is not divisible by 10, which is correct.

Hence q ) p is true.

Since p ) q is true and q ) p is true, then p , q is true.

We can interpret each line in the truth table on the Venn diagram as follows:

If we are in the region P , we must also be in the

region Q:

If we are in the region P , we cannot be outside

the region Q:

If we are outside the region P , we cannot be in

the region Q:

If we are outside the region P , we must also be outside the region Q:

The equivalence is only true if both propositions are true or if both are false.

EXERCISE 28B.4

1 Write equivalence statements for the following pairs of propositions:

a p : I take an umbrella, q : It is raining

b p : I pass my exam, q : I study

c p : I will eat rice, q : I will drink milk

d p : The football team wins, q : The crowd cheers

e p : x > 10, q : x2 > 100.

U

P Q

P Q=

IB MYP_4magentacyan yellow black

0 05 5

25

25

75

75

50

50

95

95

100

100 0 05 5

25

25

75

75

50

50

95

95

100

100

Y:\HAESE\IB_MYP4\IB_MYP4_28\009IB_MYP4_28.CDR Tuesday, 1 April 2008 11:03:30 AM PETERDELL

10 LOGIC (Chapter 28)

2 Look at the above propositions and answer the following:

a Is p always true? b Is q always true?

c If p is false can q be true? d If q is false can p be true?

The rules for constructing truth tables for :p, p ^ q, p _ q, p ) q and p , q can be

used to construct truth tables for more complicated propositions.

Construct a truth table for (:p) ^ q.

We start by breaking down the composite proposition into its constituent parts.

(:p) ^ q is made up from p, q, :p and (:p) ^ q.

These should be your column headings in the required table.

p q :p (:p) ^ q

T T

T F

F T

F F

Fill in all T and F possibilities.

p q :p (:p) ^ q

T T F

T F F

F T T

F F T

Use the negation rule to change p into :p.

p q :p (:p) ^ q

T T F F

T F F F

F T T T

F F T F

Use the conjunction rule on the

:p and q columns.

A contradiction is when all of the values in one column of the truth table are false.

A tautology is when all of the values in one column of the truth table are true.

You should always indicate when a contradiction or a tautology occurs.

EXERCISE 28C

1 Construct truth tables for the following composite propositions:

a (:p) _ q b (:p) _ (:q) c (:p) ^ (:q)2 Which of the examples in question 1 is a contradiction?

3 Construct truth tables for the following composite propositions:

a (:p) ) q b (:p) , q c (p ^ q) ) q

CONSTRUCTING TRUTH TABLESC

Example 1 Self Tutor

IB MYP_4magentacyan yellow black

0 05 5

25

25

75

75

50

50

95

95

100

100 0 05 5

25

25

75

75

50

50

95

95

100

100

Y:\HAESE\IB_MYP4\IB_MYP4_28\010IB_MYP4_28.CDR Tuesday, 1 April 2008 11:14:43 AM PETERDELL

REVIEW SET 28A

LOGIC (Chapter 28) 11

4 Which of the examples in question 3 is a tautology?

5 Construct truth tables for the following composite propositions:

a :(p ) :q) b (p _ :q) ) q

c (p ^ q) ) (p _ q) d (p ^ q) ) :(p _ q)

1 Which of the following are propositions?

a Red is a colour. b Cows give milk. c Stop talking.

d Pass me the salt. e Denmark is in Europe.

f It is cold today. g Are you feeling good?

2 Consider p : Sally is happy, q : Sammy is quiet. Write the following as

propositions:

a :p b :q c p _ q

d p ^ q e (:q) ) p f p , (:q)3 Consider p : He is strong, q : He is smart. Write the following in symbolic

form:

a He is not strong b He is not smart

c He is smart and strong d If he is smart then he is not strong

e He is strong if and only if he is smart.

4 Write the following in symbolic notation.

a b c

5 Construct truth tables for the following:

a (:q) _ p b q ^ (:p) c p ) (:q) d p , (:q)6 Copy and complete the following table:

p q :p (:p) ) q p _ q ((:p) ) q) , (p _ q)

a Is ((:p) ) q) , (p _ q) a contradiction, a tautology, or neither?

b p : This is not the place.

q : This is not the time.

Write down the meaning of: i (:p) ) q ii p _ q

U

P

QU

P

QU

P

Q

IB MYP_4magentacyan yellow black

0 05 5

25

25

75

75

50

50

95

95

100

100 0 05 5

25

25

75

75

50

50

95

95

100

100

Y:\HAESE\IB_MYP4\IB_MYP4_28\011IB_MYP4_28.CDR Tuesday, 1 April 2008 11:10:08 AM PETERDELL

REVIEW SET 28B

12 LOGIC (Chapter 28)

1 Which of the following are propositions?

a Have you been to Beijing? b x is a prime number.

c Have a nice day. d Africa is a continent.

e Gold is magnetic. f My English is good.

g I think that my English is good.

2 Consider p : Mathematics is fun, q : I have my calculator. Write the following

as propositions:

a :p b :q c p _ q

d p ^ (:q) e (:q) ) (:p) f p , q

3 Consider p : It is an elephant, q : It is grey. Write using symbolic notation:

a It is grey and it is an elephant

b If it is grey then it is an elephant

c It is an elephant or it is grey

d It is not grey and it is not an elephant

e It is an elephant if and only if it is grey.

4 Write the following in symbolic notation.

a b c

5 Construct truth tables for the following:

a (:q) ^ p b q _ (:p) c (:p) ) (:q) d (:p) , (:q)6 Copy and complete the following table:

p q :p :q p _ q (:p) ^ (:q) (p _ q) ^ ((:p) ^ (:q))

a Is (p _ q) ^ ((:p) ^ (:q)) a contradiction, a tautology or neither?

b Given p : I eat chocolate and q : I feel good, write the following in

words:

i p _ q ii (:p) ^ (:q):

U

P

U

P

QU

P

Q

IB MYP_4magentacyan yellow black

0 05 5

25

25

75

75

50

50

95

95

100

100 0 05 5

25

25

75

75

50

50

95

95

100

100

Y:\HAESE\IB_MYP4\IB_MYP4_28\012IB_MYP4_28.CDR Tuesday, 1 April 2008 11:12:52 AM PETERDELL