1 / 20

ICS 253: Discrete Structures I

ICS 253: Discrete Structures I. Spring Semester 2014 (2013-2). Propositional Logic Logical Equivalence. Dr. Nasir Al-Darwish Computer Science Department King Fahd University of Petroleum and Minerals darwish@kfupm.edu.sa. Tautologies, contradictions, contingencies.

peri
Download Presentation

ICS 253: Discrete Structures I

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. ICS 253: Discrete Structures I Spring Semester 2014 (2013-2) Propositional LogicLogical Equivalence Dr. Nasir Al-Darwish Computer Science Department King Fahd University of Petroleum and Minerals darwish@kfupm.edu.sa

  2. Tautologies, contradictions, contingencies • A compound proposition is a tautology if it is always true no matter what truth values its atomic propositions have. • Example: p ¬p • The opposite to a tautology, is a compound proposition that’s always false – a contradiction. • Example: p ¬p • On the other hand, a compound proposition whose truth value isn’t constant is called a contingency. • Example: p ¬p

  3. Tautologies and contradictions The easiest way to see if a compound proposition is a tautology or a contradiction is to use a truth table.

  4. Tautology Example Demonstrate that [¬p (p  q)]q is a tautology in two ways: • Using a truth table – show that [¬p (p  q)]q is always true • Using a proof (will get to this later). Note: The LHS asserts (states) two facts: ¬p and (p  q) Clearly, these assertions taken together imply q.

  5. Tautology Example - Part 1: by truth table

  6. Tautologies, contradictions and programming Tautologies and contradictions in your code usually correspond to poor programming design. Examples: • while(x <= 3 || x > 3) x++; • if(x > y) if(x == y) return “never got here”;

  7. Logical Equivalence • Definition: Two compound propositions p, q are logically equivalent if their truth tables are the same. • Alternative Definition: Two compound propositions p, q are logically equivalent if their biconditional joining p q is a tautology. • Logical equivalence is denoted by p q or p q. • Example: A logical implication is equivalent to its contrapositive. That is, pq ¬q¬p.

  8. Logical Equivalence - Example 1 The easiest way to test for logical equivalence is to check if the truth tables of both propositions have identical last columns Example: Is pq ¬q¬p? p q ¬q ¬p ¬q¬p p q p q T T F F T F T F F T F T F F T T T T F F T F T F T F T T T F T T Note that because the last columns are identical, it follows that (p q) (¬q¬p) is a tautology, which is consistent with the second def. of equivalence in previous slide.

  9. Logical Equivalence - Example 2 • Show that ┐(p v q) and ┐p ˄┐ q are equivalent

  10. Logical Non-Equivalence of Conditional and Converse The converse of a logical implication is the reversal of the implication. I.e. the converse of pq is qp. Example: The converse of “If Donald is a duck then Donald is a bird.” is “If Donald is a bird then Donald is a duck.” As we’ll see next: pq and qp are not logically equivalent.

  11. Logical Non-Equivalence of Conditional and Converse Note that because the columns for p q and qp are not identical, we can immediately conclude that these propositions are not equivalent.

  12. Derivational Proof Techniques When a compound proposition involves many atomic components, the size of the truth table for the compound proposition becomes large Q1: How many rows are required to construct the truth-table of: ((q(pr ))  ((sr)t) )  (qr) ? Q2: How many rows are required to construct the truth-table of a proposition involving n atomic components? A1: 32 rows, each additional variable doubles the number of rows A2: In general, 2n rows Therefore, as compound propositions grow in complexity, truth tables become more and more unwieldy. In such cases, it is better to use derivational proof techniques

  13. Derivational Proof Techniques Example: consider the compound proposition (p p )  ((sr)t) )  (qr ) Q: Why is this a tautology?

  14. Derivational Proof Techniques Answer: The part (p p) is a tautology and the disjunction (or) of True with any other compound proposition always results in True: (p p )  ((sr)t ))  (qr) • T  ((sr)t ))  (qr) • T Derivational techniques formalize the intuition of this example.

  15. Identity laws Like adding 0 Domination laws Like multiplying by 0 Idempotent laws Delete redundancies Double negation “I don’t like you, not” Commutativity Like “x+y = y+x” Associativity Like “(x+y)+z = y+(x+z)” Distributivity Like “(x+y)z = xz+yz” Tables of Logical Equivalences

  16. Excluded middle Negating creates opposite Definition of implication in terms of Not and Or Tables of Logical Equivalences

  17. DeMorgan Identities DeMorgan’s identities allow for simplification of negations of complex expressions • Conjunctional negation: (p1p2…pn)  (p1p2…pn) “It’s not the case that all are true iff one is false.” • Disjunctional negation: (p1p2…pn)  (p1p2…pn) “It’s not the case that one is true iff all are false.”

  18. Tautology Example - Part 2 Demonstrate that [¬p(p q )]q is a tautology in two ways: • Using a truth table (was done previously) • Using a proof relying on Tables 5 and 6 of Rosen, section 1.3 to derive True through a series of logical equivalences

  19. Tautology by proof [¬p(p q )]q  [(¬pp)(¬pq)]q Distributive  [ F  (¬pq)]q ULE  [¬pq ]q Identity ¬ [¬pq ] q ULE  [¬(¬p)¬q ] q DeMorgan  [p ¬q ] q Double Negation p  [¬q q ]Associative p  [q ¬q ]Commutative p  T ULE  T Domination

  20. Important Equivalences • p  q   (p  q) // meaning of  • p  q   p q // simplify RHS of 1 • p  q   q  p // contrapositive •  (p  q)  p q // negation of 1 • (p  q)  (p  r)  p  (q  r) • (p  q)  (p  r)  p  (q  r) • (p  r)  (q  r)  (p  q)  r • (p  r)  (q  r)  (p  q)  r • p  q  (p  q)  (q  p) •  (p  q)  p   q

More Related