1 / 33

CSCI2110 Tutorial 9: Propositional Logic

CSCI2110 Tutorial 9: Propositional Logic. Chow Chi Wang ( cwchow ‘at’ cse.cuhk.edu.hk). Propositional Logic. I am lying right now…. Is he telling the truth or lying?. Propositional Statement. A Statement is a sentence that is either True or False .

crwys
Download Presentation

CSCI2110 Tutorial 9: Propositional Logic

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. CSCI2110 Tutorial 9:Propositional Logic Chow Chi Wang (cwchow ‘at’ cse.cuhk.edu.hk)

  2. Propositional Logic I am lying right now… Is he telling the truth or lying?

  3. Propositional Statement • A Statement is a sentence that is either True or False. • Which of these are propositional statements? • The sun is shining. • 3 + 4 = 7. • It rained this morning. • . • for . • Is it raining? • Come to tutorial! • 2012 is a prime number. • Hello world! • Discrete Maths is very interesting.

  4. Basic Logic Operators • We can construct more complicated statements from these basic operators. (e.g. ) , ~(NOT) – Truth Table ∧ (AND) – Truth Table ∨ (OR) – Truth Table

  5. XOR (Exclusive-OR) • When OR is used in its exclusive sense, “p xor q” means “p or q but not both”. • How to express XOR in terms of AND, OR and NOT?  (XOR) – Truth Table

  6. Writing Logical Formula for a Truth Table • Idea 1: Look at the true rows and take the OR. • For each true row: • Construct a clause that is an AND of the true variables. • Take the OR of all the clauses obtained from the for loop.

  7. Writing Logical Formula for a Truth Table • Idea 2: Look at the false rows and take the AND. • For each false row: • Construct a clause that is an AND of the true variables. • Take the AND of all the negated clauses obtained from the for loop. ~

  8. Logical Equivalence • Two statements are logically equivalent if they have the same truth table. • e.g.

  9. Tautology, Contradiction • A tautology is a statement that is always true. • , • A contradiction is a statement that is always false. • ,

  10. Summary of Basic Logical Rules = tautology, = contradiction

  11. Simplifying Statements (Distribution law) (Idempotent law) (Identity law) ~ (De Morgan’s law) (Distributive law) (Idempotent law) (Identity law)

  12. Conditional Statement If P then Q P implies Q p is called the hypothesis; q is called the conclusion – Truth Table

  13. Conditional Statement • is equivalent to . • The contrapositive of “”is “”. • (Statement) Every CUHK student has CULINK. • (Contrapositive) If someone doesn’t have CULINK, then (s)he is not a CUHK student. Important fact A conditional statement is logically equivalent to its contrapositive.

  14. Argument • An argument is a sequence of statements. • All statements but the final one are called assumptions or hypothesis. • The final statement is called the conclusion. • An argument is valid if whenever all the assumptions are true, then the conclusion is true. If today is Sunday, then it is holiday. Today is Sunday.  Today is holiday.

  15. Valid Argument?  Invalid argument!

  16. Valid Argument?  Valid argument!

  17. Knights and Knaves

  18. Knights and Knaves Suppose you are visiting an island containing two types of people – knights and knaves. Two natives and address you as follow: : Both of us are knights. : is a knave. Knights always tell the truth. Knaves always lie. What are and ?

  19. Knights and Knaves : Both of us are knights. : is a knave. If is a knave • is a knight • Both of them are knights • In particular, is a knight Contradiction! Therefore must be a knight • is a knave Knights always tell the truth. Knaves always lie.

  20. Knights and Knaves Another two natives and approach you but only speaks. : Both of us are knaves. Knights always tell the truth. Knaves always lie. What are and ?

  21. Knights and Knaves : Both of us are knaves. If is a knight • Both of them are knaves • In particular, is a knave Contradiction! Therefore must be a knave • One of them is a knight • is a knight Knights always tell the truth. Knaves always lie.

  22. Knights and Knaves You then encounter natives and . : is a knave. : is a knave. Knights always tell the truth. Knaves always lie. How many knaves are there?

  23. Knights and Knaves : is a knave. : is a knave. If is a knight • is a knave • is a knight • There is a knight and a knave Similarly, if is a knight • is a knave • is a knight • There is a knight and a knave Knights always tell the truth. Knaves always lie.

  24. Knights and Knaves Finally, you meet a group of six natives, and , who speak to you as follow: : None of us is a knight. : At least three of us are knights. : At most three of us are knights. : Exactly five of us are knights. : Exactly two of us are knights. : Exactly one of us is a knight. Knights always tell the truth. Knaves always lie. Which are knights and which are knaves?

  25. Knights and Knaves Suppose is a knight • None of them is a knight • is a knave Contradiction! So can only be a knave. : None of us is a knight. : At least three of us are knights. : At most three of us are knights. : Exactly five of us are knights. : Exactly two of us are knights. : Exactly one of us is a knight. Knights always tell the truth. Knaves always lie.

  26. Knights and Knaves Suppose is a knight • Exactly five of them are knights • are knights (because at this stage we already know is a knave) • In particular, is a knight • Exactly one of them is a knight Contradiction! So can only be a knave. : None of us is a knight. : At least three of us are knights. : At most three of us are knights. : Exactly five of us are knights. : Exactly two of us are knights. : Exactly one of us is a knight. Knights always tell the truth. Knaves always lie. • What we know at this stage: • is a knave

  27. Knights and Knaves Suppose is a knight • At least three of them can be knights • At least three people among are knights • Either or must be a knight (by pigeon-hole principle) • Exactly one(or two) of them is a knight Contradiction! So can only be a knave. : None of us is a knight. : At least three of us are knights. : At most three of us are knights. : Exactly five of us are knights. : Exactly two of us are knights. : Exactly one of us is a knight. Knights always tell the truth. Knaves always lie. • What we know at this stage: • is a knave • is a knave

  28. Knights and Knaves At this stage we already identify three people as knaves • There can be at most three of them are knights • is a knight : None of us is a knight. : At least three of us are knights. : At most three of us are knights. : Exactly five of us are knights. : Exactly two of us are knights. : Exactly one of us is a knight. Knights always tell the truth. Knaves always lie. • What we know at this stage: • is a knave • is a knave • is a knave

  29. Knights and Knaves Suppose is a knight • Exactly one of them is a knight Contradiction! (because both are knights in this case) Therefore must be a knave. : None of us is a knight. : At least three of us are knights. : At most three of us are knights. : Exactly five of us are knights. : Exactly two of us are knights. : Exactly one of us is a knight. Knights always tell the truth. Knaves always lie. • What we know at this stage: • is a knave • is a knave • is a knight • is a knave

  30. Knights and Knaves Suppose is a knave • is the only knight • There is exactly one knight • is a knight Contradiction! Therefore must be a knight. : None of us is a knight. : At least three of us are knights. : At most three of us are knights. : Exactly five of us are knights. : Exactly two of us are knights. : Exactly one of us is a knight. Knights always tell the truth. Knaves always lie. • What we know at this stage: • is a knave • is a knave • is a knight • is a knave • is a knave

  31. Knights and Knaves Therefore: • is a knave • is a knave • is a knight • is a knave • is a knight • is a knave : None of us is a knight. : At least three of us are knights. : At most three of us are knights. : Exactly five of us are knights. : Exactly two of us are knights. : Exactly one of us is a knight. Knights always tell the truth. Knaves always lie. • What we know at this stage: • is a knave • is a knave • is a knight • is a knave • is a knave

  32. Summary • How to write logical formula from a truth table? • How to check whether two logical formulas are equivalent? • How to simplify logical formula using rules including (but not limited to) De Morgan’s law? • What are conditional statements and contrapositive? • How to check whether an argument is valid or not?

  33. Thank You!

More Related