START WELL TO END WELL
+92 340 1501700 startwelleducationbhimber@gmail.com Mon – Sat: 8:00 AM – 2:00 PM
Startwell Education logo
StartwellEducation
Discrete Structures · Lecture 3

Logical Equivalence and the Laws of Logic

Week 1, slot 3 · CLO-2, CLO-4 · Bloom C3 · Prerequisite: Lectures 1–2 · Reference: Rosen 7th, Logic and Proofs

Learning objectives

  1. Define logical equivalence and test it.
  2. Apply De Morgan's laws, the conditional identity and other standard laws.
  3. Write the converse, inverse and contrapositive of an implication.
  4. Prove equivalences by a chain of laws.

Roman Urdu. Do statements logically equivalent (≡) hotay hain jab un ki truth values har surat mein barabar hon. Hum De Morgan's laws aur dosray laws seekhte hain, aur dekhte hain ke implication ka contrapositive hamesha us ke barabar hota hai, jabke converse aur inverse nahi.

Core concepts

Definition. p ≡ q means p ↔ q is a tautology, i.e. p and q have identical truth values in every row.

Standard laws

Law Equivalence
Double negation ¬¬p ≡ p
De Morgan ¬(p ∧ q) ≡ ¬p ∨ ¬q ; ¬(p ∨ q) ≡ ¬p ∧ ¬q
Commutative p ∧ q ≡ q ∧ p ; p ∨ q ≡ q ∨ p
Associative (p ∧ q) ∧ r ≡ p ∧ (q ∧ r) ; same for ∨
Distributive p ∧ (q ∨ r) ≡ (p ∧ q) ∨ (p ∧ r) ; p ∨ (q ∧ r) ≡ (p ∨ q) ∧ (p ∨ r)
Absorption p ∨ (p ∧ q) ≡ p ; p ∧ (p ∨ q) ≡ p
Conditional identity p → q ≡ ¬p ∨ q
Contrapositive p → q ≡ ¬q → ¬p
Biconditional p ↔ q ≡ (p → q) ∧ (q → p)

Related implications of p → q

Name Form Equivalent to p → q?
Converse q → p No
Inverse ¬p → ¬q No
Contrapositive ¬q → ¬p Yes

The converse and inverse are equivalent to each other but not to the original. Take p = F and q = T: p → q is T, but q → p is F.

Worked examples

Example 1 (basic). Prove ¬(p ∨ q) ≡ ¬p ∧ ¬q by a table.

p q p∨q ¬(p∨q) ¬p ¬q ¬p ∧ ¬q
T T T F F F F
T F T F F T F
F T T F T F F
F F F T T T T

Columns 4 and 7 agree in every row.

Example 2 (intermediate). Negate "The file is open and the user is logged in." By De Morgan: "The file is not open or the user is not logged in." Why: for a conjunction to fail, at least one part must fail.

Example 3 (advanced). Prove (p ∧ q) → r ≡ p → (q → r) using laws. 1. (p ∧ q) → r ≡ ¬(p ∧ q) ∨ r (conditional identity) 2. ≡ (¬p ∨ ¬q) ∨ r (De Morgan) 3. ≡ ¬p ∨ (¬q ∨ r) (associative) 4. ≡ ¬p ∨ (q → r) (conditional identity) 5. ≡ p → (q → r) (conditional identity)

The result says that a function taking two arguments is the same as one taking them one at a time (currying).

Example 4 (computing). Simplify if (!(a || b)) to if (!a && !b) by De Morgan. Both versions behave identically on every input.

Computer science connection

Simplifying conditions and circuits; compilers rewriting Boolean expressions; query optimisers rewriting WHERE clauses; the contrapositive underlies test design ("if the output is wrong, some input was invalid").

Key takeaways

  • Equivalent statements have the same truth table.
  • De Morgan swaps ∧ and ∨ when negating.
  • p → q ≡ ¬p ∨ q ≡ ¬q → ¬p. The converse is not equivalent.

Roman Urdu. De Morgan: ¬(p ∧ q) = ¬p ∨ ¬q. Implication p → q ka contrapositive ¬q → ¬p us ke barabar hai, lekin converse (q → p) aur inverse (¬p → ¬q) barabar nahi hotay.

Five revision questions

  1. Write the converse, inverse and contrapositive of "If it rains, I stay home."
  2. Negate "x > 0 or y > 0."
  3. Prove p ∨ (p ∧ q) ≡ p.
  4. Show that p → q and q → p are not equivalent.
  5. Show p ↔ q ≡ (p ∧ q) ∨ (¬p ∧ ¬q).

Homework. Prove the distributive law p ∧ (q ∨ r) ≡ (p ∧ q) ∨ (p ∧ r) with an 8-row table, then write two code conditions and simplify each using the laws.

Quiz

¬(p ∧ q) kis ke barabar hai? (De Morgan)

All lectures

  1. Lecture 0: Discrete vs Continuous
  2. Lecture 1: Propositions and Connectives
  3. Lecture 2: Truth Tables, Tautologies and Contradictions
  4. Lecture 3: Logical Equivalence and the Laws of Logic
  5. Lecture 4: Predicate Logic and Quantifiers
  6. Lecture 5: Rules of Inference
  7. Lecture 6: Logical Arguments and Puzzle Solving
  8. Lecture 7: Direct Proof and Proof by Implication
  9. Lecture 8: Proof by Contraposition
  10. Lecture 9: Proof by Contradiction
  11. Lecture 10: Mathematical Induction
  12. Lecture 11: Strong Induction
  13. Lecture 12: Applications of Proofs and Proof Strategy
Admissions Open

Give your child the right start.

Seats are limited. Visit our campus, meet our teachers and see why families trust Startwell Education.