Presentation is loading. Please wait.

Presentation is loading. Please wait.

Discrete Mathematics. Propositional Logic 10/8/2015 What’s a proposition? PropositionsNot Propositions 3 + 2 = 32Bring me coffee! CS173 is Bryan’s favorite.

Similar presentations


Presentation on theme: "Discrete Mathematics. Propositional Logic 10/8/2015 What’s a proposition? PropositionsNot Propositions 3 + 2 = 32Bring me coffee! CS173 is Bryan’s favorite."— Presentation transcript:

1 Discrete Mathematics

2 Propositional Logic 10/8/2015 What’s a proposition? PropositionsNot Propositions 3 + 2 = 32Bring 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).

3 Propositional Logic - negation 10/8/2015 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p TFTF FTFT Notice that  p is a proposition!

4 Propositional Logic - conjunction 10/8/2015 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: pqp  q TTFFTTFF TFTFTFTF TFFFTFFF

5 Propositional Logic - disjunction 10/8/2015 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: pqp  q TTFFTTFF TFTFTFTF TTTFTTTF

6 Propositional Logic - logical equivalence 10/8/2015 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.

7 Propositional Logic - implication 10/8/2015 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: pqp  q TTFFTTFF TFTFTFTF TFTTTFTT

8 Propositional Logic - logical equivalence 10/8/2015 Challenge: Try to find a proposition that is equivalent to p  q, but that uses only the connectives , , and . pqp  q TTFFTTFF TFTFTFTF TFTTTFTT pq  pq   p TTFFTTFF TFTFTFTF FFTTFFTT TFTTTFTT

9 Logical equivalence 10/8/2015

10 Propositional Logic - proof of 1 famous  10/8/2015 Distributivity: p  (q  r)  (p  q)  (p  r) pqr q  rq  rp  (q  r)p  qp  qp  rp  r(p  q)  (p  r) TTTTTTTT TTFFTTTT TFTFTTTT TFFFTTTT FTTTTTTT FTFFFTFF FFTFFFTF FFFFFFFF I could say “prove a law of distributivity.”

11 Propositional Logic - special definitions 10/8/2015 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

12 Propositional Logic - 2 more defn… 10/8/2015 A tautology is a proposition that’s always TRUE. A contradiction is a proposition that’s always FALSE. p ppp  pp  pp  pp  p TF FT TTTT FFFF

13 Propositional Logic 10/8/2015  ( p   q)  q   p  q  ( p   q)  q     (  p   q)  q (  p  q)  q  p  (q  q)  p  q DeMorgan’s Involution Associativity Idempotent

14 Propositional Logic - one last proof 10/8/2015 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 T distributive complement identity substitution for  DeMorgan’s associative Complement Identity

15 Predicate Logic - everybody loves somebody 10/8/2015 Proposition? 3 + 2 = 5 X + 2 = 5 X + 2 = 5 for any choice of X in {1, 2, 3} X + 2 = 5 for some X in {1, 2, 3} YESNO YES

16 Predicate Logic 10/8/2015 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. …

17 Predicates 10/8/2015 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. …

18 Predicates 10/8/2015 Suppose Q(x,y) = “x > y” Proposition? Q(x,y) Q(3,4) Q(x,9) NOYESNO Predicate? Q(x,y) Q(3,4) Q(x,9) YESNOYES

19 THANK YOU


Download ppt "Discrete Mathematics. Propositional Logic 10/8/2015 What’s a proposition? PropositionsNot Propositions 3 + 2 = 32Bring me coffee! CS173 is Bryan’s favorite."

Similar presentations


Ads by Google