Discrete Mathematics. Propositional Logic 10/8/2015 What’s a proposition? PropositionsNot...
-
Upload
felicia-welch -
Category
Documents
-
view
222 -
download
0
Transcript of Discrete Mathematics. Propositional Logic 10/8/2015 What’s a proposition? PropositionsNot...
Discrete Mathematics
Propositional Logic
04/21/23
What’s a proposition?
Propositions Not Propositions
3 + 2 = 32 Bring me coffee!
CS173 is Bryan’s favorite class.
CS173 is her favorite class.
Every cow has 4 legs. 3 + 2
There is other life in the universe.
Do you like Cake?
A proposition is a declarative statement that’s either TRUE or FALSE (but not both).
Propositional Logic - negation
04/21/23
Suppose p is a proposition. The negation of p is written p and has meaning:
“It is not the case that p.”
Ex. CS173 is NOT Bryan’s favorite class.
Truth table for negation:p p
TF
FT
Notice that p is a
proposition!
Propositional Logic - conjunction
04/21/23
Conjunction corresponds to English “and.”
p q is true exactly when p and q are both true.
Ex. Amy is curious AND clever.
Truth table for conjunction:
p q p q
TTFF
TFTF
TFFF
Propositional Logic - disjunction
04/21/23
Disjunction corresponds to English “or.”
p q is when p or q (or both) are true.
Ex. Michael is brave OR nuts.
Truth table for disjunction:
p q p q
TTFF
TFTF
TTTF
Propositional Logic - logical equivalence
04/21/23
To answer, we need the notion of “logical equivalence.”
p is logically equivalent to q if their truth tables are the same. We write p
q.
Propositional Logic - implication
04/21/23
Implication: p q corresponds to English “if p then q,” or “p implies q.”
If it is raining then it is cloudy.If there are 200 people in the room, then I am the Easter Bunny.
If p then 2+2=4.
Truth table for implication:
p q p q
TTFF
TFTF
TFTT
Propositional Logic - logical equivalence
04/21/23
Challenge: Try to find a proposition that is equivalent to p q, but that uses only the connectives , , and .
p q p q
TTFF
TFTF
TFTT
p q p q p
TTFF
TFTF
FFTT
TFTT
Logical equivalence
04/21/23
Propositional Logic - proof of 1 famous
04/21/23
Distributivity: p (q r) (p q) (p r)
p q r q r p (q r) p q p r (p q) (p r)
T T T T T T T T
T T F F T T T T
T F T F T T T T
T F F F T T T T
F T T T T T T T
F T F F F T F F
F F T F F F T F
F F F F F F F F
I could say “prove a law
of distributivi
ty.”
Propositional Logic - special definitions
04/21/23
Contrapositives: p q and q p Ex. “If it is noon, then I am hungry.”
“If I am not hungry, then it is not noon.”
Converses: p q and q p Ex. “If it is noon, then I am hungry.”
“If I am hungry, then it is noon.”Inverses: p q and p q
Ex. “If it is noon, then I am hungry.” “If it is not noon, then I am not
hungry.”
One of the pair of
propositions is equivalent.
p q q p
Propositional Logic - 2 more defn…
04/21/23
A tautology is a proposition that’s always TRUE.
A contradiction is a proposition that’s always FALSE.
p p p p p p
T F
F T
T
T
F
F
Propositional Logic
04/21/23
(p q) q p q
(p q) q
(p q) q(p q) qp (q q)p q
DeMorgan’s
Involution
AssociativityIdempotent
Propositional Logic - one last proof
04/21/23
Show that [p (p q)] q is a tautology. We use to show that [p (p q)] q T.
substitution for
[p (p q)] q
[(p p) (p q)] q
[p (p q)] q
[ F (p q)] q (p q) q (p q) q (p q) q p (q q ) p T T
distributive
complement
identity
substitution for DeMorgan’s
associative
Complement
Identity
Predicate Logic - everybody loves somebody
04/21/23
Proposition?3 + 2 = 5X + 2 = 5X + 2 = 5 for any choice of X in {1, 2, 3}X + 2 = 5 for some X in {1, 2, 3}
YES
NO
YES
YES
Predicate Logic
04/21/23
Alicia eats pizza at least once a week.Garrett eats pizza at least once a week.
Allison eats pizza at least once a week.
Gregg eats pizza at least once a week.Ryan eats pizza at least once a week.Meera eats pizza at least once a week.Ariel eats pizza at least once a week.
…
Predicates
04/21/23
Alicia eats pizza at least once a week.
Define:EP(x) = “x eats pizza at least once a week.”Universe of Discourse - x is a student in CSER1209
A predicate, or propositional function, is a function that takes some variable(s) as arguments and returns True or False.
Note that EP(x) is not a proposition, EP(Alicia) is.
…
Predicates
04/21/23
Suppose Q(x,y) = “x > y”
Proposition?Q(x,y)Q(3,4)Q(x,9)
NO
YES
NO
Predicate?Q(x,y)Q(3,4)Q(x,9)
YES
NO
YES
THANK YOU