MIT 18.404 — Lecture 2
Nondeterminism, Closure Properties, Regular Expressions
§ Nondeterministic Finite Automata
We first introduce a new variant of finite automata: the nondeterministic finite automata (or NFA).

In spirit, it's a finite automaton that allows processes to fork; if any process ends at an accept state, the automaton accepts.
Definition. A nondeterministic finite automaton is a finite automaton with the following alterations:
A state can have multiple outward edges with the same label.
An outward edge can have the empty string as a label. (Traversing such an edge is free.)
Formally, the distinction is simply that the transition function is now (where ).
Remark. There's an important note about both NFAs and DFAs that should be explained explicitly now.
Sometimes, you might read in a character while at a state with no outgoing edge with label . In such a case, you go to a dead state, meaning the string is automatically rejected.
This is true even if the state you are at is the accept state. It is because of this that is a regular language, for example.
Example. In the example above:
If reads in , then the end state could be any of . Since is an accept state, accepts .
If reads in , then the end state could be any of . So rejects .
If reads in , then the end state could be any of . So rejects .
It turns out, very importantly, that NFAs and DFAs are just different expressions of the same thing.
Theorem. (NFA Implies DFA) A language is recognized by some DFA if and only if is recognized by some NFA.
Proof: If is recognized by some DFA , then is recognized by the same FA if interpreted as an NFA.
Meanwhile, if is recognized by some NFA , then we can design a DFA that recognizes by taking to hold one state for each subset of the set of states of . Details omitted; it's not very nontrivial.
So although it feels that nondeterminism allows for more generality than determinism… it actually changes nothing! The upshot, of course, is that in a lot of contexts, NFAs are much easier to construct than DFAs.
§ Regular Expressions are Regular Languages
To demonstrate the strength of NFAs, we'll now use them to prove the following theorem.
Theorem. (Regularness) Every regular expression is a regular language.
It suffices to prove the closure of regular languages under union, concatenation, and star. NFAs do this pretty easily.
(Union Proof)
(Concatenation Proof)
(Star Proof)
And that's all for today.