Use a truth table to show that the biconditional p ↔ q is equivalent to (p → q) ∧ (q → p).
A proposition is a sentence that is either true or false; connectives such as ¬, ∧, ∨, →, ↔ combine propositions into compound statements whose truth is fixed by a truth table. Truth tables underpin every tautology check, equivalence and argument test.
A proposition (also called a statement) is a declarative sentence that is either true or false, but not both. Its truth value is written T or F (1 or 0 in switching algebra). “Thiruvananthapuram is the capital of Kerala” is a true proposition; “7 is an even number” is a false one — a false proposition is still a proposition.
Many sentences fail the test. A question (“Is the server up?”), a command (“Close the door”) and an exclamation (“What a result!”) have no truth value. An open sentence such as “x + 2 = 5” is not a proposition until x is given a value or bound by a quantifier — that is the job of predicate logic. A paradox such as “This sentence is false” cannot consistently be given either value, so it is excluded too.
| Sentence | Proposition? | Reason |
|---|---|---|
| 2 + 3 = 5 | Yes (T) | Declarative and definitely true |
| Every prime number is odd | Yes (F) | Declarative; 2 is an even prime, so it is false |
| What time is it? | No | A question has no truth value |
| Please submit the form. | No | A command |
| x > 10 | No | Open sentence; its truth depends on x |
| There is life on some exoplanet | Yes | It is true or false even though nobody knows which yet |
Simple propositions are named by propositional variables p, q, r, s, … A proposition that cannot be broken into smaller propositions is atomic (primitive). One built from others with logical connectives is a compound proposition or compound statement — for example “the disk is full and the backup failed” is p ∧ q.
Each connective is defined completely by its truth table. With two variables there are four input combinations, so each table has four rows. The standard order lists them like binary counting from the top: TT, TF, FT, FF.
| Name | Symbol | Read as | True exactly when |
|---|---|---|---|
| Negation | ¬p (also ~p, p′) | not p | p is false |
| Conjunction | p ∧ q | p and q | both are true |
| Disjunction (inclusive or) | p ∨ q | p or q | at least one is true |
| Exclusive or (XOR) | p ⊕ q | p xor q | exactly one is true |
| Conditional (implication) | p → q | if p then q | p is false or q is true |
| Biconditional | p ↔ q | p if and only if q | both have the same truth value |
| NAND (Sheffer stroke) | p ↑ q | not both p and q | at least one is false |
| NOR (Peirce arrow) | p ↓ q | neither p nor q | both are false |
| p | q | ¬p | p ∧ q | p ∨ q | p ⊕ q | p → q | p ↔ q | p ↑ q | p ↓ q |
|---|---|---|---|---|---|---|---|---|---|
| T | T | F | T | T | F | T | T | F | F |
| T | F | F | F | T | T | F | F | T | F |
| F | T | T | F | T | T | T | F | T | F |
| F | F | T | F | F | F | T | T | T | T |
Everyday “or” is often exclusive (“tea or coffee?”), but logical ∨ is inclusive: p ∨ q is true when both are true. When a problem means “one or the other but not both”, it wants ⊕. Two useful identities: p ⊕ q ≡ ¬(p ↔ q) and p ⊕ q ≡ (p ∨ q) ∧ ¬(p ∧ q).
&&, || and ! implement ∧, ∨ and ¬ on conditions, with short-circuit evaluation (the right operand is skipped once the result is known). The bitwise operators &, |, ^ and ~ apply AND, OR, XOR and NOT to every bit: 6 & 3 = 2, 6 | 3 = 7 and 6 ^ 3 = 5 (110 and 011 in binary). Logic gates in Module 2 are the same truth tables built in hardware.In p → q, p is the hypothesis (antecedent) and q the conclusion (consequent). Think of it as a promise: “If you score above 90, I will give you a laptop.” The promise is broken in only one situation — you score above 90 and get no laptop. If you score below 90, nothing you receive breaks the promise, so the conditional counts as true. This is vacuous truth: a conditional with a false hypothesis is true.
| English phrasing | Symbolic form |
|---|---|
| if p, then q · p implies q | p → q |
| q if p · q whenever p · q when p | p → q |
| p only if q | p → q |
| p is sufficient for q · a sufficient condition for q is p | p → q |
| q is necessary for p · a necessary condition for p is q | p → q |
| q follows from p · q unless ¬p | p → q |
| p unless q | ¬q → p, which is ≡ p ∨ q |
| p if and only if q · p iff q · p is necessary and sufficient for q | p ↔ q |
From any conditional p → q we can form three related conditionals. The converse swaps the two parts, the inverse negates both parts, and the contrapositive swaps and negates.
| Form | Symbol | Example (p: it rains, q: the ground is wet) |
|---|---|---|
| Original | p → q | If it rains, the ground is wet. |
| Converse | q → p | If the ground is wet, it rained. |
| Inverse | ¬p → ¬q | If it does not rain, the ground is not wet. |
| Contrapositive | ¬q → ¬p | If the ground is not wet, it did not rain. |
| p | q | p → q | q → p | ¬p → ¬q | ¬q → ¬p |
|---|---|---|---|---|---|
| T | T | T | T | T | T |
| T | F | F | T | T | F |
| F | T | T | F | F | T |
| F | F | T | T | T | T |
The biconditional p ↔ q asserts both directions, (p → q) ∧ (q → p), so it is true exactly when p and q have the same truth value. “You can board the flight if and only if you hold a boarding pass” is a biconditional: the pass is both necessary and sufficient.
Worked illustration: the table of (p ∨ q) → (p ∧ r). There are three variables, hence 2³ = 8 rows. The helper columns p ∨ q and p ∧ r are filled first, then the conditional between them.
| p | q | r | p ∨ q | p ∧ r | (p ∨ q) → (p ∧ r) |
|---|---|---|---|---|---|
| T | T | T | T | T | T |
| T | T | F | T | F | F |
| T | F | T | T | T | T |
| T | F | F | T | F | F |
| F | T | T | T | F | F |
| F | T | F | T | F | F |
| F | F | T | F | F | T |
| F | F | F | F | F | T |
| Operator | Precedence |
|---|---|
| ¬ | 1 (highest — binds tightest) |
| ∧ | 2 |
| ∨ | 3 |
| → | 4 |
| ↔ | 5 (lowest) |
A compound proposition is a tautology if it is true under every assignment of truth values, a contradiction (absurdity) if it is false under every assignment, and a contingency otherwise. p ∨ ¬p (the law of excluded middle) is the simplest tautology and p ∧ ¬p the simplest contradiction.
| Tautology | Name / meaning |
|---|---|
| p ∨ ¬p | Law of excluded middle |
| ¬(p ∧ ¬p) | Law of non-contradiction |
| (p ∧ q) → p | Simplification |
| p → (p ∨ q) | Addition |
| [p ∧ (p → q)] → q | Modus ponens |
| [¬q ∧ (p → q)] → ¬p | Modus tollens |
| [(p → q) ∧ (q → r)] → (p → r) | Hypothetical syllogism (transitivity of →) |
| [(p ∨ q) ∧ ¬p] → q | Disjunctive syllogism |
| (p → q) ↔ (¬q → ¬p) | Contraposition |
| (p → q) ∨ (q → p) | For any two statements, at least one direction holds |
Useful facts: the negation of a tautology is a contradiction and vice versa; if A is a tautology then A ∨ B is a tautology for every B; if A is a contradiction then A ∧ B is a contradiction for every B. Substituting any formulas for the variables of a tautology leaves a tautology — that is why the rules of inference built from these patterns work for every content.
Two formulas A and B are logically equivalent, written A ≡ B, exactly when A ↔ B is a tautology. A logically implies B, written A ⇒ B, exactly when A → B is a tautology — that is, B is true in every row where A is true.
Quick check of a classic: is (p → q) ∨ (q → p) a tautology? p → q is false only when p = T and q = F, and in that very row q → p = F → T = T. So in every row at least one disjunct is true — it is a tautology.
Rows and functions. A formula in n distinct variables needs 2ⁿ rows. Each of those rows can independently receive T or F in the output column, so there are 2^(2ⁿ) different truth functions of n variables: 4 for n = 1, 16 for n = 2 and 256 for n = 3. That is why exactly 16 binary connectives exist, of which ∧, ∨, ⊕, →, ↔, ↑ and ↓ are the famous ones.
Counting T rows without a table. A disjunction p₁ ∨ p₂ ∨ … ∨ pₙ of distinct variables is false in exactly one row (all F), so it is true in 2ⁿ − 1 rows — 7 of 8 for three variables. A conjunction of distinct variables is true in exactly one row. A chain p₁ ⊕ … ⊕ pₙ is true in exactly half the rows, 2ⁿ⁻¹. And (p ∧ q) → r is false only when p = q = T and r = F — a single row.
Falsification (short truth-table) method. To test whether a formula is a tautology, try to make it false. An implication A → B is false only when A = T and B = F, so force those values and push them inward. If every attempt forces some variable to be both T and F, no falsifying row exists and the formula is a tautology.
The same method finds counterexamples fast. For (p → q) → (q → p), make the hypothesis T and the conclusion F: q → p = F forces q = T and p = F; then p → q = F → T = T, which is consistent. The row p = F, q = T falsifies it, so it is a contingency, not a tautology.
Pick a letter for each atomic sentence, stated positively, then map the connective words. “But”, “although”, “yet” and “even though” all become ∧ — they add emphasis, not logic. “Neither p nor q” is ¬p ∧ ¬q, which equals ¬(p ∨ q) and p ↓ q.
Finally, keep the brackets explicit when conditionals are chained. (p → q) → r and p → (q → r) are different: with p = F and r = F the first is (T) → F = F while the second is F → (…) = T.
Try the problem first, then reveal the working one step at a time.
Use a truth table to show that the biconditional p ↔ q is equivalent to (p → q) ∧ (q → p).
Classify each as a tautology, contradiction or contingency: (a) [p ∧ (p → q)] → q, (b) (p ∨ q) ∧ (¬p ∧ ¬q), (c) (p → q) → (q → p).
For integers n, consider “If n is divisible by 4, then n is even.” Write its converse, inverse and contrapositive, and decide which are true.
Consider (p ∧ q) → (r ∨ ¬s ∨ p). (a) How many rows does its truth table need? (b) Is it a tautology?
Construct the truth table of ¬(p ∨ q) ↔ (¬p ∧ ¬q). What kind of formula is it?
(a) How many rows are needed for a formula in p, q, r, s, t, u? (b) How many distinct truth functions of four variables exist? (c) In how many rows of its truth table is p → (q ∧ r) false?
Write the converse, inverse and contrapositive of “If the server is overloaded, then the response is slow.” Which of them is logically equivalent to the original?
Use the falsification method to decide whether [(p ∨ q) ∧ (p → r) ∧ (q → r)] → r is a tautology.
Let a: “you can access the lab”, c: “you are a CS student”, f: “you are a first-year student”. Symbolise: “You can access the lab only if you are a CS student or you are not a first-year student.”
12 questions. 70 % passes the topic quiz (+30 XP, +20 more for 100 %). Exam scoring: +1 correct, −⅓ wrong.
Modelled on real KPSC questions (reworded) with the same concept and answer; each links to its original paper.