CS Atlas GATE 2027
TOC course
0 / 91 complete

TOC/Phase 1 · Finite Automata

Chapter review L1.2 · Item 23 of 91

NFA

Read at your own pace. Try the questions before opening the answers.

On this page

Chapter recap

NFAs allow 0, 1 or many moves per symbol (δ : Q × Σ → P(Q)); a string is accepted if some path ends in F. ε-NFAs also allow moves on ε; ECLOSE(q) collects ε-reachable states, taken at the start and after every symbol. DFA, NFA and ε-NFA accept exactly the same languages (the regular ones). The subset construction turns an n-state NFA into a DFA with ≤ 2ⁿ (reachable) subset-states; the bound is tight for “k-th from the end”. Swapping F complements DFAs (complete ones) but not NFAs.

Merged rule card

From 1.2.1 Nondeterminism and the NFA

  • NFA: δ : Q × Σ → P(Q); moves may be 0, 1, many.
  • Accept iff some path ends in F ⇔ δ̂(q₀, w) ∩ F ≠ ∅. Track the set of active states.
  • DFA ⊆ NFA; NFAs accept exactly the regular languages.
  • No dead state needed. Swapping F does NOT complement an NFA.

From 1.2.2 ε-NFA and ε-closure

  • ε-NFA: δ : Q × (Σ ∪ {ε}) → P(Q).
  • ECLOSE(q) = ε-reachable states incl. q (graph reachability on ε-edges).
  • Run: start ECLOSE(q₀); each symbol: move, then ECLOSE. Accept iff final set ∩ F ≠ ∅.
  • Same power as DFA/NFA; great for wiring machines together.

From 1.2.3 Subset construction and the 2ⁿ blow-up

  • Subset construction: start {q₀} (or ECLOSE(q₀)); δ(S,a) = ⋃ δ(q,a) (then ECLOSE); accept iff S ∩ F ≠ ∅; ∅ = dead state.
  • ≤ 2ⁿ states; count only reachable sets.
  • ε-removal: δ'(q,a) = ECLOSE(δ(ECLOSE(q), a)); F' = {q : ECLOSE(q) ∩ F ≠ ∅}.
  • k-th from end is 1: NFA k+1, DFA 2ᵏ. k-th from start: DFA k+2.
  • DFA ≡ NFA ≡ ε-NFA in power.

Practice questions

  1. NAT

    Minimal DFA for strings over {a,b} whose 2nd symbol from the end is a?

    Write your answer before opening the key.

  2. MCQ

    Which machine model can complement its language just by swapping accepting states (after completion)?

    1. NFA
    2. ε-NFA
    3. DFA
    4. none
  3. MSQ

    ε-NFA: 1 ─ε→ 2, 2 ─a→ 3, 3 ─ε→ 1, F = {3}. Which strings are accepted?

    1. ε
    2. a
    3. aa
    4. aaa
  4. NAT

    An NFA has 5 states. Maximum possible number of states of the subset-construction DFA?

    Write your answer before opening the key.

  5. MCQ

    Removing ε-moves from an ε-NFA with n states gives an NFA with:

    1. n states
    2. 2ⁿ states
    3. n + 1 states
    4. n² states
  6. NAT

    NFA over {0,1} for “ends with 101” has a minimal number of states equal to?

    Write your answer before opening the key.

  7. MSQ

    Which are equal in power?

    1. DFA
    2. NFA
    3. ε-NFA
    4. DFA with two accepting states
  8. MCQ

    Subset construction on an NFA where q₀ has a self-loop on every symbol: can ∅ appear as a DFA state?

    1. Yes, always
    2. No, q₀ is always active
    3. Only if F is empty
    4. Only for ε-NFAs

Answer key

Reveal answers when you’re ready
  1. 4 — 2².
  2. C — Determinism: one run, one final state.
    • A: Multiple paths break it.
    • B: Same issue.
    • D: DFAs can.
  3. BCD — Language a⁺.
    • A: ECLOSE(1) = {1,2}, no accepting state.
  4. 32 — 2⁵.
  5. A — Same states, new transitions and accepting set.
    • B: That is the DFA bound.
    • C: No new states needed.
    • D: No.
  6. 4 — q0 (loop), then 1, 0, 1 → k + 1 = 4.
  7. ABCD — All accept exactly the regular languages.
  8. B — Every reachable set contains q₀.
    • A: q₀ stays active.
    • C: Unrelated.
    • D: Unrelated.

Ready for the next idea?

Mark this item complete when you’ve finished reading and working through it.