Announcements • Homework 1, Due January 16 th • Reading: sections 1.1, 1.2, 1.3 CSE 321 Discrete Structures • Quiz section Thursday – 12:30-1:20 or 1:30 – 2:20 – CSE 305 Winter 2008 • Office hours Lecture 2 – Richard Anderson, CSE 582, Friday 2:30-3:30 Propositional Equivalences – Natalie Linnell, CSE 218, Monday, 11:00-12:00, Tuesday, 2:00-3:00 Biconditional p ↔ q Highlights from Lecture 1 • Fundamental tasks in computing • p iff q – • p is equivalent to q – • p implies q and q implies p • Propositional logic – Proposition: statement with a truth value p q p ↔ q – Basic connectives • ¬ , ∨ , ∧ , → , ⊕ , ↔ p q p → q – Truth table for implication English and Logic Logical equivalence • Terminology: A compound proposition is a • You cannot ride the roller coaster if you – Tautology if it is always true are under 4 feet tall unless you are older – Contradiction if it is always false than 16 years old – Contingency if it can be either true or false – q : you can ride the roller coaster p ∨ ¬ p – r : you are under 4 feet tall ( p ⊕ p ) ∨ p – s : you are older than 16 p ⊕ ¬ p ⊕ q ⊕ ¬ q ( p → q ) ∧ p ( p ∧ q ) ∨ ( p ∧ ¬ q ) ∨ ( ¬ p ∧ q ) ∨ ( ¬ p ∧ ¬ q )
Logical Equivalence Computing equivalence • p and q are Logically Equivalent if p ↔ q is • Describe an algorithm for computing if two a tautology. logical expressions are equivalent • The notation p ≡ q denotes p and q are • What is the run time of the algorithm? logically equivalent • Example: ( p → q ) ≡ ( ¬ p ∨ q ) p → q ¬ p ¬ p ∨ q (p → q) ↔ ( ¬ p ∨ q) p q Understanding connectives Properties of logical connectives • Reflect basic rules of reasoning and logic • Identity • Allow manipulation of logical formulas • Domination – Simplification • Idempotent – Testing for equivalence • Commutative • Applications • Associative – Query optimization • Distributive – Search optimization and caching • Absorption – Artificial Intelligence • Negation – Program verification Equivalences relating to De Morgan’s Laws implication • ¬ (p ∨ q) ≡ ¬ p ∧ ¬ q • p → q ≡ ¬ p ∨ q • ¬ (p ∧ q) ≡ ¬ p ∨ ¬ q • p → q ≡ ¬ q → ¬ p • p ∨ q ≡ ¬ p → q • p ∧ q ≡ ¬ (p → ¬ q) • What are the negations of: – Casey has a laptop and Jena has an iPod • p ↔ q ≡ (p → q) ∧ (q → p) • p ↔ q ≡ ¬ p ↔ ¬ q – Clinton will win Iowa or New Hampshire • p ↔ q ≡ (p ∧ q) ∨ ( ¬ p ∧ ¬ q) • ¬ (p ↔ q) ≡ p ↔ ¬ q
Show ( p ∧ q ) → ( p ∨ q ) is a Logical Proofs tautology • To show P is equivalent to Q – Apply a series of logical equivalences to subexpressions to convert P to Q • To show P is a tautology – Apply a series of logical equivalences to subexpressions to convert P to T Show (p → q) → r and p → (q → r) are not equivalent
Recommend
More recommend