CSE 20 Discrete Mathematics for Computer Science Prof

  • Slides: 20
Download presentation
CSE 20: Discrete Mathematics for Computer Science Prof. Shachar Lovett

CSE 20: Discrete Mathematics for Computer Science Prof. Shachar Lovett

2 Today’s Topics: 1. Knights and Knaves, and Proof by Contradiction

2 Today’s Topics: 1. Knights and Knaves, and Proof by Contradiction

3 1. Knights and Knaves

3 1. Knights and Knaves

4 Knights and Knaves scenarios are somewhat fanciful ways of formulating logic problems Knight:

4 Knights and Knaves scenarios are somewhat fanciful ways of formulating logic problems Knight: everything a knight says is true Knave: everything a knave says is false 2+2=4 2+2=3

5 You approach two people, you know the on the left is a knave,

5 You approach two people, you know the on the left is a knave, but you don’t know whether the on the right is a knave or a knight. Left: “Everything she says is true. ” Right: “Everything I say is true. ” What A. B. C. D. is she (the on the right)? Knight Knave Could be either/not enough information Cannot be either/situation is contradictory

6 You approach one person, but you don’t know whether he is a knave

6 You approach one person, but you don’t know whether he is a knave or a knight. Mystery What A. B. C. D. person: “Everything I say is true. ” is he? Knight Knave Could be either/not enough information Cannot be either/situation is contradictory

7 You approach one person, but you don’t know whether she is a knave

7 You approach one person, but you don’t know whether she is a knave or a knight. Mystery What A. B. C. D. person: “Everything I say is false. ” is she? Knight Knave Could be either/not enough information Cannot be either/situation is contradictory

8 You meet 3 people: A: “At least one of us is a knave.

8 You meet 3 people: A: “At least one of us is a knave. ” B: “At most two of us are knaves. ” [C doesn't say anything] This is a really tricky one, but take a moment to see if you can determine which of the following is a possible solution: A. B. C. A: Knave, B: Knave, C: Knave A: Knight, B: Knight, C: Knight A: Knight, B: Knight, C: Knave (Suggestion: eliminate wrong choices rather than trying to solve the puzzle directly. In your groups: please discuss logic for eliminating choices. )

9 2. Proof by Contradiction

9 2. Proof by Contradiction

10 Proof by Contradiction Steps What A. B. C. D. are they? 1. Assume

10 Proof by Contradiction Steps What A. B. C. D. are they? 1. Assume what you are proving, 2. plug in definitions, 3. do some work, 4. show the opposite of what you are proving (a contradiction). 1. Assume the opposite of what you are proving, 2. plug in definitions, 3. do some work, 4. show the opposite of your assumption (a contradiction). 1. Assume the opposite of what you are proving, 2. plug in definitions, 3. do some work, 4. show the opposite of some fact you already showed (a contradiction). Other/none/more than one.

11 You meet 3 people: A: “At least one of us is a knave.

11 You meet 3 people: A: “At least one of us is a knave. ” B: “At most two of us are knaves. ” [C doesn't say anything] A: Knight, B: Knight, C: Knave Zeroing in on just one of the three parts of the solution, we will prove by contradiction that A is a knight.

12 A: “At least one of us is a knave. ” B: “At most

12 A: “At least one of us is a knave. ” B: “At most two of us are knaves. ” [C doesn't say anything] Thm. A is a knight. Proof (by contradiction): Assume not, that is, assume A is a knave. Try it yourself first!

13 A: “At least one of us is a knave. ” B: “At most

13 A: “At least one of us is a knave. ” B: “At most two of us are knaves. ” [C doesn't say anything] Thm. A is a knight. Proof (by contradiction): Assume not, that is, assume A is a knave. Then what A says is false. Then it is false that at least one is a knave, meaning zero are knaves. So A is not a knave, but we assumed A was a knave, a contradiction. So the assumption is false and theorem is true. QED.

14 You meet 3 people: A: “At least one of us is a knave.

14 You meet 3 people: A: “At least one of us is a knave. ” B: “At most two of us are knaves. ” [C doesn't say anything] A: Knight, B: Knight, C: Knave Zeroing in on the second of the three parts of the solution, we will prove by contradiction that B is a knight.

15 A: “At least one of us is a knave. ” B: “At most

15 A: “At least one of us is a knave. ” B: “At most two of us are knaves. ” [C doesn't say anything] Thm. B is a knight. Proof (by contradiction): Assume not, that is, assume B is a knave. Try it yourself first!

16 A: “At least one of us is a knave. ” B: “At most

16 A: “At least one of us is a knave. ” B: “At most two of us are knaves. ” [C doesn't say anything] Thm. B is a knight. Proof (by contradiction): Assume not, that is, assume B is a knave. Then what B says is false, so it is false that at most two are knaves. So it must be that all three are knaves. Then A is a knave. So what A says is false, and so there are zero knaves. So B must be a knight, but we assumed B was a knave, a contradiction. So the assumption is false and theorem is true. QED.

17 A: “At least one of us is a knave. ” B: “At most

17 A: “At least one of us is a knave. ” B: “At most two of us are knaves. ” [C doesn't say anything] Thm. B is a knight. Proof (by contradiction): Assume not, that is, assume B is a knave. Then what B says is false, so it is false that at most two are knaves. So it must be that all three are knaves. We didn’t need Then A is a knave. this step So what A says is false, and so there are zero knaves. because we But all three are knaves and zero are knaves is a contradiction. had already So B must be a knight, but we assumed B was a knave, a contradiction. reached a contradiction. So the assumption is false and theorem is true. QED.

18 You meet 3 people: A: “At least one of us is a knave.

18 You meet 3 people: A: “At least one of us is a knave. ” B: “At most two of us are knaves. ” [C doesn't say anything] A: Knight, B: Knight, C: Knave Zeroing in on the second of the three parts of the solution, we will prove by contradiction that C is a Knave.

19 A: “At least one of us is a knave. ” B: “At most

19 A: “At least one of us is a knave. ” B: “At most two of us are knaves. ” [C doesn't say anything] Thm. C is a knave. Proof (by contradiction): Assume not, that is, assume C is a knight. Try it yourself first!

20 A: “At least one of us is a knave. ” B: “At most

20 A: “At least one of us is a knave. ” B: “At most two of us are knaves. ” [C doesn't say anything] Thm. C is a knave. Proof (by contradiction): Assume not, that is, assume C is a knight. We already proved that A and B must be knights, hence telling the truth. So, if all three are knights, then A is lying, which is a contradiction. So, C must be a knave.