Day 34 — Gate III
Day 34 — Gate III
Stage III · gate day
Goal: Closed-book mixed review of propositional logic, quantifiers, and proof methods (Days 23–33). Diagnose weak spots; retest before Stage IV.
Why this matters
Gates are mastery checks, not calendar markers. Stage IV (sets, relations, functions) assumes you can negate statements, choose a proof style, and not swap \(\forall\exists\). If this gate frays, repair now—later counting and graphs pile on justification load.
What this gate covers
| Block | Days | Skills |
|---|---|---|
| Truth tables & connectives | 23 | Tables; tautology/contradiction; \(\rightarrow\) vacuous truth; XOR; precedence |
| Boolean algebra | 24 | De Morgan, absorption, simplify; DNF/CNF lite |
| Equivalence | 25 | Tables + law chains; contrapositive \(\equiv\); completeness awareness |
| Predicates & quantifiers | 26 | Translate; negate; restricted \(\forall\)/\(\exists\) |
| Nested quantifiers | 27 | Order matters; \(\exists!\); witnesses |
| Direct proof | 28 | Parity, divides |
| Contrapositive / contradiction | 29 | Method choice; \(\sqrt{2}\) shape |
| Cases & existence | 30 | Exhaustion; constructive existence |
| Weak / strong induction | 31–32 | \(P(n)\); loop invariant idea; structural lite |
| Fallacies | 33 | Affirming consequent; bad induction; quantifier shift |
How to use this page
- Closed book first pass (timebox \(90\)–\(120\) minutes).
- Mark each item: ✅ confident / ⚠ shaky / ❌ failed.
- Open notes only to repair ❌/⚠—then re-solve cold next day.
- Do not proceed to Day 35 until you can clear a second pass on failed items.
No programming labs. Optional calculator only to check arithmetic. Proofs are by hand.
Theory — rapid self-check sheet
Reproduce from memory on scrap paper, then compare:
- Truth tables for \(p\rightarrow q\), \(p\leftrightarrow q\), \(p\oplus q\).
- De Morgan laws (propositional) and quantifier negation rules.
- \(p\rightarrow q \equiv \neg p \vee q \equiv \neg q \rightarrow \neg p\).
- Restricted quantifiers: \(\forall x\in S\,P\) vs \(\exists x\in S\,P\).
- Why \(\forall x\exists y\,P \not\equiv \exists y\forall x\,P\) (one counter-model).
- Direct / contrapositive / contradiction templates.
- Weak induction skeleton; strong when needed.
- Loop invariant: init / maintain / exit+use.
- Affirming the consequent in one line; illicit \(\forall\exists\) shift.
- Definition of even/odd and \(a\mid b\).
Worked examples (gate warm-ups)
Warm-up A — Table
Show \((p \wedge q) \rightarrow p\) is a tautology (4 rows).
Warm-up B — Simplify
\(\neg(p \rightarrow \neg q) \equiv p \wedge q\) (named laws).
Warm-up C — Quantifiers
Negate \(\forall x \exists y\, (x < y)\) on \(\mathbb{Z}\) and state the truth of the original.
Warm-up D — Direct proof
If \(n\) odd then \(n^2\) odd.
Warm-up E — Contrapositive
If \(n^2\) even then \(n\) even.
Warm-up F — Induction
\(\sum_{i=1}^n i = n(n+1)/2\).
Warm-up G — Fallacy
Name: From “if admin then 2FA” and “has 2FA” infer “admin.”
Warm-up H — Cases
\(n(n+1)\) always even.
Warm-up I — Strong / postage lite
Why three consecutive bases when stepping by \(3\) in postage proofs?
Warm-up J — Nested English
Translate both orders: every student takes some course / some course taken by every student.
Gate exam (closed book)
Part I — Propositional (mix)
- Full truth table for \((p \rightarrow q) \wedge (q \rightarrow p)\). Relate to \(\leftrightarrow\).
- Is \((p \rightarrow q) \vee (q \rightarrow p)\) a tautology? Justify.
- Simplify \(\neg(\neg p \wedge q)\) with named laws.
- Prove or disprove equivalence: \(p \rightarrow (q \rightarrow r)\) vs \((p \rightarrow q) \rightarrow r\).
- Write XOR in DNF and CNF.
- Parenthesize under standard precedence: \(\neg p \vee q \rightarrow r\).
- Sufficient vs necessary: one sentence each with arrows for “valid token / access.”
- Show \(p \wedge (p \vee q) \equiv p\) (absorption) by algebra or table.
Part II — Quantifiers
- Translate: “No banned user is admin.” Two equivalent forms.
- Negate fully: \(\forall u\, (Auth(u) \rightarrow \exists r\, Role(u,r))\).
- On \(\mathbb{R}\): truth of \(\forall x\exists y\,(xy=1)\) and \(\exists y\forall x\,(xy=1)\).
- Expand \(\forall n\in\mathbb{N}\, P(n)\) and \(\exists n\in\mathbb{N}\, P(n)\) using \(\rightarrow\) / \(\wedge\).
- Write \(\exists! x\, P(x)\) without the \(!\) symbol.
- Free vs bound: mark variables in \(\forall x\, (P(x,y) \rightarrow \exists y\, Q(y))\).
- Give a \(2\)-element model where \((\exists x\,P)\wedge(\exists x\,Q)\) but not \(\exists x\,(P\wedge Q)\).
Part III — Proofs (write full proofs)
- Direct: If \(a\mid b\) and \(a\mid c\) then \(a\mid (b+c)\).
- Contrapositive or contradiction: If \(n^2\) is odd then \(n\) is odd.
- Contradiction classic: \(\sqrt{2}\) is irrational (full write-up).
- Cases: For all \(n\in\mathbb{Z}\), \(n^2 \not\equiv 3 \pmod{4}\).
- Weak induction: \(\sum_{i=0}^n 2^i = 2^{n+1}-1\) for \(n\ge 0\).
- Weak or strong: \(3 \mid (4^n-1)\) for \(n\ge 0\).
- Strong induction: Every integer \(n\ge 2\) has a prime factor.
- Existence constructive: Exhibit witnesses for \(\exists x,y\in\mathbb{Z}\, (3x+5y=1)\) or prove impossible.
- Biconditional: \(n\) even iff \(n+1\) odd (both directions).
- Loop invariant sketch: For a loop that sets
s += ifori=1..n, state \(I\), init, maintain, exit use.
Part IV — Fallacies (identify & refute)
- Affirming the consequent—give formal shape and a CS-flavored counterexample.
- Illicit \(\forall\exists \Rightarrow \exists\forall\)—counter-model on \(\mathbb{Z}\).
- Proof by example for a universal claim—why invalid?
- Horses fallacy—where does the step fail?
- From \(p\rightarrow q\) infer \(\neg p \rightarrow \neg q\)—name and counter-assignment.
- Circular reasoning vs legitimate inductive hypothesis—one paragraph.
- False dichotomy in a case proof—invent a broken outline and fix it.
Part V — Mixed synthesis
- Prove by induction on \(n\) that a set with \(n\) elements has \(2^n\) subsets (outline OK if full algebra clear).
- Negate the \(\varepsilon\)-\(N\) limit definition form \(\forall\varepsilon>0\,\exists N\,\forall n\ge N\,(|a_n-L|<\varepsilon)\).
- Choose methods: for each claim, pick direct / contra / cases / induction and justify in one line:
- sum formula; (b) no largest integer; (c) \(n(n+1)\) even; (d) if \(6\mid n\) then \(2\mid n\).
- sum formula; (b) no largest integer; (c) \(n(n+1)\) even; (d) if \(6\mid n\) then \(2\mid n\).
- Boolean: put \((p \rightarrow q) \wedge p\) into simplest equivalent form.
- Translate sorted nondecreasing array of length \(n\) with nested quantifiers.
- Explain vacuous truth of \(\forall x\in\emptyset\, P(x)\) in one sentence.
- Functional completeness awareness: express \(p\vee q\) using only \(\neg\) and \(\wedge\).
- Portfolio reflection: list three skills from Days 23–33 you will drill this week.
Scoring guide (self)
| Score band | Meaning | Action |
|---|---|---|
| ≥ 34/40 solid | Stage III ready | Proceed to Day 35 |
| 26–33 | Patch holes | Retake failed numbers cold in 48h |
| ≤ 25 | Rebuild | Revisit Days 23–27 then 28–33; retake full gate |
Count a multi-part proof item as split if needed (e.g. ½ for structure without algebra). Honesty > speed.
Optional deep extras (if clean early)
- Prove Cassini’s Fibonacci identity for \(n\ge 1\) (state indexing).
- Full loop invariant proof sketch for Euclid’s algorithm.
- Show \(\{\mathrm{NAND}\}\) can express \(\neg\) and \(\wedge\) (formulas).
- Prove \(\log_2 3\) irrational.
- Structural induction: \(\mathrm{len}(xs{+\!\!+}ys)=\mathrm{len}(xs)+\mathrm{len}(ys)\).
CS connection (gate lens)
- Specs are quantified implications; tests seek counterexamples to \(\forall\).
- Refactors need \(\equiv\), not “looks similar.”
- Invariants are induction; fallacies are production incidents waiting to happen.
- Stage IV sets/relations will encode more of the same logic with \(\in\) and \(\subseteq\).
Common pitfalls (gate day)
| Pitfall | What to do instead |
|---|---|
| Open book too early | Close it for pass 1 |
| Sketchy proofs without witnesses | Exhibit \(k\) in parity/divisibility |
| Forgetting to negate nested quantifiers fully | Flip each quantifier |
| Method name without proof body | Write the proof |
| Skipping fallacy counterexamples | Always refute |
Checkpoint
- Self-check sheet reproduced from memory
- Warm-ups A–J attempted cold
- Gate exam Parts I–V scored
- Failed items scheduled for retest
- Three personal weak spots written down
- Ready/not-ready decision for Stage IV
Two takeaways from Stage III:
- …
- …
Extended drill set (still closed book if possible)
Drill A — Tables under time pressure
- Table for \(p\oplus q \oplus r\) (careful association).
- Show \((p\rightarrow q)\rightarrow((\neg p\rightarrow q)\rightarrow q)\) is a tautology.
- Contingency hunt: invent a 3-var formula with exactly 3 true rows.
Drill B — Algebra under time pressure
- Simplify \(\neg(p\wedge\neg(q\vee p))\) fully.
- Prove \(\neg(p\leftrightarrow q)\equiv p\leftrightarrow\neg q\).
- Put \(p\rightarrow(q\wedge r)\) into CNF.
Drill C — Quantifier battery
- Negate \(\exists x\forall y\exists z\, R(x,y,z)\).
- Translate and negate: “Every nonempty file has a checksum.”
- On \(\mathbb{N}\): \(\forall m\exists n\,(n>m)\) vs \(\exists n\forall m\,(n>m)\).
- Write \(\exists!\) for “unique root of \(x^2-1=0\) in \(\mathbb{R}\)”—is it true? (No—two roots.)
Drill D — Proof battery
- Direct: product of two odds is odd.
- Contrapositive: if \(n^2\) not divisible by \(2\) then \(n\) not divisible by \(2\).
- Contradiction: no largest negative integer? (false claim)—instead: no largest positive integer.
- Cases: \(n^2\equiv 0\) or \(1\pmod 4\).
- Induction: \(\sum_{i=1}^n (2i-1)=n^2\).
- Strong: every \(n\ge 2\) composite or prime—trivial; instead every \(n\ge 2\) has prime factor.
- Invariant: state \(I\) for
while n > 0: n = n-1; c = c+1counting down.
Drill E — Fallacy battery
58–62. Invent five one-line fallacious inferences and name them.
Repair plan template
| Failed # | Topic day | Minutes drill | Retest date |
|---|---|---|---|
Full sample solution outlines (check after attempt)
Item 18 outline (\(\sqrt{2}\)): assume \(p/q\) lowest terms → \(p^2=2q^2\) → \(p\) even → \(q\) even → contradict gcd.
Item 20 outline (geometric): base \(n=0\); IH sum to \(k\); add \(2^{k+1}\).
Item 22 outline (prime factor): strong IH on smaller factors if composite.
Item 26 outline (fallacy): \(P\rightarrow Q\), \(Q\), infer \(P\)—counter-model \(P\) false \(Q\) true.
Stage III exit criteria
You are ready for Stage IV when you can, cold:
- Finish a 4-row and sketch an 8-row table.
- Negate a two-quantifier sentence without hesitation.
- Write direct, contrapositive, and induction proofs to a peer standard.
- Name and refute three fallacies.
Timed mock (45 minutes)
Do only these, closed book, then stop:
| # | Task | Minutes |
|---|---|---|
| M1 | Table \((p\rightarrow q)\leftrightarrow(\neg q\rightarrow\neg p)\) | 6 |
| M2 | Simplify \(\neg(p\vee\neg q)\wedge p\) | 4 |
| M3 | Negate \(\forall x\exists y\,(P(x)\rightarrow Q(x,y))\) | 5 |
| M4 | Direct: even+even=even | 5 |
| M5 | Contrapositive: odd square ⇒ odd \(n\) | 6 |
| M6 | Induction: \(\sum_{i=1}^n i = n(n+1)/2\) | 8 |
| M7 | Name fallacy: \(P\rightarrow Q\), \(Q\), therefore \(P\) | 2 |
| M8 | \(\forall\exists\) vs \(\exists\forall\) counter-model on \(\mathbb{Z}\) | 5 |
| M9 | Cases: \(n^2\not\equiv 3\pmod 4\) | 4 |
Pass bar: \(\ge 7/9\) solid. Below that: schedule full gate retake.
After mock reflection prompts
- Which item was slowest?
- Did you skip naming laws in algebra?
- Did induction include an explicit \(P(n)\)?
- Did quantifier negation flip every quantifier?
Second-pass protocol
- Only reopen notes for ❌ items.
- Write a correct solution once with notes.
- Next day, redo ❌ cold without notes.
- Log time-to-completion.
Synthesis — Stage III portfolio
Gate III is not a new topic day; it is a compression of Days 23–33. Treat this synthesis as your one-page mental model before and after the exam.
Skill clusters (what “ready” means)
| Cluster | Cold ability |
|---|---|
| Propositional | 4–8 row tables; simplify with named laws; \(\rightarrow\) as \(\neg p\vee q\) |
| Quantifiers | Translate all/some/no; negate nested; \(\forall\exists\neq\exists\forall\) |
| Proof methods | Direct, contra, contrapositive, cases, weak/strong induction |
| Invariants | Init / maintain / exit+use in one paragraph |
| Fallacies | Name, counter-model, repair |
Method choice drill (answer in one line each)
- \(\sum_{i=1}^n i = n(n+1)/2\) →
- If \(n^2\) even then \(n\) even →
- \(n(n+1)\) always even →
- \(\sqrt{2}\notin\mathbb{Q}\) →
- No largest integer →
- Every \(n\ge 2\) has a prime factor →
- Product of odds is odd →
- \((p\rightarrow q)\wedge p\) simplifies to →
(Expected style: induction; contrapositive; cases/parity; contradiction; contradiction; strong induction; direct; \(p\wedge q\).)
Mini repair log (use after scoring)
| Item # | Failure mode | Day to reread | Retest (Y/N) |
|---|---|---|---|
| wrong \(\rightarrow\) expansion | 23–25 | ||
| quantifier negation incomplete | 26–27 | ||
| missing witness in direct proof | 28 | ||
| lowest terms omitted in \(\sqrt{2}\) | 29 | ||
| incomplete cases | 30 | ||
| vague \(P(n)\) / horses | 31–32 | ||
| fallacy without counter-model | 33 |
More mixed warm-ups (post-exam or second pass)
W1. Negate \(\forall\varepsilon>0\,\exists N\,\forall n\ge N\,(|a_n-L|<\varepsilon)\) fully.
W2. Prove: if \(a\mid b\) and \(a\mid c\) then \(a\mid(bx+cy)\) for all integers \(x,y\).
W3. Cases: \(n^2\equiv 0\) or \(1\pmod 4\).
W4. Induction: \(\sum_{i=0}^n 2^i = 2^{n+1}-1\).
W5. Fallacy: from “if sorted then binary search OK” and “binary search returned index” infer “sorted.”
Exit criteria (restate)
You may enter Stage IV when, without notes, you can: finish a small truth table; negate a two-quantifier sentence; write direct + contrapositive + induction proofs to peer standard; name and refute three fallacies. Honesty over speed—retest beats pretend-ready.
Tomorrow
Day 35 — Sets. Roster and builder notation; \(\in\), \(\subseteq\), \(\subsetneq\); empty set; universe; Russell paradox awareness; equality by double inclusion.