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

Slides:



Advertisements
Similar presentations
CSE 20 – Discrete Mathematics Dr. Cynthia Bailey Lee Dr. Shachar Lovett Peer Instruction in Discrete Mathematics by Cynthia Leeis licensed under a Creative.
Advertisements

Introduction to Proofs
CSE 20 – Discrete Mathematics Dr. Cynthia Bailey Lee Dr. Shachar Lovett Peer Instruction in Discrete Mathematics by Cynthia Leeis licensed under a Creative.
CSE 20 – Discrete Mathematics Dr. Cynthia Bailey Lee Dr. Shachar Lovett Peer Instruction in Discrete Mathematics by Cynthia Leeis licensed under a Creative.
CSE 20 DISCRETE MATH Prof. Shachar Lovett Clicker frequency: CA.
CSE 20 DISCRETE MATH Prof. Shachar Lovett Clicker frequency: CA.
Prof. Shachar Lovett Clicker frequency: CA CSE 20 Discrete math Prof. Shachar Lovett
CSE 20 DISCRETE MATH Prof. Shachar Lovett Clicker frequency: CA.
Logic: Connectives AND OR NOT P Q (P ^ Q) T F P Q (P v Q) T F P ~P T F
Introduction to Proofs ch. 1.6, pg. 87,93 Muhammad Arief download dari
Discrete Mathematics and Its Applications
Introduction to Proofs
CSE 20 – Discrete Mathematics Dr. Cynthia Bailey Lee Dr. Shachar Lovett Peer Instruction in Discrete Mathematics by Cynthia Leeis licensed under a Creative.
MATH 224 – Discrete Mathematics
CSE 20: Discrete Mathematics for Computer Science Prof. Shachar Lovett.
CSE 311: Foundations of Computing Fall 2013 Lecture 8: More Proofs.
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.
1 10/13/2015 MATH 224 – Discrete Mathematics Why Study Discrete Math  Determination of the efficiency of algorithms, e.g., insertion sort versus selection.
CSE 20: Discrete Mathematics for Computer Science Prof. Shachar Lovett.
CSE 311 Foundations of Computing I Lecture 8 Proofs and Set Theory Spring
CSE 20: Discrete Mathematics for Computer Science Prof. Shachar Lovett.
CSE 20: Discrete Mathematics for Computer Science Prof. Shachar Lovett.
CSE 20 – Discrete Mathematics Dr. Cynthia Bailey Lee Dr. Shachar Lovett Peer Instruction in Discrete Mathematics by Cynthia Leeis licensed under a Creative.
CSE 20 – Discrete Mathematics Dr. Cynthia Bailey Lee Dr. Shachar Lovett Peer Instruction in Discrete Mathematics by Cynthia Leeis licensed under a Creative.
MATH 224 – Discrete Mathematics
CSE 20: Discrete Mathematics for Computer Science Prof. Shachar Lovett.
CSE 20: Discrete Mathematics for Computer Science Prof. Shachar Lovett.
Week 4 - Monday.  What did we talk about last time?  Divisibility  Quotient-remainder theorem  Proof by cases.
Chapter 1: The Foundations: Logic and Proofs
Methods of Proof for Boolean Logic Chapter 5 Language, Proof and Logic.
CS104:Discrete Structures Chapter 2: Proof Techniques.
CSE 311: Foundations of Computing Fall 2013 Lecture 8: Proofs and Set theory.
CSE 20: Discrete Mathematics for Computer Science Prof. Shachar Lovett.
Section 1.7. Definitions A theorem is a statement that can be shown to be true using: definitions other theorems axioms (statements which are given as.
CSE 311 Foundations of Computing I Lecture 8 Proofs Autumn 2011 CSE 3111.
CSE 311 Foundations of Computing I Lecture 8 Proofs Autumn 2012 CSE
Section 1.7. Section Summary Mathematical Proofs Forms of Theorems Direct Proofs Indirect Proofs Proof of the Contrapositive Proof by Contradiction.
Foundations of Computing I CSE 311 Fall Announcements Homework #2 due today – Solutions available (paper format) in front – HW #3 will be posted.
CSE 20: Discrete Mathematics for Computer Science Prof. Shachar Lovett.
Proof And Strategies Chapter 2. Lecturer: Amani Mahajoub Omer Department of Computer Science and Software Engineering Discrete Structures Definition Discrete.
Proof Techniques CS160/CS122 Rosen: 1.5, 1.6, 1.7.
CSE 20: Discrete Mathematics for Computer Science Prof. Shachar Lovett.
The Foundations: Logic and Proofs
CSE 311 Foundations of Computing I
Argument An argument is a sequence of statements.
CISC 2315 Discrete Structures
Niu Kun Discrete Mathematics Chapter 1 The Foundations: Logic and Proof, Sets, and Functions Niu Kun 离散数学.
CSE 20: Discrete Mathematics for Computer Science Prof. Shachar Lovett
CSE 20: Discrete Mathematics for Computer Science Prof. Shachar Lovett
Chapter 1: The Foundations: Logic and Proofs
Liar liar.
MATH 15A – Discrete Mathematics
CSE 20: Discrete Mathematics for Computer Science Prof. Shachar Lovett
CSE 20: Discrete Mathematics for Computer Science Prof. Shachar Lovett
The Foundations: Logic and Proofs
CSE 20: Discrete Mathematics for Computer Science Prof. Shachar Lovett
CSE 311 Foundations of Computing I
CSE 20: Discrete Mathematics for Computer Science Prof. Shachar Lovett
CSE 311: Foundations of Computing
CSE 20: Discrete Mathematics for Computer Science Prof. Shachar Lovett
CS 220: Discrete Structures and their Applications
CS 220: Discrete Structures and their Applications
Propositional Logic.
Midterm Discussion.
CSE 20: Discrete Mathematics for Computer Science Prof. Shachar Lovett
This Lecture Substitution model
Foundations of Discrete Mathematics
Discrete Structures Prepositional Logic 2
Logical and Rule-Based Reasoning Part I
Truth tables.
Presentation transcript:

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

Today’s Topics: Knights and Knaves, and Proof by Contradiction Our challenge problem Midterm 1

1. Knights and Knaves

Remember this movie clip? https://www.youtube.com/watch?v=2dgmgub8mHw

Knights and Knaves 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

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

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

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

You meet 3 people: A: “At least one of us is a knave 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: 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.)

2. Proof by Contradiction

Proof by Contradiction Steps What 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.

You meet 3 people: A: “At least one of us is a knave 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.

A: “At least one of us is a knave. ” B: “At most two of us are knaves 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!

A: “At least one of us is a knave. ” B: “At most two of us are knaves 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 the theorem is true. QED.

You meet 3 people: A: “At least one of us is a knave 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.

A: “At least one of us is a knave. ” B: “At most two of us are knaves 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!

A: “At least one of us is a knave. ” B: “At most two of us are knaves 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 the theorem is true. QED.

A: “At least one of us is a knave. ” B: “At most two of us are knaves 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. But all three are knaves and zero are knaves is a contradiction. So B must be a knight, but we assumed B was a knave, a contradiction. So the assumption is false and the theorem is true. QED. We didn’t need this step because we had already reached a contradiction.

You meet 3 people: A: “At least one of us is a knave 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.

A: “At least one of us is a knave. ” B: “At most two of us are knaves 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!

A: “At least one of us is a knave. ” B: “At most two of us are knaves 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.

Challenge problem

Challenge problem Prove that there exist two irrational numbers x,y such that xy is rational We will prove this, using only the fact that 2 is irrational We will see two different proofs

Proof 1- by contradiction Assume towards contradiction that if x,y are irrational then 𝑥 𝑦 is irrational We know that 2 is irrational a= 2 2 is also irrational b= 𝑎 2 is also irrational But 𝑏= 2 2 2 = 2 2 ⋅ 2 = 2 2 =2 Contradiction!

Proof 2 – direct 𝑥=𝑦= 2 a= 2 2 b= 𝑎 2 =2 Either 𝑥=𝑦= 2 a= 2 2 b= 𝑎 2 =2 Either 𝑥,𝑦 are irrational but a= 𝑥 𝑦 is rational Or 𝑥,𝑎 are irrational but b= 𝑎 𝑦 is rational (but we don’t know which one holds!)

Midterm 1 (10/24)

Material Everything we learned up to TODAY: Boolean formulas: connectives, truth tables, converting to and/from between them and to/from English, CNF/DNFs, etc Predicates and predicate logic Equivalence rules, inference rules Proofs: direct, contrapositive, by cases, by contradication. All the proofs we saw in class + book + HW.

Cheat sheet I allow you to bring a cheat sheet Rules: 1-sided letter-size page Either hand-written or printed is fine You have to create it yourself! You will need to submit the cheat sheet with your exam I will provide the tables of equivalence rules (table 1.9.1) and inference rules (table 1.10.1) from the book

How to prepare Go over all the material we studied in class + book Make sure that you know how to solve all the problems in the book Make sure that you understand all the HW problems, where your mistakes were, and the correct solution Make sure that you understand how to properly write proofs – identify proof strategy, assumptions, WTS, explain every step of your logic. We will have a special discussion session before the midterm, details to be announced