L01 Logic
L01 Logic
Discrete Mathematics
M.M.A. Hashem, PhD
Expectations
This is really a fun course!
This class contains some of the most beautiful math you’ll
ever learn.
It’s even useful, beyond giving you techniques to use
solving the puzzles in Games Magazine.
10/03/20
Logic
a tool for careful reasoning
◦ Software and hardware development
Formal logic can lead to defect-free products
Used in chip design (since Pentium disaster)
Used in safety-critical software
Used in network-secure software
Positive influence on all software development
◦ Foundation for programming languages
Lambda calculus – semantic base for all PLs
Type checking and type inference – basis in logic
Computation models – limits of computability
◦ Artificial intelligence, database systems
Grounded in formal logic
10/03/20
Proof………
Here’s what you know:
Ellen is a math major or a CS major.
If Ellen does not like discrete math, she is not
a CS major.
If Ellen likes discrete math, she is smart.
Ellen is not a math major.
10/03/20
Propositional Logic
proposition
AWhat’s a proposition?
is a declarative statement that’s either TRUE or
FALSE (but not both).
10/03/20
Propositional Logic - negation
Suppose p is a proposition.
The negation of p is written p and has meaning:
“It is not the case that p.”
p p
Truth table for negation:
T F Notice that
F T p is a
proposition!
10/03/20
Propositional Logic - conjunction
p q pq
p q pq
10/03/20
Propositional Logic - logical equivalence
p q pq p q p q p
T T T T T F T
T F F T F F F
F T T F T T T
F F T F F T T
10/03/20
Propositional Logic - proof of 1 famous
I could say “prove
a law of
Distributivity: p (q r) (p q) (p r) distributivity.”
p q q p
10/03/20
Propositional Logic - 2 more defn…
p p p p p p
T F T F
F T T F
10/03/20
Propositional Logic - say a bit…
This week we’re using propositional logic as a foundation for
formal proofs.
10/03/20