4.6.3 · HinglishTheory of Computation

NFA — formal definition, epsilon transitions

1,894 words9 min readRead in English

4.6.3 · Coding › Theory of Computation


1. Nondeterminism asal mein kya hai?


2. Formal 5-tuple (scratch se banaya hua)

Hum "guessing + free moves wali machine" ko nail down karna chahte hain. Humen minimally kaun se pieces chahiye?

  • States ka ek finite collection → use kaho.
  • Input symbols ki alphabet → .
  • Ek rule jo bataye hum kahan ja sakte hain → transition function .
  • Ek jagah shuru karne ke liye → .
  • Yeh kehne ka tarika ki "tum jeete" → accepting states .

DFA se bass ek twist hai aur woh hai ka output type.


3. ε-closure (free moves handle karne ka tool)

Kyunki ε-moves free hain, koi symbol padhne se pehle/baad machine silently ε-arrows ke saath slide kar sakti hai. Humen free mein reachable saari cheez collect karni hai.

" khud ko shamil karna" kyun? Zero ε-moves allowed hai — tum hamesha "free mein wahi reh" sakte ho.


4. Extended transition (puri string run karna)

ek symbol handle karta hai. Hum ε-moves ko sahi se fold karte hue puri string ke liye rule derive karte hain.

Base case: kuch bhi padhne se pehle, tum wahin ho jahan start se ε-moves le jaati hain.

Inductive step: (string phir symbol ) process karne ke liye:

  1. lo — padhne ke baad states ka set.
  2. Har se, padho: collect karo.
  3. Phir ε-closure lo ( consume karne ke baad free slides).
Figure — NFA — formal definition, epsilon transitions

5. Worked examples


6. Common mistakes (steel-manned)


7. Active recall

Recall Khud test karo (answers chhupao)
  • Ek NFA ke ka output type kya hai? → , states ka ek set.
  • NFA ko kab accept karta hai? → koi ek path: .
  • ko mein kyun shamil karte hain? → zero ε-moves allowed hain.
  • Kya hai? → Nahi.
  • Kya NFAs DFAs se zyada powerful hain? → Nahi; same language class (regular).
What is the formal 5-tuple of an NFA?
with .
How does an NFA's differ from a DFA's?
NFA returns a set () and allows in its domain; DFA returns a single state and has no .
Define ε-closure of a state .
All states reachable from by zero or more ε-transitions, including itself.
When does an NFA accept a string ?
When — at least one reachable state is accepting.
What is the base case of ?
.
Write the inductive step of .
.
Is a member of ?
No; ε only appears in 's domain as .
What does mean in an NFA?
That branch dies on ; it is not an error, other branches may still accept.
Are NFAs strictly more powerful than DFAs?
No — both recognize exactly the regular languages.
Recall Feynman: ek 12-saal ke bachche ko explain karo

Socho tum ek maze game khel rahe ho aur kuch doors par tum khud ko clone karke copies ko ek saath kai hallways mein bhej sakte ho. Kuch doors toh secret slides hain jo ek clone ko instantly move kar deti hain bina ek step use kiye (woh hai ε-move). Tum jeet jaate ho agar tumhari koi bhi copy treasure room tak pahunch jaaye. Tumhe saari copies ki zarurat nahi — sirf ek lucky clone kaafi hai. Ek NFA exactly yahi game khelti hai, jahan ek word ke letters steps hain.

Connections

  • DFA — formal definition — deterministic special case ( singletons return karta hai, koi ε nahi).
  • Subset Construction (NFA to DFA) — prove karta hai NFA = DFA in power.
  • Regular Languages — exactly woh languages jo NFAs/DFAs accept karte hain.
  • Regular Expressions — Thompson's construction regexes se ε-NFAs banata hai.
  • Closure Properties of Regular Languages — union/concat/star ε-NFAs se aasaani se design kiye jaate hain.

Concept Map

relaxed into

based on

power 1

power 2

formalized as

contains

requires output

returns

adds to input

handled by

acceptance rule

equivalent to DFA accepts

DFA rigid one target

NFA nondeterministic

Nondeterminism guessing

Multiple targets set

Epsilon-moves free

Transition function delta

Power set P of Q

5-tuple Q Sigma delta q0 F

Accept if one path wins

Epsilon-closure

Regular languages