Download presentation
Presentation is loading. Please wait.
Published byElla Holen Modified over 6 years ago
1
CSE 20: Discrete Mathematics for Computer Science Prof. Shachar Lovett
2
Today’s Topics: Step-by-step equivalence proofs
Equivalence of logical operators
3
1. Step-by-Step Equivalence Proofs
4
Two ways to show two propositions are equivalent
Using a truth table Make a truth table with a column for each variable, formula Equivalent iff the T/F values in each row are identical between the two columns 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
5
Equivalence Rules
6
Inference Rules:
7
Logical Equivalences (p∧q∧r) ∨ (p∧¬q∧¬r) ∨ (¬p∧q∧r) ∨ (¬p∧¬q∧¬r) ≡(p∧(q∧r)) ∨ (p∧(¬q∧¬r)) ∨ (¬p∧(q∧r)) ∨ (¬p∧(¬q∧¬r)) ≡ (p∧ ((q∧r) ∨ (¬q∧¬r))) ∨ (¬p ∧ ((q∧r) ∨ (¬q∧¬r))) Substitute s = (q∧r) ∨ (¬q∧¬r) gives (p∧ s) ∨ (¬p ∧ s) ≡ (s∧p) ∨ (s∧¬p) ≡ s ∧ (p ∨ ¬p) ≡ s ∧ t ≡ s, substitute back for s gives: ≡ (q∧r) ∨ (¬q∧¬r) Which law is NOT used? Commutative Associative Distributive Identity DeMorgan’s
8
Legal steps in proof sequences
Consider the following simplification step (modus ponens) p(pq)q Why is it correct to use it? Because p is necessary for q Because p is sufficient for q Because (p(pq))q is a contradiction Because (p(pq))q is a tautology None/other
9
Legal steps in proof sequences
A simplification step (formula 1)(formula 2) is a correct step, if the formula (formula 1)(formula 2) is a tautology Equivalently, if we assume formula 1 is correct, then we can deduce that formula 2 is correct
10
Applications of proof sequences
Formal verification: a proof that a certain program, or a certain circuit, works correctly We express the statement “the circuit works correctly” as a formal propositional formula, and then prove it Typical formulas have millions of inputs, so cannot hope to prove by truth tables. The only way is to find clever ways of building proof sequences
11
2. Equivalence of Logical Operators
Do we really need IMPLIES and XOR?
12
Are all the logical connectives really necessary?
You already know that IMPLIES is not necessary p → q ≡ ¬p ∨ q What about IFF? Replace with ¬(¬p ∨ ¬q) Replace with (¬p ∧ ¬q) ∨ (p ∧ q) Replace with ¬(p ∧ q) ∧ (p ∨ q) Replace with something else IFF is necessary
13
Are all the logical connectives really necessary?
You already know that IMPLIES is not necessary p → q ≡ ¬p ∨ q What about XOR? Replace with ¬(¬p ∨ ¬q) Replace with (¬p ∧ ¬q) ∨ (p ∧ q) Replace with ¬(p ∧ q) ∧ (p ∨ q) Replace with something else XOR is necessary
14
Are all the logical connectives really necessary?
You already know that IMPLIES is not necessary p → q ≡ ¬p ∨ q What about AND? Replace with ¬(¬p ∨ ¬q) Replace with (¬p ∧ ¬q) ∨ (p ∧ q) Replace with ¬(p ∧ q) ∧ (p ∨ q) Replace with something else AND is necessary
15
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?? YES, just OR YES, just NOT NO, there must be at least 2 connectives Other
16
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) p q P NAND q T F p q P NOR q T F
17
Using NAND to simulate the other connectives
“NOT p” is equivalent to p NAND p (p NAND p) NAND p p NAND (p NAND p) NAND p None/more/other p q P NAND q T F
18
Using NAND to simulate the other connectives
“p AND q” is equivalent to p NAND q (p NAND p) NAND (q NAND q) (p NAND q) NAND (p NAND q) None/more/other p q P NAND q T F
19
Using NAND to simulate the other connectives
“p OR q” is equivalent to p NAND q (p NAND p) NAND (q NAND q) (p NAND q) NAND (p NAND q) None/more/other p q P NAND q T F
20
Can we just use AND, OR? We saw we can use OR,NOT as primitive connectives – they generate all the rest Similarly, we can just use NAND Can we just use AND, OR? Yes No
21
Monotone predicates A predicate is monotone if replacing an input variable from F to T can never change the value of the predicate from T to F Example: AND; OR; At least one out of three But not: NOT; NAND
22
Monotone predicates Theorem: a predicate is monotone if and only if it can be described using just AND,OR connectives We will see the proof in later sessions, after we learn a bit about how to prove theorems Can you prove it yourself now?
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.