+ All Categories
Home > Documents > =1=Discrete Mathematics and its Applicationsfaculty.washington.edu/moishe/hanoi-2011/Discrete... ·...

=1=Discrete Mathematics and its Applicationsfaculty.washington.edu/moishe/hanoi-2011/Discrete... ·...

Date post: 11-Aug-2020
Category:
Upload: others
View: 5 times
Download: 0 times
Share this document with a friend
91
Discrete Mathematics and its Applications Ngày 12 tháng 9 năm 2011 () Discrete Mathematicsand its Applications Ngày 12 tháng 9 năm 2011 1 / 16
Transcript
Page 1: =1=Discrete Mathematics and its Applicationsfaculty.washington.edu/moishe/hanoi-2011/Discrete... · 2011-09-12 · Discrete Mathematics and its Applications Ngày 12 tháng 9 năm

Discrete Mathematicsand its Applications

Ngày 12 tháng 9 năm 2011

() Discrete Mathematicsand its Applications Ngày 12 tháng 9 năm 2011 1 / 16

Page 2: =1=Discrete Mathematics and its Applicationsfaculty.washington.edu/moishe/hanoi-2011/Discrete... · 2011-09-12 · Discrete Mathematics and its Applications Ngày 12 tháng 9 năm

Logic

(Introduction)‘‘The universe cannot be read until we have learnt the language andbecome familiar with the characters in which it is written. It is written inmathematical language... without which means it is humanlyimpossible to comprehend a single word"Logic is the bridge netween the language the universe is written in andmathematics.In this lecture we shall learn the basic entities of logic:

1 Propositions2 Boolean Variables3 Logical (boolean) opertaors.4 Truth tables.

() Discrete Mathematicsand its Applications Ngày 12 tháng 9 năm 2011 1 / 16

Page 3: =1=Discrete Mathematics and its Applicationsfaculty.washington.edu/moishe/hanoi-2011/Discrete... · 2011-09-12 · Discrete Mathematics and its Applications Ngày 12 tháng 9 năm

Logic

(Introduction)‘‘The universe cannot be read until we have learnt the language andbecome familiar with the characters in which it is written. It is written inmathematical language... without which means it is humanlyimpossible to comprehend a single word"Logic is the bridge netween the language the universe is written in andmathematics.In this lecture we shall learn the basic entities of logic:

1 Propositions

2 Boolean Variables3 Logical (boolean) opertaors.4 Truth tables.

() Discrete Mathematicsand its Applications Ngày 12 tháng 9 năm 2011 1 / 16

Page 4: =1=Discrete Mathematics and its Applicationsfaculty.washington.edu/moishe/hanoi-2011/Discrete... · 2011-09-12 · Discrete Mathematics and its Applications Ngày 12 tháng 9 năm

Logic

(Introduction)‘‘The universe cannot be read until we have learnt the language andbecome familiar with the characters in which it is written. It is written inmathematical language... without which means it is humanlyimpossible to comprehend a single word"Logic is the bridge netween the language the universe is written in andmathematics.In this lecture we shall learn the basic entities of logic:

1 Propositions2 Boolean Variables

3 Logical (boolean) opertaors.4 Truth tables.

() Discrete Mathematicsand its Applications Ngày 12 tháng 9 năm 2011 1 / 16

Page 5: =1=Discrete Mathematics and its Applicationsfaculty.washington.edu/moishe/hanoi-2011/Discrete... · 2011-09-12 · Discrete Mathematics and its Applications Ngày 12 tháng 9 năm

Logic

(Introduction)‘‘The universe cannot be read until we have learnt the language andbecome familiar with the characters in which it is written. It is written inmathematical language... without which means it is humanlyimpossible to comprehend a single word"Logic is the bridge netween the language the universe is written in andmathematics.In this lecture we shall learn the basic entities of logic:

1 Propositions2 Boolean Variables3 Logical (boolean) opertaors.

4 Truth tables.

() Discrete Mathematicsand its Applications Ngày 12 tháng 9 năm 2011 1 / 16

Page 6: =1=Discrete Mathematics and its Applicationsfaculty.washington.edu/moishe/hanoi-2011/Discrete... · 2011-09-12 · Discrete Mathematics and its Applications Ngày 12 tháng 9 năm

Logic

(Introduction)‘‘The universe cannot be read until we have learnt the language andbecome familiar with the characters in which it is written. It is written inmathematical language... without which means it is humanlyimpossible to comprehend a single word"Logic is the bridge netween the language the universe is written in andmathematics.In this lecture we shall learn the basic entities of logic:

1 Propositions2 Boolean Variables3 Logical (boolean) opertaors.4 Truth tables.

() Discrete Mathematicsand its Applications Ngày 12 tháng 9 năm 2011 1 / 16

Page 7: =1=Discrete Mathematics and its Applicationsfaculty.washington.edu/moishe/hanoi-2011/Discrete... · 2011-09-12 · Discrete Mathematics and its Applications Ngày 12 tháng 9 năm

Propositions

DefinitionA Proposition is a statement of a fact which is either true or false butnot both.

Example

1 Today is Saturday2 It is raining today.3 if n is an integer then (2n + 1)2 mod 8 = 1.4 if n is an odd prime number then 2n−1 mod n = 15 There are no positive integers x , y , z satisfying the equality

x5 + y5 = z5

6 There are infinitely many prime numbers q such that q = 4p + 1where p is prime.

() Discrete Mathematicsand its Applications Ngày 12 tháng 9 năm 2011 2 / 16

Page 8: =1=Discrete Mathematics and its Applicationsfaculty.washington.edu/moishe/hanoi-2011/Discrete... · 2011-09-12 · Discrete Mathematics and its Applications Ngày 12 tháng 9 năm

Propositions

DefinitionA Proposition is a statement of a fact which is either true or false butnot both.

Example

1 Today is Saturday2 It is raining today.3 if n is an integer then (2n + 1)2 mod 8 = 1.4 if n is an odd prime number then 2n−1 mod n = 15 There are no positive integers x , y , z satisfying the equality

x5 + y5 = z5

6 There are infinitely many prime numbers q such that q = 4p + 1where p is prime.

() Discrete Mathematicsand its Applications Ngày 12 tháng 9 năm 2011 2 / 16

Page 9: =1=Discrete Mathematics and its Applicationsfaculty.washington.edu/moishe/hanoi-2011/Discrete... · 2011-09-12 · Discrete Mathematics and its Applications Ngày 12 tháng 9 năm

Propositions

DefinitionA Proposition is a statement of a fact which is either true or false butnot both.

Example1 Today is Saturday

2 It is raining today.3 if n is an integer then (2n + 1)2 mod 8 = 1.4 if n is an odd prime number then 2n−1 mod n = 15 There are no positive integers x , y , z satisfying the equality

x5 + y5 = z5

6 There are infinitely many prime numbers q such that q = 4p + 1where p is prime.

() Discrete Mathematicsand its Applications Ngày 12 tháng 9 năm 2011 2 / 16

Page 10: =1=Discrete Mathematics and its Applicationsfaculty.washington.edu/moishe/hanoi-2011/Discrete... · 2011-09-12 · Discrete Mathematics and its Applications Ngày 12 tháng 9 năm

Propositions

DefinitionA Proposition is a statement of a fact which is either true or false butnot both.

Example1 Today is Saturday2 It is raining today.

3 if n is an integer then (2n + 1)2 mod 8 = 1.4 if n is an odd prime number then 2n−1 mod n = 15 There are no positive integers x , y , z satisfying the equality

x5 + y5 = z5

6 There are infinitely many prime numbers q such that q = 4p + 1where p is prime.

() Discrete Mathematicsand its Applications Ngày 12 tháng 9 năm 2011 2 / 16

Page 11: =1=Discrete Mathematics and its Applicationsfaculty.washington.edu/moishe/hanoi-2011/Discrete... · 2011-09-12 · Discrete Mathematics and its Applications Ngày 12 tháng 9 năm

Propositions

DefinitionA Proposition is a statement of a fact which is either true or false butnot both.

Example1 Today is Saturday2 It is raining today.3 if n is an integer then (2n + 1)2 mod 8 = 1.

4 if n is an odd prime number then 2n−1 mod n = 15 There are no positive integers x , y , z satisfying the equality

x5 + y5 = z5

6 There are infinitely many prime numbers q such that q = 4p + 1where p is prime.

() Discrete Mathematicsand its Applications Ngày 12 tháng 9 năm 2011 2 / 16

Page 12: =1=Discrete Mathematics and its Applicationsfaculty.washington.edu/moishe/hanoi-2011/Discrete... · 2011-09-12 · Discrete Mathematics and its Applications Ngày 12 tháng 9 năm

Propositions

DefinitionA Proposition is a statement of a fact which is either true or false butnot both.

Example1 Today is Saturday2 It is raining today.3 if n is an integer then (2n + 1)2 mod 8 = 1.4 if n is an odd prime number then 2n−1 mod n = 1

5 There are no positive integers x , y , z satisfying the equalityx5 + y5 = z5

6 There are infinitely many prime numbers q such that q = 4p + 1where p is prime.

() Discrete Mathematicsand its Applications Ngày 12 tháng 9 năm 2011 2 / 16

Page 13: =1=Discrete Mathematics and its Applicationsfaculty.washington.edu/moishe/hanoi-2011/Discrete... · 2011-09-12 · Discrete Mathematics and its Applications Ngày 12 tháng 9 năm

Propositions

DefinitionA Proposition is a statement of a fact which is either true or false butnot both.

Example1 Today is Saturday2 It is raining today.3 if n is an integer then (2n + 1)2 mod 8 = 1.4 if n is an odd prime number then 2n−1 mod n = 15 There are no positive integers x , y , z satisfying the equality

x5 + y5 = z5

6 There are infinitely many prime numbers q such that q = 4p + 1where p is prime.

() Discrete Mathematicsand its Applications Ngày 12 tháng 9 năm 2011 2 / 16

Page 14: =1=Discrete Mathematics and its Applicationsfaculty.washington.edu/moishe/hanoi-2011/Discrete... · 2011-09-12 · Discrete Mathematics and its Applications Ngày 12 tháng 9 năm

Propositions

DefinitionA Proposition is a statement of a fact which is either true or false butnot both.

Example1 Today is Saturday2 It is raining today.3 if n is an integer then (2n + 1)2 mod 8 = 1.4 if n is an odd prime number then 2n−1 mod n = 15 There are no positive integers x , y , z satisfying the equality

x5 + y5 = z5

6 There are infinitely many prime numbers q such that q = 4p + 1where p is prime.

() Discrete Mathematicsand its Applications Ngày 12 tháng 9 năm 2011 2 / 16

Page 15: =1=Discrete Mathematics and its Applicationsfaculty.washington.edu/moishe/hanoi-2011/Discrete... · 2011-09-12 · Discrete Mathematics and its Applications Ngày 12 tháng 9 năm

Non-propositions

Here are some examples of sentences which are not propositions.

Example

1 Do not drive over the speed limit.2 Do not use your cell phone while driving.3 a2 + b2 = c2

4 Hoang lives in Hanoi. He owns a xe may. Hoang fixes all xe maysin Hanoi belonging to people that do not fix their own xe may.

1 and 2 are not propositions as they do not state a fact.3 can be both true and false, depending on the values of a,b, c4 is a bit more intricate. Hoang cannot fix his own xe may since hefixes only those belonging to people that do not fix their own xemay but if he does not fix his own xe may then he is fixing it.

() Discrete Mathematicsand its Applications Ngày 12 tháng 9 năm 2011 3 / 16

Page 16: =1=Discrete Mathematics and its Applicationsfaculty.washington.edu/moishe/hanoi-2011/Discrete... · 2011-09-12 · Discrete Mathematics and its Applications Ngày 12 tháng 9 năm

Non-propositions

Here are some examples of sentences which are not propositions.

Example1 Do not drive over the speed limit.

2 Do not use your cell phone while driving.3 a2 + b2 = c2

4 Hoang lives in Hanoi. He owns a xe may. Hoang fixes all xe maysin Hanoi belonging to people that do not fix their own xe may.

1 and 2 are not propositions as they do not state a fact.3 can be both true and false, depending on the values of a,b, c4 is a bit more intricate. Hoang cannot fix his own xe may since hefixes only those belonging to people that do not fix their own xemay but if he does not fix his own xe may then he is fixing it.

() Discrete Mathematicsand its Applications Ngày 12 tháng 9 năm 2011 3 / 16

Page 17: =1=Discrete Mathematics and its Applicationsfaculty.washington.edu/moishe/hanoi-2011/Discrete... · 2011-09-12 · Discrete Mathematics and its Applications Ngày 12 tháng 9 năm

Non-propositions

Here are some examples of sentences which are not propositions.

Example1 Do not drive over the speed limit.2 Do not use your cell phone while driving.

3 a2 + b2 = c2

4 Hoang lives in Hanoi. He owns a xe may. Hoang fixes all xe maysin Hanoi belonging to people that do not fix their own xe may.

1 and 2 are not propositions as they do not state a fact.3 can be both true and false, depending on the values of a,b, c4 is a bit more intricate. Hoang cannot fix his own xe may since hefixes only those belonging to people that do not fix their own xemay but if he does not fix his own xe may then he is fixing it.

() Discrete Mathematicsand its Applications Ngày 12 tháng 9 năm 2011 3 / 16

Page 18: =1=Discrete Mathematics and its Applicationsfaculty.washington.edu/moishe/hanoi-2011/Discrete... · 2011-09-12 · Discrete Mathematics and its Applications Ngày 12 tháng 9 năm

Non-propositions

Here are some examples of sentences which are not propositions.

Example1 Do not drive over the speed limit.2 Do not use your cell phone while driving.3 a2 + b2 = c2

4 Hoang lives in Hanoi. He owns a xe may. Hoang fixes all xe maysin Hanoi belonging to people that do not fix their own xe may.

1 and 2 are not propositions as they do not state a fact.3 can be both true and false, depending on the values of a,b, c4 is a bit more intricate. Hoang cannot fix his own xe may since hefixes only those belonging to people that do not fix their own xemay but if he does not fix his own xe may then he is fixing it.

() Discrete Mathematicsand its Applications Ngày 12 tháng 9 năm 2011 3 / 16

Page 19: =1=Discrete Mathematics and its Applicationsfaculty.washington.edu/moishe/hanoi-2011/Discrete... · 2011-09-12 · Discrete Mathematics and its Applications Ngày 12 tháng 9 năm

Non-propositions

Here are some examples of sentences which are not propositions.

Example1 Do not drive over the speed limit.2 Do not use your cell phone while driving.3 a2 + b2 = c2

4 Hoang lives in Hanoi. He owns a xe may. Hoang fixes all xe maysin Hanoi belonging to people that do not fix their own xe may.

1 and 2 are not propositions as they do not state a fact.3 can be both true and false, depending on the values of a,b, c4 is a bit more intricate. Hoang cannot fix his own xe may since hefixes only those belonging to people that do not fix their own xemay but if he does not fix his own xe may then he is fixing it.

() Discrete Mathematicsand its Applications Ngày 12 tháng 9 năm 2011 3 / 16

Page 20: =1=Discrete Mathematics and its Applicationsfaculty.washington.edu/moishe/hanoi-2011/Discrete... · 2011-09-12 · Discrete Mathematics and its Applications Ngày 12 tháng 9 năm

Non-propositions

Here are some examples of sentences which are not propositions.

Example1 Do not drive over the speed limit.2 Do not use your cell phone while driving.3 a2 + b2 = c2

4 Hoang lives in Hanoi. He owns a xe may. Hoang fixes all xe maysin Hanoi belonging to people that do not fix their own xe may.

1 and 2 are not propositions as they do not state a fact.3 can be both true and false, depending on the values of a,b, c4 is a bit more intricate. Hoang cannot fix his own xe may since hefixes only those belonging to people that do not fix their own xemay but if he does not fix his own xe may then he is fixing it.

() Discrete Mathematicsand its Applications Ngày 12 tháng 9 năm 2011 3 / 16

Page 21: =1=Discrete Mathematics and its Applicationsfaculty.washington.edu/moishe/hanoi-2011/Discrete... · 2011-09-12 · Discrete Mathematics and its Applications Ngày 12 tháng 9 năm

Non-propositions

Here are some examples of sentences which are not propositions.

Example1 Do not drive over the speed limit.2 Do not use your cell phone while driving.3 a2 + b2 = c2

4 Hoang lives in Hanoi. He owns a xe may. Hoang fixes all xe maysin Hanoi belonging to people that do not fix their own xe may.

1 and 2 are not propositions as they do not state a fact.

3 can be both true and false, depending on the values of a,b, c4 is a bit more intricate. Hoang cannot fix his own xe may since hefixes only those belonging to people that do not fix their own xemay but if he does not fix his own xe may then he is fixing it.

() Discrete Mathematicsand its Applications Ngày 12 tháng 9 năm 2011 3 / 16

Page 22: =1=Discrete Mathematics and its Applicationsfaculty.washington.edu/moishe/hanoi-2011/Discrete... · 2011-09-12 · Discrete Mathematics and its Applications Ngày 12 tháng 9 năm

Non-propositions

Here are some examples of sentences which are not propositions.

Example1 Do not drive over the speed limit.2 Do not use your cell phone while driving.3 a2 + b2 = c2

4 Hoang lives in Hanoi. He owns a xe may. Hoang fixes all xe maysin Hanoi belonging to people that do not fix their own xe may.

1 and 2 are not propositions as they do not state a fact.3 can be both true and false, depending on the values of a,b, c

4 is a bit more intricate. Hoang cannot fix his own xe may since hefixes only those belonging to people that do not fix their own xemay but if he does not fix his own xe may then he is fixing it.

() Discrete Mathematicsand its Applications Ngày 12 tháng 9 năm 2011 3 / 16

Page 23: =1=Discrete Mathematics and its Applicationsfaculty.washington.edu/moishe/hanoi-2011/Discrete... · 2011-09-12 · Discrete Mathematics and its Applications Ngày 12 tháng 9 năm

Non-propositions

Here are some examples of sentences which are not propositions.

Example1 Do not drive over the speed limit.2 Do not use your cell phone while driving.3 a2 + b2 = c2

4 Hoang lives in Hanoi. He owns a xe may. Hoang fixes all xe maysin Hanoi belonging to people that do not fix their own xe may.

1 and 2 are not propositions as they do not state a fact.3 can be both true and false, depending on the values of a,b, c4 is a bit more intricate. Hoang cannot fix his own xe may since hefixes only those belonging to people that do not fix their own xemay but if he does not fix his own xe may then he is fixing it.

() Discrete Mathematicsand its Applications Ngày 12 tháng 9 năm 2011 3 / 16

Page 24: =1=Discrete Mathematics and its Applicationsfaculty.washington.edu/moishe/hanoi-2011/Discrete... · 2011-09-12 · Discrete Mathematics and its Applications Ngày 12 tháng 9 năm

Logic operation

Logic operations and compound propositions were introduced by theEnglish mathematician George Boole in 1848. This lay the foundationof developing the digital computer 100 years later.

We shall denote propositions by letters: p,q, r , s, . . ..

DefinitionA Boolean Variable is a variable whose domain is propositions andrange just two values, commonly denoted by TRUE, FALSE.Sometimes we also use {1,2}.

CommentAlmost all programming languages include boolean variables.

() Discrete Mathematicsand its Applications Ngày 12 tháng 9 năm 2011 4 / 16

Page 25: =1=Discrete Mathematics and its Applicationsfaculty.washington.edu/moishe/hanoi-2011/Discrete... · 2011-09-12 · Discrete Mathematics and its Applications Ngày 12 tháng 9 năm

Logic operation

Logic operations and compound propositions were introduced by theEnglish mathematician George Boole in 1848. This lay the foundationof developing the digital computer 100 years later.

We shall denote propositions by letters: p,q, r , s, . . ..

DefinitionA Boolean Variable is a variable whose domain is propositions andrange just two values, commonly denoted by TRUE, FALSE.Sometimes we also use {1,2}.

CommentAlmost all programming languages include boolean variables.

() Discrete Mathematicsand its Applications Ngày 12 tháng 9 năm 2011 4 / 16

Page 26: =1=Discrete Mathematics and its Applicationsfaculty.washington.edu/moishe/hanoi-2011/Discrete... · 2011-09-12 · Discrete Mathematics and its Applications Ngày 12 tháng 9 năm

Logic operation

Logic operations and compound propositions were introduced by theEnglish mathematician George Boole in 1848. This lay the foundationof developing the digital computer 100 years later.

We shall denote propositions by letters: p,q, r , s, . . ..

DefinitionA Boolean Variable is a variable whose domain is propositions andrange just two values, commonly denoted by TRUE, FALSE.Sometimes we also use {1,2}.

CommentAlmost all programming languages include boolean variables.

() Discrete Mathematicsand its Applications Ngày 12 tháng 9 năm 2011 4 / 16

Page 27: =1=Discrete Mathematics and its Applicationsfaculty.washington.edu/moishe/hanoi-2011/Discrete... · 2011-09-12 · Discrete Mathematics and its Applications Ngày 12 tháng 9 năm

Logic operations

QuestionWhat can be done with a single boolean variable that has only twovalues?

AnswerNot much more than a light switch, it can be off or on. But combiningan array of boolean variables, like 32 in common processors yields 232

different patterns, That is more than 4,000,000,000 patterns!

Combining boolean variable is done with logic or boolean operators.

() Discrete Mathematicsand its Applications Ngày 12 tháng 9 năm 2011 5 / 16

Page 28: =1=Discrete Mathematics and its Applicationsfaculty.washington.edu/moishe/hanoi-2011/Discrete... · 2011-09-12 · Discrete Mathematics and its Applications Ngày 12 tháng 9 năm

Logic operations

QuestionWhat can be done with a single boolean variable that has only twovalues?

AnswerNot much more than a light switch, it can be off or on. But combiningan array of boolean variables, like 32 in common processors yields 232

different patterns, That is more than 4,000,000,000 patterns!

Combining boolean variable is done with logic or boolean operators.

() Discrete Mathematicsand its Applications Ngày 12 tháng 9 năm 2011 5 / 16

Page 29: =1=Discrete Mathematics and its Applicationsfaculty.washington.edu/moishe/hanoi-2011/Discrete... · 2011-09-12 · Discrete Mathematics and its Applications Ngày 12 tháng 9 năm

Logic operations

QuestionWhat can be done with a single boolean variable that has only twovalues?

AnswerNot much more than a light switch, it can be off or on. But combiningan array of boolean variables, like 32 in common processors yields 232

different patterns, That is more than 4,000,000,000 patterns!

Combining boolean variable is done with logic or boolean operators.

() Discrete Mathematicsand its Applications Ngày 12 tháng 9 năm 2011 5 / 16

Page 30: =1=Discrete Mathematics and its Applicationsfaculty.washington.edu/moishe/hanoi-2011/Discrete... · 2011-09-12 · Discrete Mathematics and its Applications Ngày 12 tháng 9 năm

Example (Compound Propositions)

1 Phuong’s PC does not run UNIX.2 The speed limit in Hanoi for xe may is 40 km/hour and for trucks

30 km/hour.3 If n is prime then if a < n then an−1 mod n = 14 if n is prime or n = pk , p prime then there is a finite field of order

n.

DiscussionEach proposition is composed of one or more propositions connectedby key words:

1 not: number 1 has one proposition.2 and: number 2 has two propositions3 or: number 4 has 3 propositions4 if then number 3 has 3 propositions.

() Discrete Mathematicsand its Applications Ngày 12 tháng 9 năm 2011 6 / 16

Page 31: =1=Discrete Mathematics and its Applicationsfaculty.washington.edu/moishe/hanoi-2011/Discrete... · 2011-09-12 · Discrete Mathematics and its Applications Ngày 12 tháng 9 năm

Example (Compound Propositions)1 Phuong’s PC does not run UNIX.

2 The speed limit in Hanoi for xe may is 40 km/hour and for trucks30 km/hour.

3 If n is prime then if a < n then an−1 mod n = 14 if n is prime or n = pk , p prime then there is a finite field of order

n.

DiscussionEach proposition is composed of one or more propositions connectedby key words:

1 not: number 1 has one proposition.2 and: number 2 has two propositions3 or: number 4 has 3 propositions4 if then number 3 has 3 propositions.

() Discrete Mathematicsand its Applications Ngày 12 tháng 9 năm 2011 6 / 16

Page 32: =1=Discrete Mathematics and its Applicationsfaculty.washington.edu/moishe/hanoi-2011/Discrete... · 2011-09-12 · Discrete Mathematics and its Applications Ngày 12 tháng 9 năm

Example (Compound Propositions)1 Phuong’s PC does not run UNIX.2 The speed limit in Hanoi for xe may is 40 km/hour and for trucks

30 km/hour.

3 If n is prime then if a < n then an−1 mod n = 14 if n is prime or n = pk , p prime then there is a finite field of order

n.

DiscussionEach proposition is composed of one or more propositions connectedby key words:

1 not: number 1 has one proposition.2 and: number 2 has two propositions3 or: number 4 has 3 propositions4 if then number 3 has 3 propositions.

() Discrete Mathematicsand its Applications Ngày 12 tháng 9 năm 2011 6 / 16

Page 33: =1=Discrete Mathematics and its Applicationsfaculty.washington.edu/moishe/hanoi-2011/Discrete... · 2011-09-12 · Discrete Mathematics and its Applications Ngày 12 tháng 9 năm

Example (Compound Propositions)1 Phuong’s PC does not run UNIX.2 The speed limit in Hanoi for xe may is 40 km/hour and for trucks

30 km/hour.3 If n is prime then if a < n then an−1 mod n = 1

4 if n is prime or n = pk , p prime then there is a finite field of ordern.

DiscussionEach proposition is composed of one or more propositions connectedby key words:

1 not: number 1 has one proposition.2 and: number 2 has two propositions3 or: number 4 has 3 propositions4 if then number 3 has 3 propositions.

() Discrete Mathematicsand its Applications Ngày 12 tháng 9 năm 2011 6 / 16

Page 34: =1=Discrete Mathematics and its Applicationsfaculty.washington.edu/moishe/hanoi-2011/Discrete... · 2011-09-12 · Discrete Mathematics and its Applications Ngày 12 tháng 9 năm

Example (Compound Propositions)1 Phuong’s PC does not run UNIX.2 The speed limit in Hanoi for xe may is 40 km/hour and for trucks

30 km/hour.3 If n is prime then if a < n then an−1 mod n = 14 if n is prime or n = pk , p prime then there is a finite field of order

n.

DiscussionEach proposition is composed of one or more propositions connectedby key words:

1 not: number 1 has one proposition.2 and: number 2 has two propositions3 or: number 4 has 3 propositions4 if then number 3 has 3 propositions.

() Discrete Mathematicsand its Applications Ngày 12 tháng 9 năm 2011 6 / 16

Page 35: =1=Discrete Mathematics and its Applicationsfaculty.washington.edu/moishe/hanoi-2011/Discrete... · 2011-09-12 · Discrete Mathematics and its Applications Ngày 12 tháng 9 năm

Example (Compound Propositions)1 Phuong’s PC does not run UNIX.2 The speed limit in Hanoi for xe may is 40 km/hour and for trucks

30 km/hour.3 If n is prime then if a < n then an−1 mod n = 14 if n is prime or n = pk , p prime then there is a finite field of order

n.

DiscussionEach proposition is composed of one or more propositions connectedby key words:

1 not: number 1 has one proposition.2 and: number 2 has two propositions3 or: number 4 has 3 propositions4 if then number 3 has 3 propositions.

() Discrete Mathematicsand its Applications Ngày 12 tháng 9 năm 2011 6 / 16

Page 36: =1=Discrete Mathematics and its Applicationsfaculty.washington.edu/moishe/hanoi-2011/Discrete... · 2011-09-12 · Discrete Mathematics and its Applications Ngày 12 tháng 9 năm

Example (Compound Propositions)1 Phuong’s PC does not run UNIX.2 The speed limit in Hanoi for xe may is 40 km/hour and for trucks

30 km/hour.3 If n is prime then if a < n then an−1 mod n = 14 if n is prime or n = pk , p prime then there is a finite field of order

n.

DiscussionEach proposition is composed of one or more propositions connectedby key words:

1 not: number 1 has one proposition.

2 and: number 2 has two propositions3 or: number 4 has 3 propositions4 if then number 3 has 3 propositions.

() Discrete Mathematicsand its Applications Ngày 12 tháng 9 năm 2011 6 / 16

Page 37: =1=Discrete Mathematics and its Applicationsfaculty.washington.edu/moishe/hanoi-2011/Discrete... · 2011-09-12 · Discrete Mathematics and its Applications Ngày 12 tháng 9 năm

Example (Compound Propositions)1 Phuong’s PC does not run UNIX.2 The speed limit in Hanoi for xe may is 40 km/hour and for trucks

30 km/hour.3 If n is prime then if a < n then an−1 mod n = 14 if n is prime or n = pk , p prime then there is a finite field of order

n.

DiscussionEach proposition is composed of one or more propositions connectedby key words:

1 not: number 1 has one proposition.2 and: number 2 has two propositions

3 or: number 4 has 3 propositions4 if then number 3 has 3 propositions.

() Discrete Mathematicsand its Applications Ngày 12 tháng 9 năm 2011 6 / 16

Page 38: =1=Discrete Mathematics and its Applicationsfaculty.washington.edu/moishe/hanoi-2011/Discrete... · 2011-09-12 · Discrete Mathematics and its Applications Ngày 12 tháng 9 năm

Example (Compound Propositions)1 Phuong’s PC does not run UNIX.2 The speed limit in Hanoi for xe may is 40 km/hour and for trucks

30 km/hour.3 If n is prime then if a < n then an−1 mod n = 14 if n is prime or n = pk , p prime then there is a finite field of order

n.

DiscussionEach proposition is composed of one or more propositions connectedby key words:

1 not: number 1 has one proposition.2 and: number 2 has two propositions3 or: number 4 has 3 propositions

4 if then number 3 has 3 propositions.

() Discrete Mathematicsand its Applications Ngày 12 tháng 9 năm 2011 6 / 16

Page 39: =1=Discrete Mathematics and its Applicationsfaculty.washington.edu/moishe/hanoi-2011/Discrete... · 2011-09-12 · Discrete Mathematics and its Applications Ngày 12 tháng 9 năm

Example (Compound Propositions)1 Phuong’s PC does not run UNIX.2 The speed limit in Hanoi for xe may is 40 km/hour and for trucks

30 km/hour.3 If n is prime then if a < n then an−1 mod n = 14 if n is prime or n = pk , p prime then there is a finite field of order

n.

DiscussionEach proposition is composed of one or more propositions connectedby key words:

1 not: number 1 has one proposition.2 and: number 2 has two propositions3 or: number 4 has 3 propositions4 if then number 3 has 3 propositions.

() Discrete Mathematicsand its Applications Ngày 12 tháng 9 năm 2011 6 / 16

Page 40: =1=Discrete Mathematics and its Applicationsfaculty.washington.edu/moishe/hanoi-2011/Discrete... · 2011-09-12 · Discrete Mathematics and its Applications Ngày 12 tháng 9 năm

1 not is a unary operator, ¬p inverts the truth value of p.

2 and is a binary operator, p ∧ q is true only when both p and q aretrue.

3 or is a binary operator, p ∨ q is false only when both are false.4 implies (if then) is a binary operator p → q is false only when p is

true and q is false.

Truth tables are used to describe these and also the truth values ofcompound propositions.

1 All these operators can be physically implemented electronically.2 These are the building blocks of micro-processors and many other

systems.

There are other binary operators. Truth tables will help us understandhow to construct them.

() Discrete Mathematicsand its Applications Ngày 12 tháng 9 năm 2011 7 / 16

Page 41: =1=Discrete Mathematics and its Applicationsfaculty.washington.edu/moishe/hanoi-2011/Discrete... · 2011-09-12 · Discrete Mathematics and its Applications Ngày 12 tháng 9 năm

1 not is a unary operator, ¬p inverts the truth value of p.2 and is a binary operator, p ∧ q is true only when both p and q are

true.

3 or is a binary operator, p ∨ q is false only when both are false.4 implies (if then) is a binary operator p → q is false only when p is

true and q is false.

Truth tables are used to describe these and also the truth values ofcompound propositions.

1 All these operators can be physically implemented electronically.2 These are the building blocks of micro-processors and many other

systems.

There are other binary operators. Truth tables will help us understandhow to construct them.

() Discrete Mathematicsand its Applications Ngày 12 tháng 9 năm 2011 7 / 16

Page 42: =1=Discrete Mathematics and its Applicationsfaculty.washington.edu/moishe/hanoi-2011/Discrete... · 2011-09-12 · Discrete Mathematics and its Applications Ngày 12 tháng 9 năm

1 not is a unary operator, ¬p inverts the truth value of p.2 and is a binary operator, p ∧ q is true only when both p and q are

true.3 or is a binary operator, p ∨ q is false only when both are false.

4 implies (if then) is a binary operator p → q is false only when p istrue and q is false.

Truth tables are used to describe these and also the truth values ofcompound propositions.

1 All these operators can be physically implemented electronically.2 These are the building blocks of micro-processors and many other

systems.

There are other binary operators. Truth tables will help us understandhow to construct them.

() Discrete Mathematicsand its Applications Ngày 12 tháng 9 năm 2011 7 / 16

Page 43: =1=Discrete Mathematics and its Applicationsfaculty.washington.edu/moishe/hanoi-2011/Discrete... · 2011-09-12 · Discrete Mathematics and its Applications Ngày 12 tháng 9 năm

1 not is a unary operator, ¬p inverts the truth value of p.2 and is a binary operator, p ∧ q is true only when both p and q are

true.3 or is a binary operator, p ∨ q is false only when both are false.4 implies (if then) is a binary operator p → q is false only when p is

true and q is false.

Truth tables are used to describe these and also the truth values ofcompound propositions.

1 All these operators can be physically implemented electronically.2 These are the building blocks of micro-processors and many other

systems.

There are other binary operators. Truth tables will help us understandhow to construct them.

() Discrete Mathematicsand its Applications Ngày 12 tháng 9 năm 2011 7 / 16

Page 44: =1=Discrete Mathematics and its Applicationsfaculty.washington.edu/moishe/hanoi-2011/Discrete... · 2011-09-12 · Discrete Mathematics and its Applications Ngày 12 tháng 9 năm

1 not is a unary operator, ¬p inverts the truth value of p.2 and is a binary operator, p ∧ q is true only when both p and q are

true.3 or is a binary operator, p ∨ q is false only when both are false.4 implies (if then) is a binary operator p → q is false only when p is

true and q is false.

Truth tables are used to describe these and also the truth values ofcompound propositions.

1 All these operators can be physically implemented electronically.2 These are the building blocks of micro-processors and many other

systems.

There are other binary operators. Truth tables will help us understandhow to construct them.

() Discrete Mathematicsand its Applications Ngày 12 tháng 9 năm 2011 7 / 16

Page 45: =1=Discrete Mathematics and its Applicationsfaculty.washington.edu/moishe/hanoi-2011/Discrete... · 2011-09-12 · Discrete Mathematics and its Applications Ngày 12 tháng 9 năm

1 not is a unary operator, ¬p inverts the truth value of p.2 and is a binary operator, p ∧ q is true only when both p and q are

true.3 or is a binary operator, p ∨ q is false only when both are false.4 implies (if then) is a binary operator p → q is false only when p is

true and q is false.

Truth tables are used to describe these and also the truth values ofcompound propositions.

1 All these operators can be physically implemented electronically.

2 These are the building blocks of micro-processors and many othersystems.

There are other binary operators. Truth tables will help us understandhow to construct them.

() Discrete Mathematicsand its Applications Ngày 12 tháng 9 năm 2011 7 / 16

Page 46: =1=Discrete Mathematics and its Applicationsfaculty.washington.edu/moishe/hanoi-2011/Discrete... · 2011-09-12 · Discrete Mathematics and its Applications Ngày 12 tháng 9 năm

1 not is a unary operator, ¬p inverts the truth value of p.2 and is a binary operator, p ∧ q is true only when both p and q are

true.3 or is a binary operator, p ∨ q is false only when both are false.4 implies (if then) is a binary operator p → q is false only when p is

true and q is false.

Truth tables are used to describe these and also the truth values ofcompound propositions.

1 All these operators can be physically implemented electronically.2 These are the building blocks of micro-processors and many other

systems.

There are other binary operators. Truth tables will help us understandhow to construct them.

() Discrete Mathematicsand its Applications Ngày 12 tháng 9 năm 2011 7 / 16

Page 47: =1=Discrete Mathematics and its Applicationsfaculty.washington.edu/moishe/hanoi-2011/Discrete... · 2011-09-12 · Discrete Mathematics and its Applications Ngày 12 tháng 9 năm

1 not is a unary operator, ¬p inverts the truth value of p.2 and is a binary operator, p ∧ q is true only when both p and q are

true.3 or is a binary operator, p ∨ q is false only when both are false.4 implies (if then) is a binary operator p → q is false only when p is

true and q is false.

Truth tables are used to describe these and also the truth values ofcompound propositions.

1 All these operators can be physically implemented electronically.2 These are the building blocks of micro-processors and many other

systems.

There are other binary operators. Truth tables will help us understandhow to construct them.

() Discrete Mathematicsand its Applications Ngày 12 tháng 9 năm 2011 7 / 16

Page 48: =1=Discrete Mathematics and its Applicationsfaculty.washington.edu/moishe/hanoi-2011/Discrete... · 2011-09-12 · Discrete Mathematics and its Applications Ngày 12 tháng 9 năm

1 not is a unary operator, ¬p inverts the truth value of p.2 and is a binary operator, p ∧ q is true only when both p and q are

true.3 or is a binary operator, p ∨ q is false only when both are false.4 implies (if then) is a binary operator p → q is false only when p is

true and q is false.

Truth tables are used to describe these and also the truth values ofcompound propositions.

1 All these operators can be physically implemented electronically.2 These are the building blocks of micro-processors and many other

systems.

There are other binary operators. Truth tables will help us understandhow to construct them.

() Discrete Mathematicsand its Applications Ngày 12 tháng 9 năm 2011 7 / 16

Page 49: =1=Discrete Mathematics and its Applicationsfaculty.washington.edu/moishe/hanoi-2011/Discrete... · 2011-09-12 · Discrete Mathematics and its Applications Ngày 12 tháng 9 năm

Truth Tables

Truth table for the unary operator not:

p ¬pT FF T

Truth tables for the binary operators ∧ ∨ →:

p q p ∧ q p ∨ q p → qT T T T TF T F T TT F F T FF F F F T

() Discrete Mathematicsand its Applications Ngày 12 tháng 9 năm 2011 8 / 16

Page 50: =1=Discrete Mathematics and its Applicationsfaculty.washington.edu/moishe/hanoi-2011/Discrete... · 2011-09-12 · Discrete Mathematics and its Applications Ngày 12 tháng 9 năm

Truth Tables

Truth table for the unary operator not:

p ¬pT FF T

Truth tables for the binary operators ∧ ∨ →:

p q p ∧ q p ∨ q p → qT T T T TF T F T TT F F T FF F F F T

() Discrete Mathematicsand its Applications Ngày 12 tháng 9 năm 2011 8 / 16

Page 51: =1=Discrete Mathematics and its Applicationsfaculty.washington.edu/moishe/hanoi-2011/Discrete... · 2011-09-12 · Discrete Mathematics and its Applications Ngày 12 tháng 9 năm

Evaluating compound propositions with truth tables

ExampleWe wish to build the truth table for the compound proposition:(p → q) ∧ (¬p → q)

p q p → q ¬p → q (p → q) ∧ (¬p → q)

T T T T TF T T T TT F F T FF F T F F

() Discrete Mathematicsand its Applications Ngày 12 tháng 9 năm 2011 9 / 16

Page 52: =1=Discrete Mathematics and its Applicationsfaculty.washington.edu/moishe/hanoi-2011/Discrete... · 2011-09-12 · Discrete Mathematics and its Applications Ngày 12 tháng 9 năm

Question

1 How many possible binary operators are there?2 How many non-trivial binary operators are there?3 How many rows will be needed in the truth table of a compound

proposition with 5 different boolean variables?

CommentHere is a list of commonly used binary operators, their names anddescription:

1 nor, the reverse of or, p ↓ q is true only when both p and q arefalse.

2 nand, the reverse of and. p | q is false only when both p and q aretrue.

3 xor (exclusive or) p ⊕ q is true only when they are different (one istrue and the other is false).

4 implies p → q is false only when p = true and q = false.5 Biconditional p ↔ q is true only if both are equal.

It should be easy now to construct the truth tables of these binary logicoperators.

() Discrete Mathematicsand its Applications Ngày 12 tháng 9 năm 2011 10 / 16

Page 53: =1=Discrete Mathematics and its Applicationsfaculty.washington.edu/moishe/hanoi-2011/Discrete... · 2011-09-12 · Discrete Mathematics and its Applications Ngày 12 tháng 9 năm

Question1 How many possible binary operators are there?

2 How many non-trivial binary operators are there?3 How many rows will be needed in the truth table of a compound

proposition with 5 different boolean variables?

CommentHere is a list of commonly used binary operators, their names anddescription:

1 nor, the reverse of or, p ↓ q is true only when both p and q arefalse.

2 nand, the reverse of and. p | q is false only when both p and q aretrue.

3 xor (exclusive or) p ⊕ q is true only when they are different (one istrue and the other is false).

4 implies p → q is false only when p = true and q = false.5 Biconditional p ↔ q is true only if both are equal.

It should be easy now to construct the truth tables of these binary logicoperators.

() Discrete Mathematicsand its Applications Ngày 12 tháng 9 năm 2011 10 / 16

Page 54: =1=Discrete Mathematics and its Applicationsfaculty.washington.edu/moishe/hanoi-2011/Discrete... · 2011-09-12 · Discrete Mathematics and its Applications Ngày 12 tháng 9 năm

Question1 How many possible binary operators are there?2 How many non-trivial binary operators are there?

3 How many rows will be needed in the truth table of a compoundproposition with 5 different boolean variables?

CommentHere is a list of commonly used binary operators, their names anddescription:

1 nor, the reverse of or, p ↓ q is true only when both p and q arefalse.

2 nand, the reverse of and. p | q is false only when both p and q aretrue.

3 xor (exclusive or) p ⊕ q is true only when they are different (one istrue and the other is false).

4 implies p → q is false only when p = true and q = false.5 Biconditional p ↔ q is true only if both are equal.

It should be easy now to construct the truth tables of these binary logicoperators.

() Discrete Mathematicsand its Applications Ngày 12 tháng 9 năm 2011 10 / 16

Page 55: =1=Discrete Mathematics and its Applicationsfaculty.washington.edu/moishe/hanoi-2011/Discrete... · 2011-09-12 · Discrete Mathematics and its Applications Ngày 12 tháng 9 năm

Question1 How many possible binary operators are there?2 How many non-trivial binary operators are there?3 How many rows will be needed in the truth table of a compound

proposition with 5 different boolean variables?

CommentHere is a list of commonly used binary operators, their names anddescription:

1 nor, the reverse of or, p ↓ q is true only when both p and q arefalse.

2 nand, the reverse of and. p | q is false only when both p and q aretrue.

3 xor (exclusive or) p ⊕ q is true only when they are different (one istrue and the other is false).

4 implies p → q is false only when p = true and q = false.5 Biconditional p ↔ q is true only if both are equal.

It should be easy now to construct the truth tables of these binary logicoperators.

() Discrete Mathematicsand its Applications Ngày 12 tháng 9 năm 2011 10 / 16

Page 56: =1=Discrete Mathematics and its Applicationsfaculty.washington.edu/moishe/hanoi-2011/Discrete... · 2011-09-12 · Discrete Mathematics and its Applications Ngày 12 tháng 9 năm

Question1 How many possible binary operators are there?2 How many non-trivial binary operators are there?3 How many rows will be needed in the truth table of a compound

proposition with 5 different boolean variables?

CommentHere is a list of commonly used binary operators, their names anddescription:

1 nor, the reverse of or, p ↓ q is true only when both p and q arefalse.

2 nand, the reverse of and. p | q is false only when both p and q aretrue.

3 xor (exclusive or) p ⊕ q is true only when they are different (one istrue and the other is false).

4 implies p → q is false only when p = true and q = false.5 Biconditional p ↔ q is true only if both are equal.

It should be easy now to construct the truth tables of these binary logicoperators.

() Discrete Mathematicsand its Applications Ngày 12 tháng 9 năm 2011 10 / 16

Page 57: =1=Discrete Mathematics and its Applicationsfaculty.washington.edu/moishe/hanoi-2011/Discrete... · 2011-09-12 · Discrete Mathematics and its Applications Ngày 12 tháng 9 năm

Question1 How many possible binary operators are there?2 How many non-trivial binary operators are there?3 How many rows will be needed in the truth table of a compound

proposition with 5 different boolean variables?

CommentHere is a list of commonly used binary operators, their names anddescription:

1 nor, the reverse of or, p ↓ q is true only when both p and q arefalse.

2 nand, the reverse of and. p | q is false only when both p and q aretrue.

3 xor (exclusive or) p ⊕ q is true only when they are different (one istrue and the other is false).

4 implies p → q is false only when p = true and q = false.5 Biconditional p ↔ q is true only if both are equal.

It should be easy now to construct the truth tables of these binary logicoperators.

() Discrete Mathematicsand its Applications Ngày 12 tháng 9 năm 2011 10 / 16

Page 58: =1=Discrete Mathematics and its Applicationsfaculty.washington.edu/moishe/hanoi-2011/Discrete... · 2011-09-12 · Discrete Mathematics and its Applications Ngày 12 tháng 9 năm

Question1 How many possible binary operators are there?2 How many non-trivial binary operators are there?3 How many rows will be needed in the truth table of a compound

proposition with 5 different boolean variables?

CommentHere is a list of commonly used binary operators, their names anddescription:

1 nor, the reverse of or, p ↓ q is true only when both p and q arefalse.

2 nand, the reverse of and. p | q is false only when both p and q aretrue.

3 xor (exclusive or) p ⊕ q is true only when they are different (one istrue and the other is false).

4 implies p → q is false only when p = true and q = false.5 Biconditional p ↔ q is true only if both are equal.

It should be easy now to construct the truth tables of these binary logicoperators.

() Discrete Mathematicsand its Applications Ngày 12 tháng 9 năm 2011 10 / 16

Page 59: =1=Discrete Mathematics and its Applicationsfaculty.washington.edu/moishe/hanoi-2011/Discrete... · 2011-09-12 · Discrete Mathematics and its Applications Ngày 12 tháng 9 năm

Question1 How many possible binary operators are there?2 How many non-trivial binary operators are there?3 How many rows will be needed in the truth table of a compound

proposition with 5 different boolean variables?

CommentHere is a list of commonly used binary operators, their names anddescription:

1 nor, the reverse of or, p ↓ q is true only when both p and q arefalse.

2 nand, the reverse of and. p | q is false only when both p and q aretrue.

3 xor (exclusive or) p ⊕ q is true only when they are different (one istrue and the other is false).

4 implies p → q is false only when p = true and q = false.5 Biconditional p ↔ q is true only if both are equal.

It should be easy now to construct the truth tables of these binary logicoperators.

() Discrete Mathematicsand its Applications Ngày 12 tháng 9 năm 2011 10 / 16

Page 60: =1=Discrete Mathematics and its Applicationsfaculty.washington.edu/moishe/hanoi-2011/Discrete... · 2011-09-12 · Discrete Mathematics and its Applications Ngày 12 tháng 9 năm

Question1 How many possible binary operators are there?2 How many non-trivial binary operators are there?3 How many rows will be needed in the truth table of a compound

proposition with 5 different boolean variables?

CommentHere is a list of commonly used binary operators, their names anddescription:

1 nor, the reverse of or, p ↓ q is true only when both p and q arefalse.

2 nand, the reverse of and. p | q is false only when both p and q aretrue.

3 xor (exclusive or) p ⊕ q is true only when they are different (one istrue and the other is false).

4 implies p → q is false only when p = true and q = false.

5 Biconditional p ↔ q is true only if both are equal.

It should be easy now to construct the truth tables of these binary logicoperators.

() Discrete Mathematicsand its Applications Ngày 12 tháng 9 năm 2011 10 / 16

Page 61: =1=Discrete Mathematics and its Applicationsfaculty.washington.edu/moishe/hanoi-2011/Discrete... · 2011-09-12 · Discrete Mathematics and its Applications Ngày 12 tháng 9 năm

Question1 How many possible binary operators are there?2 How many non-trivial binary operators are there?3 How many rows will be needed in the truth table of a compound

proposition with 5 different boolean variables?

CommentHere is a list of commonly used binary operators, their names anddescription:

1 nor, the reverse of or, p ↓ q is true only when both p and q arefalse.

2 nand, the reverse of and. p | q is false only when both p and q aretrue.

3 xor (exclusive or) p ⊕ q is true only when they are different (one istrue and the other is false).

4 implies p → q is false only when p = true and q = false.5 Biconditional p ↔ q is true only if both are equal.

It should be easy now to construct the truth tables of these binary logicoperators.

() Discrete Mathematicsand its Applications Ngày 12 tháng 9 năm 2011 10 / 16

Page 62: =1=Discrete Mathematics and its Applicationsfaculty.washington.edu/moishe/hanoi-2011/Discrete... · 2011-09-12 · Discrete Mathematics and its Applications Ngày 12 tháng 9 năm

Question1 How many possible binary operators are there?2 How many non-trivial binary operators are there?3 How many rows will be needed in the truth table of a compound

proposition with 5 different boolean variables?

CommentHere is a list of commonly used binary operators, their names anddescription:

1 nor, the reverse of or, p ↓ q is true only when both p and q arefalse.

2 nand, the reverse of and. p | q is false only when both p and q aretrue.

3 xor (exclusive or) p ⊕ q is true only when they are different (one istrue and the other is false).

4 implies p → q is false only when p = true and q = false.5 Biconditional p ↔ q is true only if both are equal.

It should be easy now to construct the truth tables of these binary logicoperators.

() Discrete Mathematicsand its Applications Ngày 12 tháng 9 năm 2011 10 / 16

Page 63: =1=Discrete Mathematics and its Applicationsfaculty.washington.edu/moishe/hanoi-2011/Discrete... · 2011-09-12 · Discrete Mathematics and its Applications Ngày 12 tháng 9 năm

Question1 How many possible binary operators are there?2 How many non-trivial binary operators are there?3 How many rows will be needed in the truth table of a compound

proposition with 5 different boolean variables?

CommentHere is a list of commonly used binary operators, their names anddescription:

1 nor, the reverse of or, p ↓ q is true only when both p and q arefalse.

2 nand, the reverse of and. p | q is false only when both p and q aretrue.

3 xor (exclusive or) p ⊕ q is true only when they are different (one istrue and the other is false).

4 implies p → q is false only when p = true and q = false.5 Biconditional p ↔ q is true only if both are equal.

It should be easy now to construct the truth tables of these binary logicoperators.

() Discrete Mathematicsand its Applications Ngày 12 tháng 9 năm 2011 10 / 16

Page 64: =1=Discrete Mathematics and its Applicationsfaculty.washington.edu/moishe/hanoi-2011/Discrete... · 2011-09-12 · Discrete Mathematics and its Applications Ngày 12 tháng 9 năm

Logic calculations

Applying multiple logic operations is similar to using arithmeticoperations. We need precedence rules. To understand why considerthe expressions p ∨ q ∧ s.

Now suppose both p and q are true and s is false. The truth value ofthis expression will be true if we first evaluate p ∧ s. But if we firstcalculate p ∨ q the result is false. So we need precedences. Here theyare:

Operator Precedence¬ 1∧ 2∨ 3→ 4

() Discrete Mathematicsand its Applications Ngày 12 tháng 9 năm 2011 11 / 16

Page 65: =1=Discrete Mathematics and its Applicationsfaculty.washington.edu/moishe/hanoi-2011/Discrete... · 2011-09-12 · Discrete Mathematics and its Applications Ngày 12 tháng 9 năm

Logic calculations

Applying multiple logic operations is similar to using arithmeticoperations. We need precedence rules. To understand why considerthe expressions p ∨ q ∧ s.Now suppose both p and q are true and s is false. The truth value ofthis expression will be true if we first evaluate p ∧ s. But if we firstcalculate p ∨ q the result is false. So we need precedences. Here theyare:

Operator Precedence¬ 1∧ 2∨ 3→ 4

() Discrete Mathematicsand its Applications Ngày 12 tháng 9 năm 2011 11 / 16

Page 66: =1=Discrete Mathematics and its Applicationsfaculty.washington.edu/moishe/hanoi-2011/Discrete... · 2011-09-12 · Discrete Mathematics and its Applications Ngày 12 tháng 9 năm

Logic calculations

Applying multiple logic operations is similar to using arithmeticoperations. We need precedence rules. To understand why considerthe expressions p ∨ q ∧ s.Now suppose both p and q are true and s is false. The truth value ofthis expression will be true if we first evaluate p ∧ s. But if we firstcalculate p ∨ q the result is false. So we need precedences. Here theyare:

Operator Precedence¬ 1∧ 2∨ 3→ 4

() Discrete Mathematicsand its Applications Ngày 12 tháng 9 năm 2011 11 / 16

Page 67: =1=Discrete Mathematics and its Applicationsfaculty.washington.edu/moishe/hanoi-2011/Discrete... · 2011-09-12 · Discrete Mathematics and its Applications Ngày 12 tháng 9 năm

Logic Computations Rules

Equivalence Namep ∨ F ≡ p; p ∧ T ≡ p Identityp ∨ T ≡ T ; p ∧ F ≡ F Dominationp ∨ p ≡ p; p ∧ p ≡ p Idempotent

p ∨ q ≡ q ∨ p; p ∧ q ≡ q ∧ p commutativep ∨ (q ∨ r) ≡ (p ∨ q) ∨ rp ∧ (q ∧ r) ≡ (p ∧ (q ∧ r) Associative

p ∨ (q ∧ r) ≡ (p ∨ q) ∧ (p ∨ r)p ∧ (q ∨ r) ≡ (p ∧ q) ∨ (p ∧ r Distributive¬(p ∧ q) ≡ ¬p ∨ ¬q¬(p ∨ q) ≡ ¬p ∧ ¬q De Morgan

Bảng: Basic computation laws

() Discrete Mathematicsand its Applications Ngày 12 tháng 9 năm 2011 12 / 16

Page 68: =1=Discrete Mathematics and its Applicationsfaculty.washington.edu/moishe/hanoi-2011/Discrete... · 2011-09-12 · Discrete Mathematics and its Applications Ngày 12 tháng 9 năm

summary

In this lecture we studied:1 propositions

2 compound propositions3 logical operators4 truth tables5 computation rules6 we learned how to use truth tables to evaluate compound

propositions7 we conclude with two entertaining puzzles.

() Discrete Mathematicsand its Applications Ngày 12 tháng 9 năm 2011 13 / 16

Page 69: =1=Discrete Mathematics and its Applicationsfaculty.washington.edu/moishe/hanoi-2011/Discrete... · 2011-09-12 · Discrete Mathematics and its Applications Ngày 12 tháng 9 năm

summary

In this lecture we studied:1 propositions2 compound propositions

3 logical operators4 truth tables5 computation rules6 we learned how to use truth tables to evaluate compound

propositions7 we conclude with two entertaining puzzles.

() Discrete Mathematicsand its Applications Ngày 12 tháng 9 năm 2011 13 / 16

Page 70: =1=Discrete Mathematics and its Applicationsfaculty.washington.edu/moishe/hanoi-2011/Discrete... · 2011-09-12 · Discrete Mathematics and its Applications Ngày 12 tháng 9 năm

summary

In this lecture we studied:1 propositions2 compound propositions3 logical operators

4 truth tables5 computation rules6 we learned how to use truth tables to evaluate compound

propositions7 we conclude with two entertaining puzzles.

() Discrete Mathematicsand its Applications Ngày 12 tháng 9 năm 2011 13 / 16

Page 71: =1=Discrete Mathematics and its Applicationsfaculty.washington.edu/moishe/hanoi-2011/Discrete... · 2011-09-12 · Discrete Mathematics and its Applications Ngày 12 tháng 9 năm

summary

In this lecture we studied:1 propositions2 compound propositions3 logical operators4 truth tables

5 computation rules6 we learned how to use truth tables to evaluate compound

propositions7 we conclude with two entertaining puzzles.

() Discrete Mathematicsand its Applications Ngày 12 tháng 9 năm 2011 13 / 16

Page 72: =1=Discrete Mathematics and its Applicationsfaculty.washington.edu/moishe/hanoi-2011/Discrete... · 2011-09-12 · Discrete Mathematics and its Applications Ngày 12 tháng 9 năm

summary

In this lecture we studied:1 propositions2 compound propositions3 logical operators4 truth tables5 computation rules

6 we learned how to use truth tables to evaluate compoundpropositions

7 we conclude with two entertaining puzzles.

() Discrete Mathematicsand its Applications Ngày 12 tháng 9 năm 2011 13 / 16

Page 73: =1=Discrete Mathematics and its Applicationsfaculty.washington.edu/moishe/hanoi-2011/Discrete... · 2011-09-12 · Discrete Mathematics and its Applications Ngày 12 tháng 9 năm

summary

In this lecture we studied:1 propositions2 compound propositions3 logical operators4 truth tables5 computation rules6 we learned how to use truth tables to evaluate compound

propositions

7 we conclude with two entertaining puzzles.

() Discrete Mathematicsand its Applications Ngày 12 tháng 9 năm 2011 13 / 16

Page 74: =1=Discrete Mathematics and its Applicationsfaculty.washington.edu/moishe/hanoi-2011/Discrete... · 2011-09-12 · Discrete Mathematics and its Applications Ngày 12 tháng 9 năm

summary

In this lecture we studied:1 propositions2 compound propositions3 logical operators4 truth tables5 computation rules6 we learned how to use truth tables to evaluate compound

propositions7 we conclude with two entertaining puzzles.

() Discrete Mathematicsand its Applications Ngày 12 tháng 9 năm 2011 13 / 16

Page 75: =1=Discrete Mathematics and its Applicationsfaculty.washington.edu/moishe/hanoi-2011/Discrete... · 2011-09-12 · Discrete Mathematics and its Applications Ngày 12 tháng 9 năm

A simple puzzle

Trung, Hóa and Tuán had the same Pho for lunch at the samerestaurant. They asked Hà to guess what they ate and where. Tochallenge Há they decided that each will tell Há two facts and at leastone of the fcat will be true..

Trung: We ate Pho bò tái at Pho-24

Hóa: We ate Pho gà at Quàn an Ngon.Tuán: We ate at Cha Cá but definitely not Pho bò tái

What did they eat and where?

() Discrete Mathematicsand its Applications Ngày 12 tháng 9 năm 2011 14 / 16

Page 76: =1=Discrete Mathematics and its Applicationsfaculty.washington.edu/moishe/hanoi-2011/Discrete... · 2011-09-12 · Discrete Mathematics and its Applications Ngày 12 tháng 9 năm

A simple puzzle

Trung, Hóa and Tuán had the same Pho for lunch at the samerestaurant. They asked Hà to guess what they ate and where. Tochallenge Há they decided that each will tell Há two facts and at leastone of the fcat will be true..

Trung: We ate Pho bò tái at Pho-24Hóa: We ate Pho gà at Quàn an Ngon.

Tuán: We ate at Cha Cá but definitely not Pho bò tái

What did they eat and where?

() Discrete Mathematicsand its Applications Ngày 12 tháng 9 năm 2011 14 / 16

Page 77: =1=Discrete Mathematics and its Applicationsfaculty.washington.edu/moishe/hanoi-2011/Discrete... · 2011-09-12 · Discrete Mathematics and its Applications Ngày 12 tháng 9 năm

A simple puzzle

Trung, Hóa and Tuán had the same Pho for lunch at the samerestaurant. They asked Hà to guess what they ate and where. Tochallenge Há they decided that each will tell Há two facts and at leastone of the fcat will be true..

Trung: We ate Pho bò tái at Pho-24Hóa: We ate Pho gà at Quàn an Ngon.Tuán: We ate at Cha Cá but definitely not Pho bò tái

What did they eat and where?

() Discrete Mathematicsand its Applications Ngày 12 tháng 9 năm 2011 14 / 16

Page 78: =1=Discrete Mathematics and its Applicationsfaculty.washington.edu/moishe/hanoi-2011/Discrete... · 2011-09-12 · Discrete Mathematics and its Applications Ngày 12 tháng 9 năm

A simple puzzle

Trung, Hóa and Tuán had the same Pho for lunch at the samerestaurant. They asked Hà to guess what they ate and where. Tochallenge Há they decided that each will tell Há two facts and at leastone of the fcat will be true..

Trung: We ate Pho bò tái at Pho-24Hóa: We ate Pho gà at Quàn an Ngon.Tuán: We ate at Cha Cá but definitely not Pho bò tái

What did they eat and where?

() Discrete Mathematicsand its Applications Ngày 12 tháng 9 năm 2011 14 / 16

Page 79: =1=Discrete Mathematics and its Applicationsfaculty.washington.edu/moishe/hanoi-2011/Discrete... · 2011-09-12 · Discrete Mathematics and its Applications Ngày 12 tháng 9 năm

A simple puzzle

Trung, Hóa and Tuán had the same Pho for lunch at the samerestaurant. They asked Hà to guess what they ate and where. Tochallenge Há they decided that each will tell Há two facts and at leastone of the fcat will be true..

Trung: We ate Pho bò tái at Pho-24Hóa: We ate Pho gà at Quàn an Ngon.Tuán: We ate at Cha Cá but definitely not Pho bò tái

What did they eat and where?

() Discrete Mathematicsand its Applications Ngày 12 tháng 9 năm 2011 14 / 16

Page 80: =1=Discrete Mathematics and its Applicationsfaculty.washington.edu/moishe/hanoi-2011/Discrete... · 2011-09-12 · Discrete Mathematics and its Applications Ngày 12 tháng 9 năm

To solve this puzzle we introduce five propositions:

a: they ate Pho bò tái

b: they ate at Pho-24c: they ate Pho gàd: they ate at Quàn an Ngone: they ate at Cha Cá

The compound proposition describing their three claims is:(a ∨ b) ∧ (c ∨ d) ∧ (¬a ∨ e) = true which when expanded yields:(a ∧ c ∧ ¬a) ∨ (a ∧ c ∧ e) ∨ (a ∧ d ∧ ¬a) ∨ (a ∧ d ∧ e) ∨ (b ∧ c ∧ ¬a) ∨(b ∧ c ∧ e) ∨ (b ∧ d ∧ ¬a) ∨ (b ∧ d ∧ e) = true.

Among the eight triples there must be at least one which is true. Forinstance, (b ∧ c ∧ e) would mean that they ate at two differentrestaurants which is false.The only triple which is true is (b ∧ c ∧ ¬a) which says that they atePho gà at Pho-24.

() Discrete Mathematicsand its Applications Ngày 12 tháng 9 năm 2011 15 / 16

Page 81: =1=Discrete Mathematics and its Applicationsfaculty.washington.edu/moishe/hanoi-2011/Discrete... · 2011-09-12 · Discrete Mathematics and its Applications Ngày 12 tháng 9 năm

To solve this puzzle we introduce five propositions:

a: they ate Pho bò táib: they ate at Pho-24

c: they ate Pho gàd: they ate at Quàn an Ngone: they ate at Cha Cá

The compound proposition describing their three claims is:(a ∨ b) ∧ (c ∨ d) ∧ (¬a ∨ e) = true which when expanded yields:(a ∧ c ∧ ¬a) ∨ (a ∧ c ∧ e) ∨ (a ∧ d ∧ ¬a) ∨ (a ∧ d ∧ e) ∨ (b ∧ c ∧ ¬a) ∨(b ∧ c ∧ e) ∨ (b ∧ d ∧ ¬a) ∨ (b ∧ d ∧ e) = true.

Among the eight triples there must be at least one which is true. Forinstance, (b ∧ c ∧ e) would mean that they ate at two differentrestaurants which is false.The only triple which is true is (b ∧ c ∧ ¬a) which says that they atePho gà at Pho-24.

() Discrete Mathematicsand its Applications Ngày 12 tháng 9 năm 2011 15 / 16

Page 82: =1=Discrete Mathematics and its Applicationsfaculty.washington.edu/moishe/hanoi-2011/Discrete... · 2011-09-12 · Discrete Mathematics and its Applications Ngày 12 tháng 9 năm

To solve this puzzle we introduce five propositions:

a: they ate Pho bò táib: they ate at Pho-24c: they ate Pho gà

d: they ate at Quàn an Ngone: they ate at Cha Cá

The compound proposition describing their three claims is:(a ∨ b) ∧ (c ∨ d) ∧ (¬a ∨ e) = true which when expanded yields:(a ∧ c ∧ ¬a) ∨ (a ∧ c ∧ e) ∨ (a ∧ d ∧ ¬a) ∨ (a ∧ d ∧ e) ∨ (b ∧ c ∧ ¬a) ∨(b ∧ c ∧ e) ∨ (b ∧ d ∧ ¬a) ∨ (b ∧ d ∧ e) = true.

Among the eight triples there must be at least one which is true. Forinstance, (b ∧ c ∧ e) would mean that they ate at two differentrestaurants which is false.The only triple which is true is (b ∧ c ∧ ¬a) which says that they atePho gà at Pho-24.

() Discrete Mathematicsand its Applications Ngày 12 tháng 9 năm 2011 15 / 16

Page 83: =1=Discrete Mathematics and its Applicationsfaculty.washington.edu/moishe/hanoi-2011/Discrete... · 2011-09-12 · Discrete Mathematics and its Applications Ngày 12 tháng 9 năm

To solve this puzzle we introduce five propositions:

a: they ate Pho bò táib: they ate at Pho-24c: they ate Pho gàd: they ate at Quàn an Ngon

e: they ate at Cha Cá

The compound proposition describing their three claims is:(a ∨ b) ∧ (c ∨ d) ∧ (¬a ∨ e) = true which when expanded yields:(a ∧ c ∧ ¬a) ∨ (a ∧ c ∧ e) ∨ (a ∧ d ∧ ¬a) ∨ (a ∧ d ∧ e) ∨ (b ∧ c ∧ ¬a) ∨(b ∧ c ∧ e) ∨ (b ∧ d ∧ ¬a) ∨ (b ∧ d ∧ e) = true.

Among the eight triples there must be at least one which is true. Forinstance, (b ∧ c ∧ e) would mean that they ate at two differentrestaurants which is false.The only triple which is true is (b ∧ c ∧ ¬a) which says that they atePho gà at Pho-24.

() Discrete Mathematicsand its Applications Ngày 12 tháng 9 năm 2011 15 / 16

Page 84: =1=Discrete Mathematics and its Applicationsfaculty.washington.edu/moishe/hanoi-2011/Discrete... · 2011-09-12 · Discrete Mathematics and its Applications Ngày 12 tháng 9 năm

To solve this puzzle we introduce five propositions:

a: they ate Pho bò táib: they ate at Pho-24c: they ate Pho gàd: they ate at Quàn an Ngone: they ate at Cha Cá

The compound proposition describing their three claims is:(a ∨ b) ∧ (c ∨ d) ∧ (¬a ∨ e) = true which when expanded yields:(a ∧ c ∧ ¬a) ∨ (a ∧ c ∧ e) ∨ (a ∧ d ∧ ¬a) ∨ (a ∧ d ∧ e) ∨ (b ∧ c ∧ ¬a) ∨(b ∧ c ∧ e) ∨ (b ∧ d ∧ ¬a) ∨ (b ∧ d ∧ e) = true.

Among the eight triples there must be at least one which is true. Forinstance, (b ∧ c ∧ e) would mean that they ate at two differentrestaurants which is false.The only triple which is true is (b ∧ c ∧ ¬a) which says that they atePho gà at Pho-24.

() Discrete Mathematicsand its Applications Ngày 12 tháng 9 năm 2011 15 / 16

Page 85: =1=Discrete Mathematics and its Applicationsfaculty.washington.edu/moishe/hanoi-2011/Discrete... · 2011-09-12 · Discrete Mathematics and its Applications Ngày 12 tháng 9 năm

To solve this puzzle we introduce five propositions:

a: they ate Pho bò táib: they ate at Pho-24c: they ate Pho gàd: they ate at Quàn an Ngone: they ate at Cha Cá

The compound proposition describing their three claims is:(a ∨ b) ∧ (c ∨ d) ∧ (¬a ∨ e) = true which when expanded yields:(a ∧ c ∧ ¬a) ∨ (a ∧ c ∧ e) ∨ (a ∧ d ∧ ¬a) ∨ (a ∧ d ∧ e) ∨ (b ∧ c ∧ ¬a) ∨(b ∧ c ∧ e) ∨ (b ∧ d ∧ ¬a) ∨ (b ∧ d ∧ e) = true.

Among the eight triples there must be at least one which is true. Forinstance, (b ∧ c ∧ e) would mean that they ate at two differentrestaurants which is false.The only triple which is true is (b ∧ c ∧ ¬a) which says that they atePho gà at Pho-24.

() Discrete Mathematicsand its Applications Ngày 12 tháng 9 năm 2011 15 / 16

Page 86: =1=Discrete Mathematics and its Applicationsfaculty.washington.edu/moishe/hanoi-2011/Discrete... · 2011-09-12 · Discrete Mathematics and its Applications Ngày 12 tháng 9 năm

To solve this puzzle we introduce five propositions:

a: they ate Pho bò táib: they ate at Pho-24c: they ate Pho gàd: they ate at Quàn an Ngone: they ate at Cha Cá

The compound proposition describing their three claims is:(a ∨ b) ∧ (c ∨ d) ∧ (¬a ∨ e) = true which when expanded yields:(a ∧ c ∧ ¬a) ∨ (a ∧ c ∧ e) ∨ (a ∧ d ∧ ¬a) ∨ (a ∧ d ∧ e) ∨ (b ∧ c ∧ ¬a) ∨(b ∧ c ∧ e) ∨ (b ∧ d ∧ ¬a) ∨ (b ∧ d ∧ e) = true.

Among the eight triples there must be at least one which is true. Forinstance, (b ∧ c ∧ e) would mean that they ate at two differentrestaurants which is false.The only triple which is true is (b ∧ c ∧ ¬a) which says that they atePho gà at Pho-24.

() Discrete Mathematicsand its Applications Ngày 12 tháng 9 năm 2011 15 / 16

Page 87: =1=Discrete Mathematics and its Applicationsfaculty.washington.edu/moishe/hanoi-2011/Discrete... · 2011-09-12 · Discrete Mathematics and its Applications Ngày 12 tháng 9 năm

To solve this puzzle we introduce five propositions:

a: they ate Pho bò táib: they ate at Pho-24c: they ate Pho gàd: they ate at Quàn an Ngone: they ate at Cha Cá

The compound proposition describing their three claims is:(a ∨ b) ∧ (c ∨ d) ∧ (¬a ∨ e) = true which when expanded yields:(a ∧ c ∧ ¬a) ∨ (a ∧ c ∧ e) ∨ (a ∧ d ∧ ¬a) ∨ (a ∧ d ∧ e) ∨ (b ∧ c ∧ ¬a) ∨(b ∧ c ∧ e) ∨ (b ∧ d ∧ ¬a) ∨ (b ∧ d ∧ e) = true.Among the eight triples there must be at least one which is true. Forinstance, (b ∧ c ∧ e) would mean that they ate at two differentrestaurants which is false.

The only triple which is true is (b ∧ c ∧ ¬a) which says that they atePho gà at Pho-24.

() Discrete Mathematicsand its Applications Ngày 12 tháng 9 năm 2011 15 / 16

Page 88: =1=Discrete Mathematics and its Applicationsfaculty.washington.edu/moishe/hanoi-2011/Discrete... · 2011-09-12 · Discrete Mathematics and its Applications Ngày 12 tháng 9 năm

To solve this puzzle we introduce five propositions:

a: they ate Pho bò táib: they ate at Pho-24c: they ate Pho gàd: they ate at Quàn an Ngone: they ate at Cha Cá

The compound proposition describing their three claims is:(a ∨ b) ∧ (c ∨ d) ∧ (¬a ∨ e) = true which when expanded yields:(a ∧ c ∧ ¬a) ∨ (a ∧ c ∧ e) ∨ (a ∧ d ∧ ¬a) ∨ (a ∧ d ∧ e) ∨ (b ∧ c ∧ ¬a) ∨(b ∧ c ∧ e) ∨ (b ∧ d ∧ ¬a) ∨ (b ∧ d ∧ e) = true.Among the eight triples there must be at least one which is true. Forinstance, (b ∧ c ∧ e) would mean that they ate at two differentrestaurants which is false.The only triple which is true is (b ∧ c ∧ ¬a) which says that they atePho gà at Pho-24.

() Discrete Mathematicsand its Applications Ngày 12 tháng 9 năm 2011 15 / 16

Page 89: =1=Discrete Mathematics and its Applicationsfaculty.washington.edu/moishe/hanoi-2011/Discrete... · 2011-09-12 · Discrete Mathematics and its Applications Ngày 12 tháng 9 năm

A classic logic puzzle

A logician is lost in a jungle in Africa. This jungle has two tribes ofcannibals. One tribe always answer every question truthfully while theother tribe always lies.

The logician meets a cannibal in the jungle. The cannibal grants ourlogician his final wish: to ask him one question. If as a result of theanswer the logician can determine to which tribe the cannibal belongshis life will be spared.

Design a question that will guarantee to save the logician’s life.

() Discrete Mathematicsand its Applications Ngày 12 tháng 9 năm 2011 16 / 16

Page 90: =1=Discrete Mathematics and its Applicationsfaculty.washington.edu/moishe/hanoi-2011/Discrete... · 2011-09-12 · Discrete Mathematics and its Applications Ngày 12 tháng 9 năm

A classic logic puzzle

A logician is lost in a jungle in Africa. This jungle has two tribes ofcannibals. One tribe always answer every question truthfully while theother tribe always lies.

The logician meets a cannibal in the jungle. The cannibal grants ourlogician his final wish: to ask him one question. If as a result of theanswer the logician can determine to which tribe the cannibal belongshis life will be spared.

Design a question that will guarantee to save the logician’s life.

() Discrete Mathematicsand its Applications Ngày 12 tháng 9 năm 2011 16 / 16

Page 91: =1=Discrete Mathematics and its Applicationsfaculty.washington.edu/moishe/hanoi-2011/Discrete... · 2011-09-12 · Discrete Mathematics and its Applications Ngày 12 tháng 9 năm

A classic logic puzzle

A logician is lost in a jungle in Africa. This jungle has two tribes ofcannibals. One tribe always answer every question truthfully while theother tribe always lies.

The logician meets a cannibal in the jungle. The cannibal grants ourlogician his final wish: to ask him one question. If as a result of theanswer the logician can determine to which tribe the cannibal belongshis life will be spared.

Design a question that will guarantee to save the logician’s life.

() Discrete Mathematicsand its Applications Ngày 12 tháng 9 năm 2011 16 / 16


Recommended