Equivalence (If and Only If / Bi-conditional)

Rumman Ansari   Software Engineer   2025-08-09 04:58:44   180  Share
Subject Syllabus DetailsSubject Details
☰ TContent
☰Fullscreen

Table of Content:

🔄 Equivalence (If and Only If / Bi-conditional)

In logic, an equivalence or bi-conditional statement is written as:

👉 p ↔ q

Read as: "p if and only if q"


🧠 What does it mean?

A bi-conditional statement is true (1) when both p and q have the same value.

  • If both are true (1,1) → then p ↔ q is true (1)

  • If both are false (0,0) → then p ↔ q is true (1)

  • But if one is true and the other is false (1,0 or 0,1) → then p ↔ q is false (0)


🔢 Truth Table for p ↔ q (Using 0 and 1)

p q p ↔ q
0 0 1
0 1 0
1 0 0
1 1 1
 

📌 Summary:

Condition Result
Both same (0,0 or 1,1) ✅ 1 (True)
One true, one false (0,1 or 1,0) ❌ 0 (False)
 

Scenario: Door Lock with Two Keys

  • p = "Key A is turned ON"

  • q = "Key B is turned ON"

  • The door will open if and only if both keys are in the same position (either both ON or both OFF).


Truth Table with Example:

p (Key A) q (Key B) p ↔ q Door Status
0 (OFF) 0 (OFF) 1 ✅ Door Opens (same)
0 (OFF) 1 (ON) 0 ❌ Door Locked (different)
1 (ON) 0 (OFF) 0 ❌ Door Locked (different)
1 (ON) 1 (ON) 1 ✅ Door Opens (same)



Stay Ahead of the Curve! Check out these trending topics and sharpen your skills.