Engineering Mathematics
Mathematical Logic
Learn truth tables, implications, and quantifier negations so you can decide validity and equivalences in under a minute — then lock it with GATE-style MCQs and flashcards.
GATE CSE mathematical logic — propositional logic, normal forms, predicates, quantifiers, sample GATE questions, flashcards, and practice drills.
Learning outcomes
- Build and read truth tables for compound propositions
- Convert formulas to CNF/DNF at GATE depth
- Negate quantified statements correctly
- Solve GATE-style logic MCQs with a clear explanation trail
Propositional connectives
- Atomic propositions combine with ¬, ∧, ∨, →, ↔. Precedence usually ¬ > ∧ > ∨ > → > ↔ (confirm convention in the stem).
- Implication p → q is false only when p is true and q is false. Memorise the truth table.
- p → q ≡ ¬p ∨ q ≡ ¬q → ¬p (contrapositive). Converse q → p is not equivalent.
- Biconditional p ↔ q is true when p and q have the same truth value.
- Exclusive OR p ⊕ q is true when exactly one of p, q is true; p ⊕ q ≡ (p ∨ q) ∧ ¬(p ∧ q) ≡ ¬(p ↔ q).
| p | q | p→q | p↔q | p⊕q |
|---|---|---|---|---|
| T | T | T | T | F |
| T | F | F | F | T |
| F | T | T | F | T |
| F | F | T | T | F |
Worked example
Problem. Which is logically equivalent to ¬(p → q)?
Solution. ¬(¬p ∨ q) ≡ p ∧ ¬q. So implication fails exactly when the premise is true and the conclusion is false.
Normal forms & classification
- A tautology is always true; a contradiction always false; otherwise contingency.
- DNF is OR of ANDs of literals; CNF is AND of ORs of literals. GATE may ask which form a formula is in.
- You can obtain DNF from the truth table by OR-ing minterms where the formula is true.
- Logical equivalence means identical truth tables — use identities (idempotent, absorption, De Morgan) to simplify.
- A formula is satisfiable if some assignment makes it true; valid formulas are a special case of satisfiable ones.
Formulas to remember
-
¬(p ∧ q) ≡ ¬p ∨ ¬q -
¬(p ∨ q) ≡ ¬p ∧ ¬q -
p → q ≡ ¬p ∨ q -
(p → q) ∧ (q → p) ≡ p ↔ q
Worked example
Problem. Is (p → q) ∧ (q → p) a tautology?
Solution. No — it is equivalent to p ↔ q, which is false when p and q differ. It is a contingency (satisfiable, not valid).
Inference patterns used in GATE
- Modus Ponens: from p and p → q infer q. Modus Tollens: from ¬q and p → q infer ¬p.
- Hypothetical syllogism: from p → q and q → r infer p → r.
- Disjunctive syllogism: from p ∨ q and ¬p infer q.
- Resolution on CNF clauses is the engine behind many “which conclusion follows” stems — eliminate complementary literals.
| Rule | Premises | Conclusion |
|---|---|---|
| Modus Ponens | p , p → q | q |
| Modus Tollens | ¬q , p → q | ¬p |
| HS | p → q , q → r | p → r |
| DS | p ∨ q , ¬p | q |
Predicates & quantifiers
- ∀x P(x) means P holds for every x in the domain; ∃x P(x) means it holds for at least one x.
- Negation: ¬∀x P(x) ≡ ∃x ¬P(x) and ¬∃x P(x) ≡ ∀x ¬P(x). Flip quantifier and negate the matrix.
- Order of mixed quantifiers matters: ∀x ∃y R(x,y) is not the same as ∃y ∀x R(x,y).
- Restrict domains carefully — “for all positive integers” changes truth values versus “all integers”.
- Nested reading tip: ∀x ∃y means “for each x you may pick a (possibly different) y”; ∃y ∀x means “one y works for every x”.
Worked example
Problem. Negate: ∀x ∃y (x < y).
Solution. ∃x ∀y ¬(x < y) ≡ ∃x ∀y (x ≥ y) — “there is a maximum element”.
English → logic translation checklist
- “If P then Q” / “P only if Q” → P → Q. “P if Q” → Q → P. “P if and only if Q” → P ↔ Q.
- “Unless” often rewrites as: “P unless Q” ≈ ¬Q → P (equivalently P ∨ Q).
- “Necessary condition for P is Q” means P → Q. “Sufficient condition for P is Q” means Q → P.
- Unique existence “exactly one” uses ∃x (P(x) ∧ ∀y (P(y) → y = x)).
Exam tips
- When stuck on implication chains, rewrite every → as ¬p ∨ q and simplify.
- For quantifier MCQs, try a tiny domain {1,2} to test candidate answers.
- Remember: converse ≠ contrapositive; only contrapositive preserves equivalence.
- Mark “valid”, “satisfiable”, and “unsatisfiable” on scrap paper before eliminating options.
- In “which follows” questions, check whether the conclusion is true in every model of the premises — not merely sometimes.
10 GATE-style MCQs for Mathematical Logic with full explanations. Attempt each question before revealing the answer.
Which one of the following is NOT logically equivalent to ¬∃x ∀y (¬P(y) ∨ Q(x))?
Show answer & explanation
Answer: C
Start from ¬∃x ∀y (¬P(y) ∨ Q(x)). Push negation: ∀x ∃y ¬(¬P ∨ Q) ≡ ∀x ∃y (P ∧ ¬Q). Also ¬P∨Q ≡ P→Q, so the original is ¬∃x ∀y (P→Q), matching D. Option C replaces ∧ ¬Q by → and flips the meaning — it is not equivalent.
Consider the following logical inferences. I. If it rains, then the cricket match will not be played. II. The cricket match was played. From I and II, which conclusion follows?
Show answer & explanation
Answer: B
Let R = rains, M = match played. I is R → ¬M. II is M. From M we get ¬(¬M), so Modus Tollens on R → ¬M yields ¬R. So it did not rain.
Which of the following is a tautology?
Show answer & explanation
Answer: B
(p ∧ q) → (p ∨ q) fails never: if both true, consequent true; if the antecedent is false, implication is true. A fails when exactly one of p,q is true. C fails when p is true. D is converse of implication and fails when p true, q false.
The propositional formula (p ∧ (p → q) ∧ ¬q) is:
Show answer & explanation
Answer: C
From p and p → q infer q (Modus Ponens), which contradicts ¬q. Equivalently: p ∧ (¬p ∨ q) ∧ ¬q has no satisfying assignment. So the formula is a contradiction.
Let p, q, r be propositions. Which of the following is TRUE?
Show answer & explanation
Answer: B
Contrapositive: p → q ≡ ¬q → ¬p. A is inverse (not equivalent). C is converse. D is the negation of the implication, not the implication itself.
Which one is the correct translation of: “Every person has a mother” over people domain with M(x,y) = “y is mother of x”?
Show answer & explanation
Answer: B
For each person x there exists some y who is mother of x: ∀x ∃y M(x,y). Option A says one fixed mother for everyone.
Which of the following propositional formulas is a tautology?
Show answer & explanation
Answer: D
A is a standard tautology (if p is true, the implication holds; if p is false, p→anything is true after inner analysis — truth table confirms). C has antecedent p∧¬p always false, so the implication is always true regardless of consequent. B fails when p is false and q is true. So A and C are tautologies.
The number of different truth assignments that make (p ∨ ¬q) ∧ (¬p ∨ q) true is:
Show answer & explanation
Answer: C
(p∨¬q)∧(¬p∨q) ≡ p↔q, true for (p,q)=(T,T) and (F,F) — exactly 2 assignments.
¬∀x (P(x) → Q(x)) is equivalent to:
Show answer & explanation
Answer: B
¬∀x (P→Q) ≡ ∃x ¬(¬P∨Q) ≡ ∃x (P∧¬Q). Option A wrongly keeps ∀. Option C is weaker/wrong shape.
Which conclusion follows from the premises? 1. ¬p ∨ q 2. ¬q ∨ r 3. p
Show answer & explanation
Answer: B
From p and ¬p∨q get q (resolution / DS). From q and ¬q∨r get r. So r follows. ¬r contradicts; ¬p contradicts premise 3.
Extra page-specific practice beyond the GATE samples. Attempt all 10, then reveal answers to check your reasoning.
How many rows of the truth table of (p ⊕ q) → (p ∨ q) evaluate to TRUE?
Show answer & explanation
Answer: D) 4
p⊕q is T only for (T,F) and (F,T); in both cases p∨q is T, so implication T. When p⊕q is F, implication is automatically T. All 4 rows true — a tautology.
Simplify (¬p ∨ q) ∧ (p ∨ ¬q) to a single connective form.
Show answer & explanation
Answer: B) p ↔ q
(¬p∨q) is p→q and (p∨¬q) is q→p. Their AND is p↔q.
Which formula is in CNF?
Show answer & explanation
Answer: B) (p ∨ q) ∧ (¬p ∨ r)
CNF is a conjunction of disjunctions of literals. B matches. A is DNF-shaped; C has a negated clause; D still has →.
The negation of ∃x (P(x) → Q(x)) is equivalent to:
Show answer & explanation
Answer: B) ∀x (P(x) ∧ ¬Q(x))
¬∃x (P→Q) ≡ ∀x ¬(¬P∨Q) ≡ ∀x (P∧¬Q).
Domain = {1,2}. Which is TRUE?
Show answer & explanation
Answer: B) ∃y ∀x (x ≤ y)
Take y=2: both 1≤2 and 2≤2. A fails for x=2 (no larger element). C is false because equals exist. D would need an x greater than every y, impossible.
From premises (p ∨ q) and (¬p ∨ r), which conclusion is valid?
Show answer & explanation
Answer: B) q ∨ r
Resolution/case split: if p then from ¬p∨r get r; if ¬p then from p∨q get q. Either way q∨r. q∧r need not hold.
“A sufficient condition for failure is overheating” with F=failure, H=overheating means:
Show answer & explanation
Answer: B) H → F
Sufficient condition for F is H means H is enough to guarantee F: H → F.
Which identity is correct?
Show answer & explanation
Answer: A) p NOR q ≡ ¬p ∧ ¬q
NOR is ¬(p ∨ q) ≡ ¬p ∧ ¬q by De Morgan. NAND is ¬(p ∧ q) ≡ ¬p ∨ ¬q, so B/C/D are wrong.
Is ((p → q) ∧ (q → r) ∧ p ∧ ¬r) satisfiable?
Show answer & explanation
Answer: B) No
From p and p→q get q; from q and q→r get r; contradicts ¬r. Unsatisfiable (contradiction).
Translate and negate: “Someone in the class can solve every GATE logic question.” Let C(x)=in class, S(x,y)=x solves y, Q(y)=logic question.
Show answer & explanation
Answer: A) Negation: ∀x (C(x) → ∃y (Q(y) ∧ ¬S(x,y)))
Original: ∃x (C(x) ∧ ∀y (Q(y) → S(x,y))). Negate: ∀x (¬C(x) ∨ ∃y (Q(y) ∧ ¬S(x,y))) ≡ ∀x (C(x) → ∃y (Q(y) ∧ ¬S(x,y))).
Topic FAQs
Do I need formal proof systems (natural deduction) for GATE?
No. Focus on truth tables, equivalences, normal forms, and quantifier negation — not Gentzen-style proofs.
What is the difference between satisfiable and valid?
Valid = tautology (true in every interpretation). Satisfiable = true in at least one interpretation. Contingencies are satisfiable but not valid.
How many logic questions appear in GATE CSE?
Usually a small but scoring cluster inside Discrete Mathematics — often 1–2 marks via MCQ/MSQ on equivalence, validity, or quantifiers. Accuracy matters more than volume.
Hover a card to reveal the answer with a 3D flip. On touch devices, tap the card or use Show answer.