Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 Discrete Structures Lecture 15 Solving Word Problems II.

Similar presentations


Presentation on theme: "1 Discrete Structures Lecture 15 Solving Word Problems II."— Presentation transcript:

1 1 Discrete Structures Lecture 15 Solving Word Problems II

2 2 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.

3 3 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

4 4 Does Superman Exist? cont. Assume F0, F1, F2, F3 ¬e  ¬(¬i  ¬m) = < 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 = i V m How will we know we're done? When we get to something true, either an axiom, theorem or problem fact.

5 5 Does Superman Exist? cont. i V m  ¬a V m  ¬a V ¬w  ¬(a  w)

6 6 Does Superman Exist? cont. ¬(a  w)  ¬p

7 7 Three Assertions: (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. Problem 5.1 (a)

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

9 9 Problem 5.1 (a) continued (¬T V N)  (N  M)  T  M (¬T V N)  (N  M)  T = N  (N  M)  T = N  M  T  M

10 10 Two Assertions: (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. Problem 5.1 (d)

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

12 12 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.

13 13 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

14 14 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 = P  true = P  Q We will use this in the next proof.

15 15 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. Problem 5.3 Since the maid said it, we must be careful about how we formulate our variables and expressions.

16 16 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.

17 17 Problem 5.3 continued 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 (MT  BL)  LK  ((LK  BL)  BH)  (BT  ¬BH)  (MT  ¬BT)

18 18 MT  BL = LK  BL  LK  BL  BH)  BH = BH  (BT  ¬BH) = BH  (BH  ¬BT) Problem 5.3 continued (MT  BL)  LK  ((LK  BL)  BH)  (BT  ¬BH)  (MT  ¬BT)  ¬BT

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

20 20 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)

21 21 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. Problem 5.6 (d)

22 22 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.

23 23 Problem 5.6 (d) continued (c  b  ¬b)  (d  ¬c) (c  b  ¬b)  (d  ¬c) = ¬c  (d  ¬c) = ¬c  d Hence, C is a knave and D is a knight.


Download ppt "1 Discrete Structures Lecture 15 Solving Word Problems II."

Similar presentations


Ads by Google