1 / 23

DeMorgan’s Laws ( p  q )  ( p )  ( q ) ( p  q )  ( p )  ( q )

p q p  q ( p  q )  p  q ( p )  ( q ) 1 1 1 0 0 0 0 1 0 0 1 0 1 1 0 1 0 1 1 0 1

ady
Download Presentation

DeMorgan’s Laws ( p  q )  ( p )  ( q ) ( p  q )  ( p )  ( q )

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. p q pq (pq) p q(p) (q) 1 1 1 0 0 0 0 1 0 0 1 0 1 1 0 1 0 1 1 0 1 0 0 0 1 1 1 1 DeMorgan’s Laws ( p  q )  (p) (q) (p  q )  (p) (q) (Peter is tall and fat) Peter is not tall Peter is not fat (cucumbers are green or seedy)  cucumbers are not green cucumbers are not seedy

  2. p q pqp p  q • 1 1 1 0 1 • 1 0 0 0 0 • 0 1 1 1 1 • 0 0 1 1 1 Other important logical equivalences pq   ( p  q) (proof by contradiction)   p  q

  3. What is negation of implication?  ( p  q) ( p  q)  p (q)

  4. pq  q p   pq  p  q converse of pq inverse of pq • p q pq q  p • 1 1 1 1 • 1 0 0 1 • 0 1 1 0 • 0 0 1 1 p q p  q 0 0 1 0 1 1 1 0 0 1 1 1 An integer is divisible by 4  it is divisible by 2. An integer is divisible by 2  it is divisible by 4. An integer is not divisible by 4 it is not divisible by 2.

  5. contrapositive ofpq pq  ( q) ( p) Contrapositive law • p q pqq p( q) ( p) • 1 1 1 0 0 1 • 1 0 0 1 0 0 • 0 1 1 0 1 1 • 0 0 1 1 1 1 An integer is no divisible by 2  it is not divisible by 4.

  6. Double negation:p p p q = p  q = p 1 0 1 0 1 0

  7. a  b = b  a a +b = b + a a  (b  c)= (a  b) c a + (b + c) = (a + b) +c • Commutativity • p  q  q  p • p  q  q  p • Associativity • p (q  r)  (p  q )  r • p (q  r)  (p  q )  r

  8. p q r p  q q  r p (q  r) (p  q )  r 1 1 1 1 1 1 1 1 1 0 1 1 1 1 1 0 1 0 1 1 1 1 0 0 0 0 0 0 0 1 1 0 1 0 1 0 1 0 0 1 0 0 0 0 1 0 1 0 1 0 0 0 0 0 0 0 p (q  r)  (p  q )  r / ? p (q  r)  (p  q )  r

  9. Distributivity • p (q  r)  (p  q )  ( p  r) • p (q  r)  (p  q )  ( p  r) a (b+c) = a  b +a  c a +b  c = (a + b)  (a +c) Analogy with algebra is not complete!

  10. Identity • p  F  p p T  p • Domination • p  T  Tp F  F • Inverse • p p F p  p T • Idempotent • p p p p p p

  11. Absorption laws • p (p  q)  p • p  (p  q)  p q = T p (p  q)  p (p  T)  p p  p q = F p (p  q)  p (p  F)  p F p

  12. Example: Use the laws of logic to show that the following expression is a tautology [(pq)  (q r)]  [p (q  r)] Take the left-hand side and perform equivalent transformations: (pq)  (qr)   (pq) (qr))………………...equivalence  ( p q) (q  r)……………….DeMorgan’s law  ( ( p q) q ) r)…………….associative law  ( ( pq)  ( q q))  r)………distributive law  ( (pq )  T) r)………………inverse law  ( pq ) r)……………………...identity law  (p(q r))……………………..associative law p (qr)

  13. Deduction Rules (Inference rules) Suppose H1 H2 ...  HnC is a tautology, whereH1, H2, ... Hn are hypotheses and C is a conclusion. Then, given that all hypotheses are true, the conclusion is always true, or it is a valid argument. H1 H2 … Hn  C H1 H2 ...  HnC is called an inference rule.

  14. p pq  q • Examples: • [ p and (pq)]  q is a tautology (check in truth table) Modus Pones: Given that p and pq are both true Conclude: q

  15. pq q  p pq q r  pr 2. [(pq)  q]  p is a tautology, which leads to: Modus Tolens(proof by contradiction) Given: pq, q Conclude: p 3. Syllogism: Given: pq, q r Conclude: pr

  16. p  F  p 4. [p  F]p is a tautology Rule of Contradiction Given: p  F Conclude: p

  17. Predicates : p(x): x is a prime number. q(x): x > 2 r(x): x is an odd number These predicates are not propositions, because they can be true of false depending on x (unbound variable). p(2) is true, but p(4) is false q(3) is true, but q(1) is false

  18. Quantifiers. Universal quantifier xp(x) "for all x p(x) is true" "for any (every) xp(x) is true" For any x 2x is even. (universe of discourse is all integers ). When the domain (universe of discourse) is finite, xp(x) is equivalent to p(0)p(1)p(2)…p(n). All students in this class are CS majors.

  19. Existential quantifier xp(x) "there exists (at least one) x such that p(x) is true" " for some xp(x) is true" There exists a student in this class who likes discrete mathematics. xp(x). In this case the universe consists of students in this class and p(x) is the proposition "Student x likes discrete mathematics". xp(x) p(x1)p(x2)…p(x70)

  20. Proposition true false x p(x) p(x) is true for every x There is an x for which p(x) is false x p(x) There is an x for which p(x) is false for every x p(x) is false

  21. Negating Quantifiers Find negations of statements including quantifiers. (xp(x)) (All books are interesting) = There exists at least one book that is not interesting (xp(x)) (Some people like mathematics.) = Everybody dislikes mathematics (x p(x))   x p(x) ( x p(x))  x p(x)

  22.  x[ p(x)q(x) ] / Compound statements with existential quantifier x[ p(x)q(x) ]  [xp(x)][xq(x) ] [xp(x)][xq(x) ] x[ p(x) q(x) ]  [xp(x)] [xq(x) ] [xp(x)] [xq(x) ]  x[ p(x) q(x) ]

  23.  [xp(x)]  [xq(x) ] / Compound statements with universal quantifier x[ p(x)q(x) ]  [xp(x)][xq(x) ] [xp(x)][xq(x) ]  x[ p(x)q(x) ] x[ p(x)q(x) ] [xp(x)]  [xq(x) ]  x[ p(x)q(x) ]

More Related