Download presentation
Presentation is loading. Please wait.
Published byDortha Daisy Norton Modified over 9 years ago
1
CSE 20 – Discrete Mathematics Dr. Cynthia Bailey Lee Dr. Shachar Lovett Peer Instruction in Discrete Mathematics by Cynthia Leeis licensed under a Creative Commons Attribution- NonCommercial-ShareAlike 4.0 International License. Based on a work at http://peerinstruction4cs.org. Permissions beyond the scope of this license may be available at http://peerinstruction4cs.org.Cynthia LeeCreative Commons Attribution- NonCommercial-ShareAlike 4.0 International Licensehttp://peerinstruction4cs.org
2
Today’s Topics: 1. Step-by-step equivalence proofs 2. Equivalence of logical operators 2
3
1. Step-by-Step Equivalence Proofs 3
4
Two ways to show two propositions are equivalent 1. Using a truth table Make a truth table with a column for each Equivalent iff the T/F values in each row are identical between the two columns 2. Using known logical equivalences Step-by-step, proof-style approach Equivalent iff it is possible to evolve one to the other using only the known logical equivalence properties 4
5
Logical Equivalences 1. (p ∧ q ∧ r) ∨ (p ∧ ¬q ∧ ¬r) ∨ (¬p ∧ q ∧ r) ∨ (¬p ∧ ¬q ∧ ¬r) ≡(p ∧ (q ∧ r)) ∨ (p ∧ (¬q ∧ ¬r)) ∨ (¬p ∧ (q ∧ r)) ∨ (¬p ∧ (¬q ∧ ¬r)) 2. ≡ (p ∧ ((q ∧ r) ∨ (¬q ∧ ¬r))) ∨ (¬p ∧ ((q ∧ r) ∨ (¬q ∧ ¬r))) a) Substitute s = (q ∧ r) ∨ (¬q ∧ ¬r) gives (p ∧ s) ∨ (¬p ∧ s) b) ≡ (s ∧ p) ∨ (s ∧ ¬p) c) ≡ s ∧ (p ∨ ¬p) d) ≡ s ∧ t e) ≡ s, substitute back for s gives: 3. ≡ (q ∧ r) ∨ (¬q ∧ ¬r) Which law is NOT used? A.Commutative B.Associative C.Distributive D.Identity E.DeMorgan’s 5
6
3. Equivalence of Logical Operators Do we really need IMPLIES and XOR? 6
7
Are all the logical connectives really necessary? You already know that IMPLIES is not necessary p → q ≡ ¬p ∨ q What about IFF? A. Replace with ¬(¬p ∨ ¬q) B. Replace with (¬p ∧ ¬q) ∨ (p ∧ q) C. Replace with ¬(p ∧ q) ∧ (p ∨ q) D. Replace with something else E. XOR is necessary 7
8
Are all the logical connectives really necessary? You already know that IMPLIES is not necessary p → q ≡ ¬p ∨ q What about XOR? A. Replace with ¬(¬p ∨ ¬q) B. Replace with (¬p ∧ ¬q) ∨ (p ∧ q) C. Replace with ¬(p ∧ q) ∧ (p ∨ q) D. Replace with something else E. XOR is necessary 8
9
Are all the logical connectives really necessary? You already know that IMPLIES is not necessary p → q ≡ ¬p ∨ q What about AND? A. Replace with ¬(¬p ∨ ¬q) B. Replace with (¬p ∧ ¬q) ∨ (p ∧ q) C. Replace with ¬(p ∧ q) ∧ (p ∨ q) D. Replace with something else E. AND is necessary 9
10
Are all the logical connectives really necessary? Not necessary: IF IFF XOR AND We can replicate all these using just two: OR NOT Can we get it down to just one?? A.YES, just OR B.YES, just NOT C.NO, there must be at least 2 connectives D.Other 10
11
It turns out, yes, you can manage with just one! But it is one we haven’t learned yet: NAND (NOT AND) Another option is NOR (NOT OR) Their truth tables look like this: Ex: p OR q ≡ (p NAND p) NAND (q NAND q) 11 pqP NAND q TTF TFT FTT FFT pqP NOR q TTF TFF FTF FFT
12
Using NAND to simulate the other connectives 12 pqP NAND q TTF TFT FTT FFT “NOT p” is equivalent to A. p NAND p B. (p NAND p) NAND p C. p NAND (p NAND p) D. NAND p E. None/more/other
13
Using NAND to simulate the other connectives 13 pqP NAND q TTF TFT FTT FFT “p AND q” is equivalent to A. p NAND q B. (p NAND p) NAND (q NAND q) C. (p NAND q) NAND (p NAND q) D. None/more/other
14
Using NAND to simulate the other connectives 14 pqP NAND q TTF TFT FTT FFT “p OR q” is equivalent to A. p NAND q B. (p NAND p) NAND (q NAND q) C. (p NAND q) NAND (p NAND q) D. None/more/other
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.