CmSc 175 Discrete Mathematics Lesson 02: Tautologies and Contradictions. Logical Equivalences. De Morgan’s Laws Solutions to Exercises 1. Tautologies and Contradictions Exercise: a) Show that P → Q ¬ P V Q is a tautology, i.e. P → Q ≡ ¬ P V Q P Q ¬P ¬PVQ P→Q P→Q¬PVQ ---------------------------------------------------------------------T T F T T T T F F F F T F T T T T T F F T T T T b) Show that ( P Q) ( ( P Λ Q ) V ( ¬P Λ ¬Q) ) is a tautology i.e. P Q ≡ ( P Λ Q ) V ( ¬P Λ ¬Q) P Q P Q ---------------------------T T T T F F F T F F F T P Q ~P ~Q PΛQ ¬P Λ ¬Q ( P Λ Q ) V ( ¬P Λ ¬Q) --------------------------------------------------------------------------------------------------T T F F T F T T F F T F F F F T T F F F F F F T T F T T Let A = ( P Q) ( ( P Λ Q ) V ( ¬P Λ ¬Q) ) P Q P Q ( P Λ Q ) V ( ¬P Λ ¬Q) A ---------------------------------------------------------------------------T T T T T T F F F T F T F F T F F T T T 1 c) Show that ( P Q) ( ( P Λ ¬Q ) V ( ¬P Λ Q) ) is a tautology i.e. P Q ≡ ( P Λ ¬Q ) V ( ¬P Λ Q) P Q P Q ---------------------------T T F T F T F T T F F F P Q ~P ~Q P Λ ~Q ¬P Λ Q ( P Λ ~Q ) V ( ¬P Λ Q) --------------------------------------------------------------------------------------------------T T F F F F F T F F T T F T F T T F F T T F F T T F F F Let A = ( P Q) ( ( P Λ ¬Q ) V ( ¬P Λ Q) ) P Q P Q ( P Λ ¬Q ) V ( ¬P Λ Q) A ---------------------------------------------------------------------------T T F F T T F T T T F T T T T F F F F T 2. Logical equivalences Exercises Use the equivalence A → B = ~A V B, and the equivalence laws. 1. Show that (A → B) Λ A is equivalent to A Λ B 2. Show that (A → B) Λ B is equivalent to B 3. Show that (A → B) Λ (B → A) is equivalent to A B 4. Show that ~((A → B) Λ (B → A)) is equivalent to A B 5. Show that ¬ ((P → Q) → P ) Λ P is a contradiction 2 1. Show that (A → B) Λ A is equivalent to A Λ B (A → B) Λ A = (~A V B) Λ A = Apply distributive law: (~A Λ A) V (B Λ A) = Apply complement properties: F V (B Λ A) = Apply identity laws: B Λ A=AVB 2. Show that (A → B) Λ B is equivalent to B (A → B) Λ B = (~A V B) Λ B = Apply distributive law: (~A Λ B) V (B Λ B) = Apply idempotency (consumption) laws: (~A Λ B) V B = Apply absorption laws B 3. Show that (A → B) Λ (B → A) is equivalent to A B (A → B) Λ (B → A) = (~A V B) Λ (~B V A) = Apply distributive law: (~A Λ ~B) V (~A Λ A) V (B Λ ~B) V (B Λ A) = Apply complement properties: (~A Λ ~B) V F V F V (B Λ A) = Apply identity laws: (~A Λ ~B) V (B Λ A) = Apply commutative laws: (B Λ A) V (~A Λ ~B) = Apply commutative laws: (A Λ B) V (~A Λ ~B) = A 3 4. Show that ~((A → B) Λ (B → A)) is equivalent to A B In problem 3 we showed that (A → B) Λ (B → A) = (A Λ B) V (~A Λ ~B) ~((A → B) Λ (B → A)) = ~( (A Λ B) V (~A Λ ~B) ) = Apply De Morgan’s laws: ~(A Λ B) Λ ~(~A Λ ~B) = Apply De Morgan’s laws: (~A V ~B) Λ (A V B) = Apply distributive law: (~A Λ A) V (~A Λ B) V (~B Λ A) V (~B Λ B) = Apply complement properties: F V (~A Λ B) V (~B Λ A) V F = Apply identity laws: (~A Λ B) V (~B Λ A) = Apply commutative laws: (~A Λ B) V ( A Λ ~B) = Apply commutative laws: ( A Λ ~B) V (~A Λ B) = A B 5. Show that ¬ ((P → Q) → P ) Λ P is a contradiction ¬ ((P → Q) → P ) Λ P = ~((~P V Q) → P ) Λ P = ~(~(~P V Q) V P ) Λ P = Apply De Morgan’s laws: ~( ( P Λ ~Q) V P) Λ P = Apply De Morgan’s laws: ~ ( P Λ ~Q) Λ ~P Λ P = Apply complement properties: ~ ( P Λ ~Q) Λ F = Apply identity laws: F 4 6. Replace the conditions in the following if statements with equivalent conditions without using the logical operators || and && a) if ((a > 0 && b > 0) || (b > 0)) c = a*b; Let P = a > 0, Q = b > 0 The expression is: (P Λ Q) V P) By the absorption law (P Λ Q) V P) = P Therefore we can replace ((a > 0 && b > 0) || (b > 0)) with b > 0 if (b > 0) c = a*b; b) if (( a > 0 || b > 0 ) && (b > 0)) c = a*b; Let P = a > 0, Q = b > 0 The expression is: (P V Q) Λ Q) By the absorption law (P V Q) Λ Q) = Q Therefore we can replace ((a > 0 || b > 0) && (b > 0)) with b > 0 if (b > 0) c = a*b; 5
© Copyright 2026 Paperzz