Week 02 · Sipser 1.2 · Part I

Nondeterminism, and what it costs

Exactly two things changed from the DFA: an = became an ∈, and the input may be padded with ε. Everything below follows from those two — including the fact that determinising can cost you an exponential number of states.

State diagram

Every state the machine could currently be in is highlighted at once. Write eps on an arrow for an ε-move.

Run one string — watch the set

Step through and watch the active set branch and merge.

Subset construction — Theorem 1.39

The first row is q₀′ = E({q₀}) — the ε-closure, not just the start state. That off-by-one-row is the single commonest mistake in this construction.

Formal description

Same syntax as the DFA page, plus eps for an ε-move: q1 eps -> q2.

Machine at a glance

Careful

You cannot complement an NFA by flipping its accept states. One string can have an accepting and a rejecting computation at the same time. Try it: load an example, flip the accept set, and watch a string stay accepted. Determinise first.

Why the blow-up is real

Load the 2ⁿ blow-up example — an NFA for "the 4th symbol from the right is 1" with five states — and determinise it. You will get 16 states, and no smaller DFA exists: the 2⁴ strings of length 4 must all lead to different states, because for any two of them there is a suffix that one accepts and the other does not. That argument is the content of Sipser Problem 1.65, and it is the reason nondeterminism is worth having even though it adds no power.