Nondeterministic finite automaton Created 2026-09-24 Updated 2026-10-14
A nondeterministic finite automaton allows a set of possible destinations for each automaton state and input symbol. Without the extra moves permitted in an Epsilon-NFA, replace the DFA function by , where is the power set. A word is accepted when at least one path consumes all its symbols and ends in an accepting automaton state. These choices express existential quantification, not probability: no chance of choosing a particular path is assigned. One successful path suffices even if other paths fail.
Consider a three-state NFA accepting exactly the words of binary digits ending in . Its initial automaton state loops on both and ; it also has an automaton transition , followed by . Only is accepting, and all unlisted automaton transitions are absent. Staying at skips an arbitrary beginning; leaving it guesses that the current zero starts the final two symbols.
The word accepts along . The word accepts along . The word rejects: a path reaching after cannot consume the remaining zero, while the other paths end outside . Thus finding somewhere is insufficient; it must occur at the end.
To simulate the NFA deterministically, retain the set of all currently possible automaton states. The powerset construction updates by taking the union of the destinations of its members. Here only , , and are reachable, although the full power set has eight members. Reading gives , which rejects. In general, an -state NFA yields a DFA with at most automaton states. Nondeterminism can simplify a description, while the powerset construction keeps the memory finite.
The second generator checks all 511 words of up to eight binary digits against the direct test of whether their final two symbols are . Exactly 127 accept, and only the three listed sets of automaton states occur. In particular, the empty word rejects for this NFA.
Michael O. Rabin and Dana Scott's 1959 paper studied finite-state machines as recognizers with finite internal memory. Its section 5 defines NFAs through successful paths, and theorem 11 proves their equivalence to DFAs by the powerset construction. This gives a historical source for the distinction between many possible paths and greater recognition power: [ref]
https://www.cs.cmu.edu/~lblum/flac/Handouts_pdf/rs.pdf. Rabin and Scott, Finite Automata and Their Decision Problems, pp. 120–121
. Past exam of the mathematics course of the University of Cambridge 2013 iii Paper 20 1 Solution Created 2026-10-03 Updated 2026-10-07
Fix a finite alphabet . A regular expression is built recursively from , , and the letters , using union, concatenation, and Kleene star. Its interpretation is a formal language: the basic expressions denote , , and , while , , and denote , , and all finite concatenations of members of , including the empty concatenation. In particular, and are different expressions with different meanings.
Kleene theorem identifies exactly the languages described by regular expressions with those recognized by finite-state automata. Start with a deterministic finite automaton (DFA) having states , initial state , accepting set , and transition function . Let describe paths from to whose internal states lie among . At stage zero use the union of letters labelling direct transitions from to , with added if ; use if there are no such possibilities. Define the finite-state path expressions recursively byA path either avoids internally or decomposes at its visits to : an initial piece into , any number of return pieces at , and a final piece out. Each piece has no internal occurrence of . This proves the recursion by induction, including paths with or , where empty pieces are permitted. Thusis a regular expression for the DFA's accepted formal language. An empty accepting set gives the expression . This is the path form of state elimination for finite automata.
A nondeterministic finite automaton (NFA) replaces a single successor state by a set of possible successors. It accepts if there exists an accepting run with and . Rejection means that no accepting run exists, rather than that some run rejects. For an Epsilon-NFA, transitions labelled consume no symbol; acceptance means a path whose non-epsilon labels spell . In particular, acceptance of the empty word is tested using the epsilon closure of the initial state.
The same Kleene theorem holds for nondeterministic finite automata. For an NFA without epsilon transitions, the powerset construction has state set , initial state , transition on letter , and accepting subsets meeting . Induction on word length shows that its state is exactly the set of possible current NFA states. For an Epsilon-NFA, start from , where is epsilon closure, and useThis subset construction with epsilon transitions preserves the accepted formal language and gives a DFA with at most states. The already proved direction of Kleene theorem therefore gives a regular expression for every NFA language.
For the converse, recursively construct an Epsilon-NFA with a designated initial state and final state for a regular expression. Use two states with no connecting path for , one epsilon edge for , and one edge labelled for . Keep component state sets disjoint. Union uses a fresh initial state with epsilon edges into both components, and epsilon edges from their finals to a fresh final. Concatenation joins the first final to the second initial by an epsilon edge. For Kleene star, use fresh initial and final states, an epsilon edge directly between them for zero iterations, an edge into the old initial, and epsilon edges from the old final both back to the old initial and out to the new final. Each construction has exactly the intended union, concatenation, or iteration semantics. Induction on the regular expression proves correctness; the subset construction with epsilon transitions then gives a DFA. This proves both directions of Kleene theorem.
Past exam of the mathematics course of the University of Cambridge 2018 ii Paper 2 4G c Solution Created 2026-09-24 Updated 2026-10-03
A word is accepted by the Epsilon-NFA precisely whenBy part (b), this reached subset is exactly , and by the definition of the intersection condition is equivalent to . Hence
