Solving Word Problems II

Slides:



Advertisements
Similar presentations
Week 6 - Wednesday CS322.
Advertisements

AE1APS Algorithmic Problem Solving John Drake. The island of Knights and Knaves is a fictional island to test peoples ability to reason logically. There.
Algebra Problems… Solutions Algebra Problems… Solutions © 2007 Herbert I. Gross By Herbert I. Gross and Richard A. Medeiros next Set 9.
Introduction to Proofs
CSE 20 DISCRETE MATH Prof. Shachar Lovett Clicker frequency: CA.
Possible World Semantics for Modal Logic
1 Discrete Structures Lecture 12 Implication III Read: Ch 4.1.
1 In this lecture  Number Theory ● Rational numbers ● Divisibility  Proofs ● Direct proofs (cont.) ● Common mistakes in proofs ● Disproof by counterexample.
Inference and Reasoning. Basic Idea Given a set of statements, does a new statement logically follow from this. For example If an animal has wings and.
1 Introduction to Abstract Mathematics Valid AND Invalid Arguments 2.3 Instructor: Hayk Melikya
The Island of Knights and Knaves. Knights always tell the truth.
© by Kenneth H. Rosen, Discrete Mathematics & its Applications, Sixth Edition, Mc Graw-Hill, 2007 Chapter 1: (Part 2): The Foundations: Logic and Proofs.
L41 Lecture 2: Predicates and Quantifiers.. L42 Agenda Predicates and Quantifiers –Existential Quantifier  –Universal Quantifier 
Some Puzzles About Truth (and belief, knowledge, opinion, and lying)
The Island of Knights and Knaves. Raymond Smullyan 1978 A little learning is a dangerous thing; Drink deep, or taste not the Pierian spring: There shallow.
From Chapter 4 Formal Specification using Z David Lightfoot
Logic Puzzles Miran Kim Ben Seelbinder Matthew Sgambati.
The Island of Liars and Truth-Tellers
Using Decision Procedures for Program Verification Christopher Lynch Clarkson University.
Discrete Structures Lecture 11 Implication II 1.
EE1J2 – Discrete Maths Lecture 5 Analysis of arguments (continued) More example proofs Formalisation of arguments in natural language Proof by contradiction.
Logical and Rule-Based Reasoning Part I. Logical Models and Reasoning Big Question: Do people think logically?
1 MA 1128: Lecture 09 – 6/08/15 Solving Systems of Linear Equations.
Logical Puzzles Truth and Lies. The Island of Rilas On the island of Rilas there are just two types of people: knights and knaves Knights always tell.
Chapter 1 -- The Foundations: Logic and Proof, Sets and Functions
The Foundations: Logic and Proofs
Methods of Proof & Proof Strategies
Formal Theories SIE 550 Lecture Matt Dube Doctoral Student - Spatial.
Discrete Mathematics and Its Applications
Lecture 5 Knights and Knaves.. Administration Show hand in form. Show plagiarism form. Any problems with coursework? Google knight and knaves and look.
Chapter 1: The Foundations: Logic and Proofs
Copyright © Curt Hill Using Propositional Logic Several applications.
MATH 224 – Discrete Mathematics
Conditional Statements CS 2312, Discrete Structures II Poorvi L. Vora, GW.
Dr. Naveed Riaz Design and Analysis of Algorithms 1 1 Formal Methods in Software Engineering Lecture # 24.
CS 173, Lecture B August 27, 2015 Tandy Warnow. Proofs You want to prove that some statement A is true. You can try to prove it directly, or you can prove.
Chapter 1 Logic Section 1-1 Statements Open your book to page 1 and read the section titled “To the Student” Now turn to page 3 where we will read the.
1 Sections 1.5 & 3.1 Methods of Proof / Proof Strategy.
Chapter 5 Existence and Proof by contradiction
Hilbert’s Progamme Early in C20, the mathematician Hilbert led a programme to formalise maths; to reduce it to a clear set of axioms and show that all.
Copyright © Curt Hill Mathematical Logic An Introduction.
Logical Reasoning:Proof Prove the theorem using the basic axioms of algebra.
Hazırlayan DISCRETE COMPUTATIONAL STRUCTURES Propositional Logic PROF. DR. YUSUF OYSAL.
Chapter 2 Logic 2.1 Statements 2.2 The Negation of a Statement 2.3 The Disjunction and Conjunction of Statements 2.4 The Implication 2.5 More on Implications.
Week 4 - Monday.  What did we talk about last time?  Divisibility  Quotient-remainder theorem  Proof by cases.
Predicate Logic One step stronger than propositional logic Copyright © Curt Hill.
Dr. Naveed Riaz Design and Analysis of Algorithms 1 1 Formal Methods in Software Engineering Lecture # 25.
1.4 Properties of Real Numbers ( )
CS104:Discrete Structures Chapter 2: Proof Techniques.
Section 1.1. Propositions A proposition is a declarative sentence that is either true or false. Examples of propositions: a) The Moon is made of green.
Mathematics for Comter I Lecture 3: Logic (2) Propositional Equivalences Predicates and Quantifiers.
Today’s Topics Argument forms and rules (review)
Foundations of Discrete Mathematics Chapter 1 By Dr. Dalia M. Gil, Ph.D.
CS 173, Lecture B August 27, 2015 Tandy Warnow. Proofs You want to prove that some statement A is true. You can try to prove it directly, or you can prove.
A is a knight:A A eats his hat:H. A is a knight:A A eats his hat:H If I am a knight then I’ll eat my hat: A  H.
CSE 20: Discrete Mathematics for Computer Science Prof. Shachar Lovett
Lecture 1 – Formal Logic.
Liar liar.
Logics for Data and Knowledge Representation
CS201: Data Structures and Discrete Mathematics I
CS201: Data Structures and Discrete Mathematics I
TRUTH TABLES.
Propositional Logic.
Foundations of Discrete Mathematics
Knights and Knaves.
CS201: Data Structures and Discrete Mathematics I
Foundations of Discrete Mathematics
Let Q be the question Let A be “the native is a knight”
Logical and Rule-Based Reasoning Part I
CS201: Data Structures and Discrete Mathematics I
Presentation transcript:

Solving Word Problems II Discrete Structures Lecture 15 Solving Word Problems II 1

Does Superman Exist? If Superman were able and willing to prevent evil, he would do so. If Superman were unable to prevent evil, he would be impotent; if he were unwilling to prevent evil, he would be malevolent. Superman does not prevent evil. If Superman exists, he is neither impotent nor malevolent. Therefore, Superman does not exist. 9

Does Superman Exist? continued a: Superman is able to prevent evil. w: Superman is willing to prevent evil. i: Superman is impotent. m: Superman is malevolent. p: Superman prevents evil. e: Superman exists. F0: a  w  p F1: (¬a  i)  (¬w  m) F2: ¬p F3: e  ¬i  ¬m F0  F1  F2  F3  ¬e 9

Does Superman Exist? cont. How will we know we're done? When we get to something true, either an axiom, theorem or problem fact. Assume F0, F1, F2, F3 ¬e  < Contrapositive of F3 ¬(¬i  ¬m)  ¬e > < The only other place e appears > ¬(¬i  ¬m) = < (3.47a)DeMorgan > < Choice of DeMorgan is obvious to simplify. Further, i and m, the only variable of the formula above, appear only in F1, and as consequents of implications. This simplification makes further steps possible. > ¬¬i V ¬¬m = < (3.12) Double Negation, twice > i V m 3

Does Superman Exist? cont. i V m  < First conjunct of F1 and (4.2) Monotonicity -- i is used in only one formula, and this is the obvious way to eliminated it. > ¬a V m  < Second conjunct of F1 and (4.2) Monotonicity -- m is used in only one formula, and we can eliminate it. > ¬a V ¬w  < (4.47a) DeMorgan yields an expression that is part of the antecedent of F0. > ¬(a  w) 3

Does Superman Exist? cont. ¬(a  w)  < Contrapositive of F0 is ¬p  ¬(a  w), so this is the way to get rid of (a  w) > ¬p < This is F2, so done > 3

Problem 5.1 (a) Three Assertions: Conclusion: (F0:) Either the program does not terminate or n eventually becomes 0. (F1:) If n becomes 0, m will eventually be 0. (F2:) The program terminates. Conclusion: (C) Therefore, m will eventually be 0. 3

Problem 5.1 (a) continued T: The program terminates, N: n becomes 0, (¬T V N)  (N  M)  T  M T: The program terminates, N: n becomes 0, M: m becomes 0. F0: F1: F2: C: (¬T V N) (N  M) T M 6

Problem 5.1 (a) continued (¬T V N)  (N  M)  T  M = < (3.44a) Absorption, p:= T; q:=N p  (¬p V q)  p  q > N  (N  M)  T = < (3.66) p  (p  q)  p  q > N  M  T  < (3.76b) Weakening p  q  p > M 6

Problem 5.1 (d) Two Assertions: Conclusion: (F0) If Joe loves Mary, then either mom is mad or father is sad. (F1) Father is sad. Conclusion: (C) Therefore, if mom is mad then Joe doesn’t love Mary. 3

Problem 5.1(d) continued F0  F1  C J: Joe loves Mary, M: Mom is mad, F: Father is sad. F0: F1: C: (J  M V F) F M  ¬J 6

Problem 5.1 (d) continued (J  M V F)  F  (M  ¬J) At first glance this does not look promising. Recall, to find a counterexample, want something that makes the antecedent true and the consequent false. 6

Problem 5.1 (d) Finding a Counter Example For C: to be false, what values of M and J are needed? C: M  ¬J true  false false Can we find a value for F that makes F0: and F1: true with M and J having the above values? F0: (J  M V F) F1: F (true  true V true) true true 6

Adding Axioms (or theorems) to an expression Suppose you have an expression, P, and a theorem or axiom Q. You can substitute P  Q for P, as follows: P = <(3.39)Identity of , p  true  p> P  true = <Metatheorem (3.7) all theorems are equivalent, Q> P  Q We will use this in the next proof.

Problem 5.3 Prove that if the maid told the truth, the butler lied. The maid said she saw the butler in the living room. The living room adjoins the kitchen. The shot was fired in the kitchen and could be heard in all adjoining rooms. The butler, who had good hearing, said he did not hear the shot. Since the maid said it, we must be careful about how we formulate our variables and expressions. 3

Problem 5.3 continued MT: The maid told the truth, BT: The butler told the truth, BL: The butler was in the living room, LK: The living room adjoins the kitchen, BH: The butler heard the shot. 6

(MT  BL)  LK  ((LK  BL)  BH)  (BT  ¬BH)  (MT  ¬BT) Problem 5.3 continued (MT  BL)  LK  ((LK  BL)  BH)  (BT  ¬BH)  (MT  ¬BT) F0: MT  BL i.e. if the maid told the truth, then the butler was in the living room. F1: LK F2: (LK  BL)  BH i.e. if the kitchen adjoins the living room and the butler is in the living room, then the butler could hear the shot. F3: BT  ¬BH i.e. if the butler told the truth, he did not hear the shot. C: MT  ¬BT 6

Problem 5.3 continued (MT  BL)  LK  ((LK  BL)  BH)  (BT  ¬BH)  (MT  ¬BT)  < F0, MT  BL > BL = <(3.39) Identity of , (3.7), F1, F2> LK  BL  (LK  BL  BH)  <(3.77) Modus Ponens; p,q:=LKBL, BH > BH = <(3.39) Identity of ,(3.7), F3> BH  (BT  ¬BH) = < (3.61) Contrapositive, (3.12) Double neg.> BH  (BH  ¬BT) BL  < (3.77) Modus Ponens, F1, F2; p,q := LK  BL, BH > OR < New hint F2' > BH ------------------------------------------ Another suggestion for this hint: Make a new rule Fi with BL and LK, so BL  LK = < (3.39) p  true  p; F1: LK with p: Bl and true := LK> So, substitute in the BL into F2 and get F2': BL  BH and use this as the hint for the above.  < (3.77) Modus Ponens > ¬BT 6

Knights always tell the truth and knaves always lie. Problem 5.6 This set of questions concern an island of knights and knaves. Knights always tell the truth and knaves always lie. 3

Problem 5.6 continued b: B is a knight. c: C is a knight. d: D is a knight. If B says a statement “X”, this gives rise to the expression: b  X, since if b, then B is a knight and tells the truth, (so X is true) and if ¬b, B is a knave and lies. (so X is false) 6

Problem 5.6 (d) Three inhabitants are standing together in the garden. A non-inhabitant passes by and asks B, “Are you a knight or a knave?” B answers, but so indistinctly that the stranger cannot understand. The stranger then asks C. “What did B say?” C replies, “B said that he is a knave.” At this point, the third man, D, Says, “Don’t believe C; he’s lying!” What are C and D? Hint: Only C’s and D’s statements are relevant to the problem. Also, D’s remark that C is lying is equivalent to saying C is a knave. 3

Problem 5.6 (d) continued The statement “B said that he is a knave” is equivalent to “b is a knight exactly when B is a knave, so we translate is as b  ¬b. Since C said it, we take as true the expression c  b  ¬b. D’s statement “C is lying” is translated as ¬c. Hence, we take as true the expression d  ¬c. We take the conjunction of these two predicates and simplify. 6

Problem 5.6 (d) continued (c  b  ¬b)  (d  ¬c) = < (3.11) ¬p  q  p  ¬q > ¬c  (d  ¬c) = < (3.50) p  (q  p)  p  q > ¬c  d Hence, C is a knave and D is a knight. 6