cs2102: Discrete Mathematics
Class 4: Logical Formulas
David Evans
University of Virginia
Slide 2
Slide 2 text
Plan
Well-Ordering Principle Review
Logical Operations
Logical Formulas
Slide 3
Slide 3 text
Odd Summation. Prove that for all n > 0, the sum of the first n odd numbers is n2.
Slide 4
Slide 4 text
Odd Summation. Prove that for all n > 0, the sum of the first n odd numbers is n2.
(from Class 3)
Slide 5
Slide 5 text
Odd Summation. Prove that for all n > 0, the sum of the first n odd numbers is n2.
Slide 6
Slide 6 text
Odd Summation. Prove that for all n > 0, the sum of the first n odd numbers is n2.
Slide 7
Slide 7 text
Well-Ordering Principle Proofs
Counter-examples
to P
Slide 8
Slide 8 text
Logical Operations
Slide 9
Slide 9 text
One-Input Boolean Operations
P NOT(P)
T F
F T
Are there any others?
Slide 10
Slide 10 text
One-Input Boolean Operations
P IDENT(P)
T T
F F
Are there any others?
Slide 11
Slide 11 text
One-Input Boolean Operations
P NOT(P) IDENT(P) TAUT(P) FALSE(P)
T F T T F
F T F T F
How many do we need to produce all of them?
Slide 12
Slide 12 text
P NOT(P) IDENT(P) TAUT(P) FALSE(P)
T F T T F
F T F T F
Slide 13
Slide 13 text
P NOT(P) IDENT(P) TAUT(P) FALSE(P)
T F T T F
F T F T F
Can we compute anything interesting with one-input Boolean operators?
Slide 14
Slide 14 text
Two-Input Operators
Slide 15
Slide 15 text
Two-Input Operators
P Q OP(P, Q)
T T
T F
F T
F F
Slide 16
Slide 16 text
Two-Input Operators
P Q AND(P, Q) OR(P, Q) P IMPLIES Q P IFF Q XOR(P, Q)
T T T T
T F F T
F T F T
F F F F
Slide 17
Slide 17 text
Two-Input Operators
P Q AND(P, Q) OR(P, Q) P IMPLIES Q P IFF Q XOR(P, Q)
T T T T T T F
T F F T F F T
F T F T T F T
F F F F T T F
Slide 18
Slide 18 text
Implies and Causation
What is the relationship between P IMPLIES Q and P “CAUSES” Q?
Slide 19
Slide 19 text
Two-Input Operators
P Q AND(P, Q) OR(P, Q) P IMPLIES Q P IFF Q XOR(P, Q)
T T T T T T F
T F F T F F T
F T F T T F T
F F F F T T F
How many two-input Boolean operators are there?
Slide 20
Slide 20 text
P Q
AND
IFF
XOR
OR
IMPLIES
T T T T F F F T T T F F F T T T F F
T F T F T F F T F F T T F T T F T F
F T T F F T F F T F T F T T F T T F
F F T F F F T F F T F T T F T T T F
How many of these do we actually need?
Slide 21
Slide 21 text
DeMorgan’s Laws
Augustus De Morgan (1806-1871)
We can replace OR with AND,
and replace AND with OR!
Slide 22
Slide 22 text
Proof of equivalence:
Slide 23
Slide 23 text
Proof of equivalence:
Slide 24
Slide 24 text
Slack “quiz”: who of these knew De Morgan’s laws?
George
Boole
Ada,
Countess of
Lovelace
Thomas
Jefferson
Grace
Hopper
William of
Ockham
Slide 25
Slide 25 text
Slack “quiz”: who of these knew De Morgan’s laws?
[Formal Logic, 1847]
George
Boole
(1815-1864)
Ada
Lovelace
(1815-1852)
Thomas
Jefferson
(1743-1826)
Grace
Hopper
(1906-1992)
William of
Ockham
(1285-1346)
Slide 26
Slide 26 text
An Investigation of the Laws of Thought
on Which are Founded the Mathematical
Theories of Logic and Probabilities (1854)
Slide 27
Slide 27 text
No content
Slide 28
Slide 28 text
Completeness of Two-Input Operators
Is there something special about AND and OR?
Can we find an equivalence to AND that only uses NOT and XOR?
Slide 29
Slide 29 text
No content
Slide 30
Slide 30 text
P Q
AND
XOR
T T T F
T F F T
F T F T
F F F F
Slide 31
Slide 31 text
P Q
AND
“FFTF”
T T T F
T F F F
F T F T
F F F F
Slide 32
Slide 32 text
P Q
AND
“FFTF”
IFF
XOR
OR
IMPLIES
T T T T F F F T T T F F F T T T F F
T F T F T F F T F F T T F T T F T F
F T T F F T F F T F T F T T F T T F
F F T F F F T F F T F T T F T T T F
Slide 33
Slide 33 text
Definitions
A formula is valid if there is no way to make it false.
A formula is satisfiable if there is some way to make it true.
Slide 34
Slide 34 text
A formula is valid if there is no way to make it false.
A formula is satisfiable if there is some way to make it true.
Slide 35
Slide 35 text
A formula is valid if there is no way to make it false.
A formula is satisfiable if there is some way to make it true.
Slide 36
Slide 36 text
A formula is valid if there is no way to make it false.
A formula is satisfiable if there is some way to make it true.
Slide 37
Slide 37 text
Charge
• If you need to enroll in the class, bring me a
course action form to sign
• Due Friday (6:29pm): PS1
• Finish reading MCS Ch 3 next week