WHY is this possible at all? Because both NFA and DFA recognise exactly the regular languages — they have equal power. The NFA is just more convenient to write; the DFA is more mechanical to run.
NFA over Σ={a,b}, states {q0,q1}, start q0, final {q1}:
δN(q0,a)={q0,q1}, δN(q0,b)={q0}, δN(q1,b)={q1}.
(This accepts strings containing an a followed eventually by a b… let's just build it.)
DFA state
on a
on b
A={q0} (start)
{q0,q1}=B
{q0}=A
B={q0,q1} (accept)
{q0,q1}=B
{q0,q1}=B
Why AaB? MOVE({q0},a)={q0,q1}, no ε so ECLOSE leaves it. New state → call it B.
Why is B accepting?B∩F={q0,q1}∩{q1}={q1}=∅. ✔
Why BbB? MOVE({q0,q1},b)={q0}∪{q1}={q0,q1}=B.
Only 2 of the possible 22=4 subsets are reachable — we never list unreachable ones.
NFA: states {0,1,2}, start 0, final {2}, Σ={a}.
δ(0,ε)={1}, δ(1,a)={2}, δ(2,ε)={1}.
Step 1 — start:q0′=ECLOSE({0})={0,1}.
Why? From 0 an ε-edge goes to 1; from 1 none. Call this A={0,1}.
Step 2 — A on a: MOVE({0,1},a)={2} (only 1 has an a-edge). Then ECLOSE({2})={2,1}={1,2} (the ε-edge 2→1). Call B={1,2}.
Step 3 — B on a: MOVE({1,2},a)={2}, ECLOSE → {1,2}=B. Self-loop.
DFA state
on a
accept?
A={0,1} (start)
B
{0,1}∩{2}=∅ → no
B={1,2}
B
contains 2 → yes
So the DFA accepts a,aa,aaa,… i.e. a+. Trace "aa": AaBaB (accept). ✔ Trace "" : stays at A, reject. ✔
Recall Feynman: explain to a 12-year-old
Imagine a maze where, at some forks, a magic robot can split into copies and try every path at once. That's the NFA. A normal robot (DFA) can't split — it walks one path. So instead, the normal robot carries a notebook listing "all the rooms a magic robot could be standing in right now." Each time it reads a letter, it updates the whole list at once. If any room on the list is an exit, it shouts "Accepted!" The notebook's contents = one DFA state. Since there are only finitely many possible lists of rooms, the robot can never get lost forever.
Dekho, NFA ka kaam hota hai "guess" karna — ek hi waqt mein woh kai states mein ho sakta hai, jaise koi robot maze mein khud ki copies bana ke saare raste ek saath try kare. Par DFA bechara ek hi state mein reh sakta hai, koi splitting nahi. Toh sawaal yeh hai: DFA NFA ko copy kaise kare? Jugaad simple hai — DFA ki ek state ko banao NFA ki states ka ek poora set. Matlab agar NFA abhi {q1,q3} mein ho sakta hai, toh DFA ki ek single state ka naam hi {q1,q3} rakh do. Isi liye ise subset (powerset) construction kehte hain.
Do tools yaad rakho. ECLOSE matlab epsilon-closure — bina koi letter padhe, sirf ε-edges se jahan-jahan pahunch sakte ho. MOVE(S,a) matlab set S ke har state se letter a padh ke jahan jaate ho. Har step ka formula hai δD(S,a)=ECLOSE(MOVE(S,a)) — pehle MOVE, phir ECLOSE, har baar. Start state hota hai ECLOSE({q0}) (kyunki shuru mein hi NFA chupke se ε-edges se khisak sakta hai). Aur koi DFA-state accept tab hoti hai jab uske andar koi bhi NFA final state ho, yaani S∩F=∅.
Yeh kyun important hai? Kyunki NFA likhna aasan hota hai par chalane mein "guessing" lagti hai. DFA mechanical aur fast hota hai — har step pe seedha ek hi state. Subset construction proof hai ki NFA aur DFA dono same regular languages pehchante hain. Ek dhyaan ki baat: kabhi bhi shuru mein 2n saare subsets mat banao — sirf woh subsets banao jo start se reachable hain, warna time waste. Aur agar MOVE khaali set de de, toh woh dead state (∅) ban jaata hai jo apne aap pe loop kare aur reject kare. Mantra yaad rakho: "START pe CLOSE, phir MOVE-then-CLOSE, final ko TOUCH karo toh accept."