Introduction
15 questions across Phase 1, weighted like GATE: many minimal-DFA counting questions.
Practice questions
- NAT · 1 mark
Minimal DFA states over {a,b} for strings that start and end with the same symbol (ε excluded, single symbols included)?
Write your answer before opening the key.
- NAT · 2 marks
Minimal DFA states for binary numbers divisible by 10?
Write your answer before opening the key.
- MCQ · 1 mark
How many DFAs with states {p, q}, start p, over Σ = {0} exist?
- 8
- 16
- 4
- 32
- NAT · 1 mark
Minimal DFA states over {a,b}: #a ≡ 1 (mod 3) and #b ≡ 0 (mod 2)?
Write your answer before opening the key.
- MCQ · 2 marks
M accepts strings over {a,b} containing aa (3 states, dead state not needed). Swap its accepting and non-accepting states. The new language is:
- strings containing bb
- strings not containing aa
- strings ending in a
- Σ*
- MSQ · 2 marks
L₁, L₂ regular. Which are guaranteed regular?
- L₁ ∪ L₂
- L₁ ∩ L₂
- L₁ − L₂
- Σ* − L₁
- NAT · 1 mark
Minimal DFA states over {0,1}: 5th symbol from the end is 0?
Write your answer before opening the key.
- MCQ · 1 mark
An NFA rejects w iff:
- some path ends in a non-accepting state
- every path dies or ends in a non-accepting state
- the first path rejects
- w is not empty
- NAT · 2 marks
NFA over {a,b}: q0 ─a→ {q0,q1}, q0 ─b→ {q0}, q1 ─a→ {q2}, q1 ─b→ {q2}, F = {q2}. Reachable subset-construction states?
Write your answer before opening the key.
- MSQ · 1 mark
ε-NFA: s ─ε→ p, s ─ε→ r, p ─a→ p (p accepting), r ─b→ r (r accepting). Which are accepted?
- ε
- aaa
- ab
- bb
- NAT · 2 marks
Unary DFA: cycle 0→1→…→5→0, start 0, F = {1, 3, 5}. Minimal states?
Write your answer before opening the key.
- NAT · 2 marks
Minimal DFA states over {a,b} for strings of length at least 2 whose second symbol is b?
Write your answer before opening the key.
- MCQ · 2 marks
Index of ≡_L for L = { aⁿ : n ≡ 0 (mod 2) or n ≡ 0 (mod 3) }:
- 5
- 6
- 3
- infinite
- MSQ · 2 marks
Which languages have infinite Myhill–Nerode index?
- { aⁿbⁿ }
- { w : |w|ₐ = |w|_b }
- { aⁿbᵐ : n, m ≥ 1 }
- { w : |w|ₐ ≡ |w|_b (mod 2) }
- NAT · 1 mark
Output length of a Moore machine on an input of length 9?
Write your answer before opening the key.
Answer key
Reveal answers when you’re ready
- 5 — Start; first a: (last a ✓ accept, last b); first b: (last b ✓ accept, last a). 1 + 2 + 2 = 5.
- 6 — 10 = 2·5 → 5 + 1 = 6.
- B — 2^(2·1) · 2² = 4 · 4 = 16.
- A: Missed a factor of 2.
- C: Forgot F.
- D: Too many.
- 6 — Grid 3 × 2.
- B — Complete DFA: swapping F gives the complement.
- A: Unrelated.
- C: Unrelated.
- D: Swapping does not accept everything.
- ABCD — Product construction and complement.
- 32 — 2⁵.
- B — Acceptance needs one accepting path.
- A: Another path may accept.
- C: Order of exploration is irrelevant.
- D: Unrelated.
- 4 — {q0}, {q0,q1}, {q0,q1,q2}, {q0,q2}: second from the end is a → 2² = 4.
- ABD — Language a* ∪ b*.
- C: Mixes a and b.
- 2 — Accepts odd lengths.
- 4 — Start, after 1st symbol, accept sink (2nd = b), dead (2nd = a).
- B — Lengths mod 6; accepting residues {0,2,3,4} have no smaller period → 6 classes.
- A: Classes do not merge here.
- C: Need both moduli.
- D: Regular — finite.
- AB — Unbounded comparisons.
- C: a⁺b⁺ is regular.
- D: Only parity: finite.
- 10 — n + 1.