Lesson 6 proves that nondeterminism buys convenience but not power. It states the equivalence theorem and disposes of its trivial direction, then builds the subset construction component by component, including the empty subset as a dead state and the accepting rule people get wrong, the epsilon-closure in the start subset, and the transition rule. It works conversions from a worklist both with and without free moves, proves correctness by induction on the input length, and gives the pigeonhole lower bound showing that the exponential blowup is unavoidable. It ends with the consequences: complementing an NFA in the right order, and deciding emptiness and infiniteness by graph search.
Subject: Theory of Computation · 110 slides · symbolic lesson
Open the interactive version of this deck · Homework for this lesson
Title
Theory of Computation · Lesson 6
Every active set becomes a single state. One construction turns any guessing machine into a deterministic one — and shows the guessing bought convenience, not power.
Objectives
Lesson 5 made machines easy to design by letting them branch. This lesson proves nothing was gained in power, by building the deterministic machine explicitly. By the end you can:
Warm-up
Discussion prompt
Before we open Equivalence of DFAs & NFAs: without looking back, what was the main idea of Nondeterministic Finite Automata, and what could you do by the end of it that you could not do before?
Hint: One sentence for the idea, one for the skill. If the second one is blank, that is the part to revisit.
Answer:
Lesson 5 drops the determinism requirement and lets a machine take several arrows on one symbol, or none at all. It covers the active-set method of running such a machine, acceptance as an existential claim over paths, and the computation tree, then gives the five-tuple with its set-valued transition function, epsilon-arrows and epsilon-closure, and the extended transition function with closures. It closes with guess-and-verify design and the exponential saving in states it can produce, why swapping the accepting set fails to complement an NFA, and what nondeterminism is not.
Section
Section 1
Concept
The two models look very different. One is forced down a single path; the other explores every path at once. The theorem says they recognize exactly the same languages.
equivalence of the models — A language is recognized by some nondeterministic finite automaton if and only if it is recognized by some deterministic one.
\[ \exists N : L = L(N) \quad \iff \quad \exists D : L = L(D) \]
It is worth pausing on how unusual this is. The analogous statement for the machines of Lesson 20 is one of the great open problems of the subject. Here it is simply true, and the proof is a construction.
Counterexample
Discussion prompt
The two models look very different. One is forced down a single path; the other explores every path at once. The theorem says they recognize exactly the same languages.
That is stated as though it always holds. Do one of two things: produce a case where it fails, or say precisely what rules such a case out. "It just does" is not on the menu.
Hint: Hunt at the extremes first — zero, one, negative, empty, equal. If every extreme survives, the reason they survive is the proof.
Intuition
An if-and-only-if needs both directions, but one of them was settled in Lesson 5 without any work.
Every deterministic machine already is a nondeterministic one: wrap each transition value in braces and the definition is satisfied. The active set stays a one-element set forever, so behaviour is unchanged.
\[ \delta_N(q,a) = \{\delta_D(q,a)\} \]
So the whole content of the theorem is the other direction: given a machine that branches, produce one that does not. That is what the rest of this lesson builds.
Analogy
Discussion prompt
Explain One direction is already done by analogy to something with no Theory of Computation in it at all — a queue, a recipe, a map, a bank balance, whatever fits. Then say where your analogy breaks.
Hint: An analogy that never breaks is not an analogy, it is the same idea wearing a hat. Find the seam — that is the part that is actually new.
Answer:
An if-and-only-if needs both directions, but one of them was settled in Lesson 5 without any work.
Concept
The construction rests on a single observation, and everything else is bookkeeping.
At any moment during a run, the nondeterministic machine's situation is completely described by the set of states it could be in. Nothing else about the history matters.
That set is a subset of the state set, and the state set is finite, so there are only finitely many possible situations — exactly as many as there are subsets. Finitely many situations is precisely what a deterministic state set needs to be.
\[ \text{situations} = \mathcal{P}(Q_N), \qquad |\mathcal{P}(Q_N)| = 2^{|Q_N|} \]
Explain it
Discussion prompt
Explain The key idea in one line to a student a year behind you. No notation, no jargon they have not met — and it still has to be true.
Hint: If your explanation needs a symbol they have never seen, you are describing the notation rather than the idea.
Answer:
The construction rests on a single observation, and everything else is bookkeeping.
Intuition
The move is almost too simple to state: take the thing the machine is uncertain about, and make that the new machine's state.
The uncertainty does not disappear. It gets absorbed into the names of the states. A deterministic machine sitting in the state named 'the set containing the first and third states' is deterministically recording exactly what the original was unsure about.
This trick — determinize by making the uncertainty explicit — reappears throughout the subject. It is the same idea that turns a search into a dynamic program.
\[ \text{uncertainty about } Q_N \;\longmapsto\; \text{certainty about } \mathcal{P}(Q_N) \]
Concept
The theorem is a claim about languages, not about machines. Two machines are called equivalent when they agree on every string, without exception.
equivalent machines — Two machines, of any kind, that accept exactly the same set of strings.
\[ M_1 \equiv M_2 \quad \overset{\text{def}}{\iff} \quad L(M_1) = L(M_2) \]
Nothing about shape, size or determinism enters the definition. A two-state machine and a two-hundred-state machine are equivalent if they agree everywhere, and disagreeing on one string of length forty is enough to make them inequivalent.
Ranking
Put in order
Put the moves of Check two machines agree by comparing verdicts into the order they have to happen.
Why: These are the moves of the worked example in the order it makes them, and each one is set up by the one before it. Take the input 101. The deterministic machine walks a single path; the nondeterministic one tracks an active set.
Worked example
Before constructing anything, practise the notion of equivalence on a pair of small machines that both claim to accept the strings ending in 1.
Run both on a string that exercises the choice
Why: Take the input 101. The deterministic machine walks a single path; the nondeterministic one tracks an active set. Both finish in an accepting situation.
\[ \hat{\delta}_D(q_0,101) \in F, \qquad \hat{\delta}_N(q_0,101) \cap F \neq \varnothing \]
Run both on a rejected string
Why: Take 110. The deterministic machine finishes on a non-accepting state; the nondeterministic active set misses the accepting set. They agree again.
Run both on the empty string
Why: Neither accepts it, since neither start situation is accepting. Boundary cases are where inequivalence usually hides, so this is not a formality.
Note what testing cannot establish
Why: Agreeing on three strings is not agreement on all of them. Testing can refute equivalence outright but can never confirm it, which is precisely why the rest of this lesson proves a theorem instead.
Verify that a single disagreement would settle it
Why: Had either machine differed on any one of the three strings, that string alone would prove them inequivalent — no further work needed. Refutation is cheap; confirmation needs the construction and its proof.
\[ \exists w : w \in L(M_1) \;\triangle\; L(M_2) \;\Rightarrow\; M_1 \not\equiv M_2 \ \checkmark \]
Worked example
Before the general definition, watch it happen on the smallest interesting example: a machine over one symbol whose start state has two a-arrows.
Figure (svg): Automaton with states n0, n1
Name the start subset
Why: The run begins with only the start state live, so the deterministic machine's start state is the one-element subset holding it.
\[ s_0 = \{n_0\} \]
Ask where that subset goes on a
Why: Union the a-arrows from every member. The only member has two, so the result is a two-element subset — a new state of the deterministic machine.
\[ \delta_D(\{n_0\}, a) = \{n_0, n_1\} \]
Ask where the new subset goes on a
Why: Union again: the first state contributes both, and the second contributes nothing. The result is the same two-element subset, so no new state appears.
\[ \delta_D(\{n_0,n_1\}, a) = \{n_0,n_1\} \cup \varnothing = \{n_0,n_1\} \]
Mark the accepting subsets
Why: A subset is accepting when it contains at least one accepting state of the original. Only the two-element subset qualifies.
\[ F_D = \{\, \{n_0,n_1\} \,\} \]
Verify the finished machine against the original
Why: The deterministic machine has two states and accepts every nonempty run of a's, rejecting only the empty string. The original accepted exactly the same strings, since one a is enough to put an accepting state in the active set. Four subsets exist in principle, but only two were ever reached.
\[ L(D) = a^{+} = L(N) \ \checkmark \]
Notation
Annotate
From Do the construction by hand on a two-state machine — read this one piece at a time. What is each part doing?
On: \( \delta_D(\{n_0\}, a) = \{n_0, n_1\} \)
Ranking
Put in order
These are the steps of The subset construction, as a procedure, scrambled. Put them back in order before the next slide shows you.
Why: This is the order the recipe itself gives. Recalling the sequence without the slide in front of you is the difference between recognising the method and being able to run it — most of what goes wrong in practice is a step done out of turn.
Pattern
Run it as a worklist. Never enumerate all the subsets in advance — most of them are unreachable.
Working from the worklist is what keeps the construction practical. The exponential in the theorem is a worst case, not a typical one.
Elimination
Eliminate the wrong options
In the subset construction, what does one state of the resulting deterministic machine represent?
3 of these 4 are wrong. Strike them one at a time, and say what rules each one out before you strike the next. The survivor is the answer.
Survives elimination: A
Why: The uncertainty about which state the original occupies is exactly what the new state records. Making that set the unit of bookkeeping is what removes the branching, since a set has a single well-defined successor on each symbol.
Check
Think about what the new machine's states are named after.
Check your understanding
In the subset construction, what does one state of the resulting deterministic machine represent?
Answer: A
Why: The uncertainty about which state the original occupies is exactly what the new state records. Making that set the unit of bookkeeping is what removes the branching, since a set has a single well-defined successor on each symbol.
Section
Section 2
Concept
Given a nondeterministic machine, define a deterministic one over the same alphabet, one component at a time.
| Component | Definition |
|---|---|
| states | the subsets of the original state set |
| alphabet | unchanged |
| transition | union the transitions of every member |
| start | the subset holding the original start state |
| accepting | the subsets meeting the original accepting set |
\[ Q_D = \mathcal{P}(Q_N), \qquad |Q_D| = 2^{|Q_N|} \]
Comparison
Comparison matrix
From The five components of the new machine: refill the Definition column from what you know. The rest of the table is as it appeared.
| Component | Definition |
|---|---|
| states | the subsets of the original state set |
| alphabet | unchanged |
| transition | union the transitions of every member |
| start | the subset holding the original start state |
| accepting | the subsets meeting the original accepting set |
Concept
The transition function of the new machine is the active-set update rule of Lesson 5, promoted to a definition.
\[ \delta_D(S,a) \;=\; \bigcup_{p \in S} \delta(p,a) \quad \text{(no free moves)} \]
This is a genuine function: given a subset and a symbol, the union is one specific subset. Nothing is left to choose, so the new machine is deterministic by construction.
Note that it is total as well. If the union comes out empty, the empty subset is still a perfectly good state of the new machine — it is the state meaning 'every branch has died'.
\[ \delta_D(\varnothing, a) = \varnothing \]
Concept
The subset with no members deserves a moment, because it is where the two models' differences go to be resolved.
The original machine could get stuck, with no arrow to follow. The new machine never gets stuck: it moves into the empty subset and stays there, since a union over no members is empty.
The empty subset contains no accepting state, so it is not accepting. It loops to itself on every symbol. That is exactly the dead state of Lesson 4, arrived at by construction rather than by hand.
\[ \varnothing \notin F_D \quad\text{and}\quad \delta_D(\varnothing,a) = \varnothing \]
Anomaly
Predict first
A student writes this, and it looks reasonable:
In the determinized machine, which subsets belong in the accepting set?
It is wrong. Say what breaks — and say it before you turn the page.
Correct: A subset ought to count as accepting when the subset itself 'is' accepting — so require every member of it to be an accepting state of the original.
In the determinized machine, which subsets belong in the accepting set?
Why: A subset ought to count as accepting when the subset itself 'is' accepting — so require every member of it to be an accepting state of the original.
Trap
In the determinized machine, which subsets belong in the accepting set?
Take the subsets made entirely of accepting states
Why: A subset ought to count as accepting when the subset itself 'is' accepting — so require every member of it to be an accepting state of the original.
\[ F_D = \{\, S \;:\; S \subseteq F \,\} \]
Apply it to a mixed subset
Why: A subset holding one accepting and one non-accepting state fails the test, so it is rejected — and every string reaching it is rejected too.
\[ \{q_0, q_2\} \not\subseteq \{q_2\} \;\Rightarrow\; \text{reject} \]
In the determinized machine, which subsets belong in the accepting set?
Take the subsets that CONTAIN at least one accepting state
Why: The subset records the states the original could be in. The original accepts when SOME branch is accepting, so the subset must be accepting the moment a single member is.
\[ F_D = \{\, S \;:\; S \cap F \neq \varnothing \,\} \]
Apply it to the same mixed subset
Why: The mixed subset meets the accepting set, so it is accepting — which is right, since the branch sitting on the accepting state is a genuine accepting path.
\[ \{q_0, q_2\} \cap \{q_2\} \neq \varnothing \;\Rightarrow\; \text{accept} \ \checkmark \]
Notation
Annotate
From Trap: which subsets count as accepting — read this one piece at a time. What is each part doing?
On: \( \{q_0, q_2\} \cap \{q_2\} \neq \varnothing \;\Rightarrow\; \text{accept} \ \checkmark \)
Concept
If the original has ε-arrows, two of the five components change, and both changes are the same idea: saturate before you look.
The start subset is the ε-closure of the original start state, not the bare start state.
\[ s_0 = E\big(\{q_0\}\big) \]
And the transition rule closes after unioning, so no free move is ever missed.
\[ \delta_D(S,a) \;=\; E\!\left(\bigcup_{p \in S} \delta(p,a)\right) \]
Nothing else changes. The accepting rule is untouched, because closure has already put every freely reachable state into the subset before the test is applied.
Intuition
A determinized machine can look opaque, because its states are named after sets. Saying the names out loud fixes that immediately.
The state named after a two-element subset means: 'the original could be in either of these two right now'. The state named after the empty subset means: 'every branch has died'. Those readings are the whole semantics.
Once the names are read this way, the finished machine usually turns out to be a machine you could have designed by hand — with the subsets standing for exactly the facts a Lesson 4 design would have tracked.
\[ \{q_0,q_1\} \;\longleftrightarrow\; \text{'could be at the start, or one step in'} \]
Concept
Four of the five components are defined uniformly over all subsets. The start is the exception, and it is where ε-arrows first bite.
Without free moves the start subset is simply the one-element subset holding the original start state. With them it is that state's closure, which may be much larger.
\[ s_0 = E\big(\{q_0\}\big) \;\supseteq\; \{q_0\} \]
This is also what makes the base case of the correctness proof work. Getting the start subset wrong is the single most common construction error, and it shows up first on the empty string.
Prediction
Predict first
When determinizing a machine that has ε-arrows, where must ε-closure be applied?
Answer it in your own words, now, with nothing to choose from. The options are on the next slide — and picking the right one off a list is an easier skill than producing it.
Correct: To the start subset, and to the union after every symbol
Why: Free moves may be taken at any moment, including before the first symbol and after every later one. Closing in both places is what guarantees the constructed state always equals the original's true active set.
Check
Think about where a closure has to be applied.
Check your understanding
When determinizing a machine that has ε-arrows, where must ε-closure be applied?
Answer: A
Why: Free moves may be taken at any moment, including before the first symbol and after every later one. Closing in both places is what guarantees the constructed state always equals the original's true active set.
Pattern
The same worklist, with two closures inserted. Say 'close, read, close' at every step.
If a machine has no ε-arrows, every closure is the identity, so this procedure is the earlier one. There is no need to remember two constructions.
Section
Section 3
Picture it
Figure (svg): Automaton with states q0, q1, q2
Discussion prompt
Read the picture before the words. What is this showing, and what is the one thing it is built to make obvious? Commit to an answer, then read on.
Hint: Name the parts, then say what changes between them — and if nothing changes, say what is being held still.
Answer:
Determinize this three-state machine. There are no ε-arrows, so every closure is trivial.
Worked example
Determinize this three-state machine. There are no ε-arrows, so every closure is trivial.
Figure (svg): Automaton with states q0, q1, q2
Write the original's set-valued table first
Why: This is the lookup table every later step consults, so getting it right once saves all the later work.
| δ | 0 | 1 |
|---|---|---|
| -> q0 | {q0, q1} | {q0} |
| q1 | {} | {q2} |
| * q2 | {} | {} |
Start from the subset holding the start state
Why: Union the rows of its single member for each symbol. Both results are new subsets, so both go on the worklist.
\[ \delta_D(\{q_0\},0) = \{q_0,q_1\}, \qquad \delta_D(\{q_0\},1) = \{q_0\} \]
Process the two-element subset by unioning both members' rows
Why: On 0 the first member gives both states and the second gives nothing. On 1 the first gives the start state and the second gives the accepting state.
\[ \delta_D(\{q_0,q_1\},0) = \{q_0,q_1\}, \qquad \delta_D(\{q_0,q_1\},1) = \{q_0,q_2\} \]
Process the subset containing the accepting state
Why: On 0 the start state gives both and the accepting state gives nothing. On 1 the start state gives itself and the accepting state gives nothing. No new subsets appear, so the worklist empties.
| subset | 0 | 1 |
|---|---|---|
| -> {q0} | {q0,q1} | {q0} |
| {q0,q1} | {q0,q1} | {q0,q2} |
| * {q0,q2} | {q0,q1} | {q0} |
Mark the accepting subsets and compare with Lesson 4
Why: Only the subset containing the accepting state qualifies. The finished machine has three states, and their meanings match the hand-built DFA exactly: no progress, ends in 0, ends in 01. The construction rediscovered the invariants that had to be invented by hand.
Verify on two strings and count the reachable subsets
Why: The string 101 ends in 01 and its subset run finishes in the accepting subset; 010 does not and finishes outside it. Eight subsets exist in principle but only three were reached, so the worklist never wasted effort on the other five.
\[ 101 \in L(D), \quad 010 \notin L(D), \quad 3 \text{ of } 2^{3} \text{ subsets reachable} \ \checkmark \]
Pattern
Step through it
Step through Convert the ends-in-01 machine to a deterministic one one row at a time. What is driving the change, and what would the row after the last one be?
Constraint
Discussion prompt
Run Naming the subsets so the result stays readable with this step confiscated:
Rename each state after that meaning, not after a number.
Is it still possible? If it is, say what takes its place and what it costs you. If it is not, say exactly what that step was providing that nothing else does.
Hint: A step you can drop for free was never load-bearing. If you cannot drop it, name the thing that goes wrong the moment it is gone.
Answer:
Pattern
A determinized machine with subset names is correct but unreadable. Renaming it is a small step that pays for itself.
This is also the moment when a determinized machine can be compared with a hand-built one. If the meanings match, the two designs are the same machine wearing different labels.
Edge cases
Discussion prompt
Naming the subsets so the result stays readable works on the cases you have just seen. Push it to the edge: what is the most degenerate input it still handles — empty, zero, one item, everything equal — and what is the first case where it stops being true? Name the case, not just "it breaks".
Hint: Try the smallest legal input, then the largest, then the one where two things collide. Methods are specified at their edges; the middle takes care of itself.
Answer:
A determinized machine with subset names is correct but unreadable. Renaming it is a small step that pays for itself.
Intuition
The definition builds every subset, and most constructions build almost none of them. It is worth being clear on why that is not cheating.
A state that no input can reach cannot influence any verdict, because verdicts are decided by where inputs end up. Deleting it changes no accepted string and no rejected one.
The reachable collection is also closed under transitions — anything one step from a reachable subset is itself reachable — so the restricted machine is still total and still deterministic. Nothing about the definition is violated.
\[ S \text{ reachable} \;\Rightarrow\; \delta_D(S,a) \text{ reachable} \]
Sorting
Sort into buckets
These are the pieces of Equivalence of DFAs & NFAs, out of order. Put each one back under the part of the lesson it belongs to.
Concept
The definition takes the state set to be all subsets, which is convenient for the proof and wasteful in practice.
A state no path ever reaches cannot affect which strings are accepted. So we may safely restrict the state set to the subsets reachable from the start subset.
The restricted machine is still deterministic — the reachable collection is closed under transitions by construction — and it recognizes the same language.
\[ Q_D' = \{\, \hat{\delta}_D(s_0, w) : w \in \Sigma^{*} \,\} \subseteq \mathcal{P}(Q_N) \]
The worklist procedure computes exactly this restricted set and nothing more, which is why it is the version worth learning.
Step zero
Discussion prompt
Convert a machine with epsilon-arrows — before any calculation: what is the plan? Name the moves in order, in plain English, without doing the arithmetic.
Hint: It starts with: Compute the start subset by closing
Answer:
Worked example
Now with free moves in play. Take a machine whose start state has an ε-arrow to a second state, where the second state loops on a and reads b into an accepting state.
Compute the start subset by closing
Why: The start state's closure includes the state at the end of the ε-arrow. The deterministic machine therefore starts in a two-element subset, not a one-element one.
\[ s_0 = E\big(\{p_0\}\big) = \{p_0, p_1\} \]
Take the a-transition from the start subset
Why: Only the second member has an a-arrow. Union gives a one-element subset, and closing it adds nothing new.
\[ \delta_D(s_0, a) = E\big(\{p_1\}\big) = \{p_1\} \]
Take the b-transition from the start subset
Why: Only the second member has a b-arrow, reaching the accepting state. Closing changes nothing, and this subset is accepting.
\[ \delta_D(s_0, b) = \{p_2\}, \qquad \{p_2\} \cap F \neq \varnothing \]
Finish the worklist
Why: The two new subsets are processed the same way. Any transition with no arrows produces the empty subset, which becomes the dead state.
Verify by checking the empty string on both machines
Why: The original accepts the empty string only if the closure of its start state meets the accepting set — it does not, here. The deterministic machine's start subset is that same closed set, and it is not accepting. The two agree on the case the closure was introduced for.
\[ s_0 \cap F = \varnothing \;\Rightarrow\; \varepsilon \notin L(D) = L(N) \ \checkmark \]
Picture it
Animation
Shows: Each line of the worked example "Convert a machine with epsilon-arrows", appearing one at a time.
The same working the example does, in the order a tutor would write it.
Takeaway: The original accepts the empty string only if the closure of its start state meets the accepting set — it does not, here. The deterministic machine's start subset is that same closed set, and it is not accepting. The two agree on the case the closure was introduced for.
Estimation
Predict first
A machine over the alphabet of a and b that accepts exactly the two strings ab and ba, built with two independent branches from the start.
Commit before you compute: what does Determinize a machine with a genuine branch point come out to? A rough magnitude and the right form is enough — the point is to have something concrete to be wrong about.
Correct: Verify on both members and two non-members
Why: A prediction you can defend turns the computation into a check rather than a leap of faith — and an answer that contradicts it is caught on the spot. The strings ab and ba each reach an accepting subset.
Worked example
A machine over the alphabet of a and b that accepts exactly the two strings ab and ba, built with two independent branches from the start.
Write down the original
Why: From the start state, an a-arrow leads into the first branch and a b-arrow into the second. Each branch reads one more symbol into its own accepting state.
\[ L(N) = \{ab, ba\} \]
Start the worklist
Why: The start subset holds only the start state. On a it reaches the first branch's middle state; on b, the second's.
Process both middle subsets
Why: Each has exactly one continuation and one dead direction. The dead direction produces the empty subset, which enters the machine as the dead state.
\[ \delta_D(\{r_1\}, b) = \{r_2\}, \qquad \delta_D(\{r_1\}, a) = \varnothing \]
Count what came out
Why: Five reachable subsets: the start, the two middles, the merged accepting one, and the empty subset. The original had five states, so no blowup occurred at all here.
Verify on both members and two non-members
Why: The strings ab and ba each reach an accepting subset. The strings aa and bb each fall into the empty subset after two symbols, and are rejected. Since the language holds exactly two strings, checking both members and two near-misses settles it.
\[ ab,\ ba \in L(D) \qquad aa,\ bb \notin L(D) \ \checkmark \]
Picture it
Animation
Shows: Each line of the worked example "Determinize a machine with a genuine branch point", appearing one at a time.
The same working the example does, in the order a tutor would write it.
Takeaway: The strings ab and ba each reach an accepting subset. The strings aa and bb each fall into the empty subset after two symbols, and are rejected. Since the language holds exactly two strings, checking both members and two near-misses settles it.
Check
Think about what happens when a subset has no continuation.
Check your understanding
During the subset construction, the union for some subset and symbol comes out empty. What should be done?
Answer: A
Why: A deterministic machine needs a total transition function, so the empty subset must be a genuine state. It contains no accepting state, so it is non-accepting, and every union over its zero members is empty, so it loops to itself forever.
Section
Section 4
Concept
The construction looks obviously right, which is exactly when a proof is worth writing. The claim is a single equation.
After reading any string, the state the deterministic machine occupies is the set of states the original could occupy.
\[ \hat{\delta}_D(s_0, w) \;=\; \hat{\delta}_N(q_0, w) \quad \text{for every } w \]
Note what is being asserted: the left side is a single state of the new machine, and the right side is a subset of the old one. They are equal because the new states are subsets. That identification is the whole proof strategy.
Step zero
Discussion prompt
Prove the invariant by induction on input length — before any calculation: what is the plan? Name the moves in order, in plain English, without doing the arithmetic.
Hint: It starts with: Check the base case
Answer:
Worked example
Induct on the length of the string, exactly as in Lesson 4's correctness proofs.
Check the base case
Why: On the empty string the deterministic machine sits in its start state, which was defined to be the ε-closure of the original start state — and that closure is precisely the original's active set after reading nothing.
\[ \hat{\delta}_D(s_0,\varepsilon) = s_0 = E(\{q_0\}) = \hat{\delta}_N(q_0,\varepsilon) \]
Set up the inductive step
Why: Assume the two sides agree after some string, call that common set S, and read one more symbol.
\[ \hat{\delta}_D(s_0,w) = \hat{\delta}_N(q_0,w) = S \]
Evaluate the deterministic side
Why: By the definition of the extended function it takes one ordinary step from S, and the transition rule says that step is the closed union over the members of S.
\[ \hat{\delta}_D(s_0, wa) = \delta_D(S,a) = E\!\left(\bigcup_{p \in S}\delta(p,a)\right) \]
Evaluate the nondeterministic side
Why: The active-set rule of Lesson 5 gives the closed union over the members of its current set, which by hypothesis is the same S.
\[ \hat{\delta}_N(q_0, wa) = E\!\left(\bigcup_{p \in S}\delta(p,a)\right) \]
Verify the two expressions are literally identical, and finish
Why: Both sides reduced to the same closed union over the same set, so they are equal and the induction closes. Acceptance then follows immediately: the deterministic machine accepts exactly when its state meets the accepting set, which by the invariant is exactly when the original had an accepting branch.
\[ w \in L(D) \iff S \cap F \neq \varnothing \iff w \in L(N) \ \checkmark \]
Picture it
Animation
Shows: Each line of the worked example "Prove the invariant by induction on input length", appearing one at a time.
The same working the example does, in the order a tutor would write it.
Takeaway: On the empty string the deterministic machine sits in its start state, which was defined to be the ε-closure of the original start state — and that closure is precisely the original's active set after reading nothing.
Concept
The proof inducted on the length of the input rather than on the structure of the machine. That choice was forced, and seeing why is useful.
The claim being proved mentions an arbitrary string, and strings are built one symbol at a time. So the induction has to follow the way strings are built — which is exactly the recursive definition of the extended transition function from Lesson 4.
A machine, by contrast, has no inductive structure to recurse on: a diagram with cycles has no base case. That asymmetry recurs in Lesson 9, where converting a machine back into an expression cannot be done by recursion either.
\[ \text{strings: inductive} \qquad \text{graphs: not} \]
Anomaly
Predict first
A student writes this, and it looks reasonable:
Determinize a machine whose start state reads a into a state r, and r has an ε-arrow onward to an accepting state.
It is wrong. Say what breaks — and say it before you turn the page.
Correct: The start state has no ε-arrow out of it, so its closure is itself.
Determinize a machine whose start state reads a into a state r, and r has an ε-arrow onward to an accepting state.
Why: The start state has no ε-arrow out of it, so its closure is itself. With that done, treat the remaining steps as an ordinary construction and just union the transitions.
Trap
Determinize a machine whose start state reads a into a state r, and r has an ε-arrow onward to an accepting state.
Close the start subset and then stop closing
Why: The start state has no ε-arrow out of it, so its closure is itself. With that done, treat the remaining steps as an ordinary construction and just union the transitions.
\[ s_0 = \{p_0\}, \qquad \delta_D(s_0,a) = \{r\} \]
Read off the verdict for the input a
Why: The subset holding r is not accepting, since r itself is not an accepting state. So the machine rejects a.
\[ \{r\} \cap F = \varnothing \;\Rightarrow\; \text{reject} \]
Determinize a machine whose start state reads a into a state r, and r has an ε-arrow onward to an accepting state.
Close after every union, not only at the start
Why: The transition rule closes the union each time. After reading a, the branch at r may immediately drift down the free arrow, so the subset must include the accepting state as well.
\[ \delta_D(s_0,a) = E\big(\{r\}\big) = \{r, f\} \]
Read off the verdict again
Why: The subset now meets the accepting set, so a is accepted — which is right, since the original machine has a genuine accepting path spelling a.
\[ \{r,f\} \cap F \neq \varnothing \;\Rightarrow\; \text{accept} \ \checkmark \]
Two truths and a lie
Sort into buckets
Some of these hold up and some are the exact mistakes this lesson is built to prevent. Sort them.
Intuition
A short proof is worth re-reading for what it quietly relied on.
Change any one of those and the proof breaks at an identifiable line — which is a good sign that the construction has no slack in it.
Hypothesis
Predict first
Watch the invariant hold on a concrete string is about to be worked. State your hypothesis first: which rule or definition decides this one, and what is the first move it forces? Then watch whether the example agrees with you.
Correct: Compare after reading nothing
Why: The original's active set is its start state alone; the deterministic machine sits in the subset of the same name.
A hypothesis you wrote down is falsifiable; a vague sense of how it will go is not. If the example opens somewhere else, that gap is the thing worth chasing.
Worked example
Trace both machines side by side on the input 001, using the ends-in-01 pair from Section 3.
Compare after reading nothing
Why: The original's active set is its start state alone; the deterministic machine sits in the subset of the same name.
\[ \{q_0\} = \{q_0\} \]
Compare after the first 0
Why: The original branches to two states. The deterministic machine takes its single arrow into the subset holding exactly those two.
\[ \{q_0,q_1\} = \{q_0,q_1\} \]
Compare after the second 0
Why: One branch dies and the other splits again, leaving the same pair. The deterministic machine's self-loop agrees.
\[ \{q_0,q_1\} = \{q_0,q_1\} \]
Compare after the 1
Why: The original reaches the start state and the accepting state. The deterministic machine moves to the subset holding both, which is marked accepting.
\[ \{q_0,q_2\} = \{q_0,q_2\} \]
Verify that the agreement held at every prefix, not just at the end
Why: All four pairs matched, which is what an induction on length actually asserts. Both machines accept 001, and they did so for the same reason at every intermediate step.
\[ \varepsilon,\ 0,\ 00,\ 001: \quad \hat{\delta}_D = \hat{\delta}_N \ \checkmark \]
Picture it
Animation
Shows: Each line of the worked example "Watch the invariant hold on a concrete string", appearing one at a time.
The same working the example does, in the order a tutor would write it.
Takeaway: All four pairs matched, which is what an induction on length actually asserts. Both machines accept 001, and they did so for the same reason at every intermediate step.
Commit first
Predict first
In the correctness proof, the deterministic machine's current state is claimed to equal what?
Commit to an answer, then rate it — certain, fairly sure, or guessing — and write the rating down before you turn the page.
Correct: The set of states the original machine could currently occupy
Why: Each state of the constructed machine is literally a subset of the original's states, and the invariant says that subset is exactly the original's active set after the same input. Acceptance then transfers immediately.
The rating matters as much as the answer: confident-and-wrong is the combination that survives revision, because nothing about it feels like it needs revisiting.
Check
Recall what the two sides of the invariant are.
Check your understanding
In the correctness proof, the deterministic machine's current state is claimed to equal what?
Answer: A
Why: Each state of the constructed machine is literally a subset of the original's states, and the invariant says that subset is exactly the original's active set after the same input. Acceptance then transfers immediately.
Section
Section 5
Concept
The construction produces at most as many states as the original has subsets. In the worst case that is exponential.
\[ |Q_D| \;\le\; 2^{|Q_N|} \]
The natural hope is that this is merely a crude analysis and a cleverer construction would do better. It is not. For some languages every deterministic machine really does need exponentially many states.
Proving that requires a lower-bound argument about all machines at once, which is a different kind of reasoning from anything so far — and a preview of Lessons 10 and 11.
Concept
Return to the family from Lesson 5: for a fixed positive k, the strings whose k-th symbol from the end is a 1.
A nondeterministic machine needs only one state more than k: wait, guess, then count off the remaining symbols. But every deterministic machine for it needs at least as many states as there are binary strings of length k.
\[ \text{NFA: } k+1 \qquad \text{DFA: } \ge 2^{k} \]
The proof is a counting argument, and it is short enough to do in full.
Ranking
Put in order
Put the moves of Prove the exponential lower bound into the order they have to happen.
Why: These are the moves of the worked example in the order it makes them, and each one is set up by the one before it. Assume a deterministic machine recognizes the language using strictly fewer states than there are binary strings of length k.
Worked example
Show that no deterministic machine with fewer than the stated number of states can recognize the language.
Suppose a machine exists with too few states
Why: Assume a deterministic machine recognizes the language using strictly fewer states than there are binary strings of length k.
Feed it every string of length k and apply the pigeonhole principle
Why: There are more such strings than states, so two different ones must drive the machine into the same state. Call them u and v.
\[ u \neq v, \quad |u| = |v| = k, \quad \hat{\delta}(q_0,u) = \hat{\delta}(q_0,v) \]
Find a position where they differ
Why: Since the two strings differ, they disagree at some position. Say u has a 1 there and v has a 0, and say that position is the i-th from the end of each.
Append exactly the right number of symbols
Why: Append i minus one zeros to both. Now the symbol that was i-th from the end sits k-th from the end in each extended string, so one extension is in the language and the other is not.
\[ uz \in L, \qquad vz \notin L, \qquad z = 0^{\,i-1} \]
Verify the contradiction, and conclude
Why: Both extensions drive the machine from the same state along the same symbols, so they finish in the same state and receive the same verdict. But one belongs to the language and the other does not — a contradiction. Hence no such machine exists, and the exponential is genuine.
\[ \hat{\delta}(q_0,uz) = \hat{\delta}(q_0,vz) \quad\text{but}\quad uz \in L, \; vz \notin L \ \checkmark \]
Picture it
Animation
Shows: Each line of the worked example "Prove the exponential lower bound", appearing one at a time.
The same working the example does, in the order a tutor would write it.
Takeaway: Both extensions drive the machine from the same state along the same symbols, so they finish in the same state and receive the same verdict. But one belongs to the language and the other does not — a contradiction. Hence no such machine exists, and the exponential is genuine.
Intuition
The argument is worth restating without symbols, because the shape of it recurs constantly from here on.
A deterministic machine's state is everything it remembers. To decide this language it must be able to distinguish any two length-k blocks, because for any two distinct blocks there is a future that separates them.
Distinguishing that many things needs that many states. The nondeterministic machine escapes the requirement entirely by not remembering the block at all — it guesses which position matters and checks only that one.
\[ \text{remember the block} \;\text{versus}\; \text{guess the position} \]
Step zero
Discussion prompt
Trace the blowup on the smallest case — before any calculation: what is the plan? Name the moves in order, in plain English, without doing the arithmetic.
Hint: It starts with: Write the nondeterministic machine
Answer:
Worked example
Take k equal to two: the strings whose second symbol from the end is a 1. Determinize the three-state machine and count.
Write the nondeterministic machine
Why: A waiting state looping on both symbols, a 1-arrow guessing the anchor, then one arrow on either symbol into the accepting state.
\[ |Q_N| = 3 \]
Run the worklist
Why: Starting from the waiting state alone, each symbol either adds the guess branch or does not, and the branches age by one position per symbol.
List the reachable subsets
Why: Four subsets are reachable, and they correspond exactly to the four possible values of the last two symbols read.
| subset | means the last two symbols were |
|---|---|
| {w} | fewer than two symbols so far, or ending 00 or 01 patterns not yet matched |
| {w, g} | the last symbol was a 1 |
| {w, f} | the second-from-last was a 1 |
| {w, g, f} | both of the above |
See why the subsets encode the last two symbols
Why: Membership of the guess state records that the previous symbol was a 1; membership of the final state records that the one before it was. Together they store exactly the two-symbol window the lower bound said had to be stored.
Verify the count against the general bound
Why: Four reachable subsets, and the lower bound for this k predicts at least four states. The two agree exactly, so for this language the construction is not merely correct but optimal.
\[ 4 = 2^{2} \text{ reachable subsets, and } \ge 2^{2} \text{ required} \ \checkmark \]
Picture it
Animation
Shows: Each line of the worked example "Trace the blowup on the smallest case", appearing one at a time.
The same working the example does, in the order a tutor would write it.
Takeaway: Four reachable subsets, and the lower bound for this k predicts at least four states. The two agree exactly, so for this language the construction is not merely correct but optimal.
Concept
The lower-bound argument used one idea twice, and it is worth naming, because it is the engine of every such proof.
distinguishable prefixes — Two strings u and v are distinguishable when some string z sends exactly one of the two extensions into the language.
\[ \exists z : \big(uz \in L\big) \;\text{ and }\; \big(vz \notin L\big) \]
Distinguishable prefixes can never share a state, because from a shared state the machine would give the two extensions the same verdict. So the number of pairwise distinguishable prefixes is a lower bound on the state count.
Matching
Match the pairs
Match each term to the definition this lesson gave it — not the one you would guess from the word.
Why: These are the working definitions of equivalence of the models, equivalent machines, distinguishable prefixes as Equivalence of DFAs & NFAs uses them. Pairing them correctly is the test of whether you could state each one with the slide switched off.
Intuition
Counting pairwise distinguishable prefixes proves lower bounds on machine size. Pushed one step further, it proves that no machine exists at all.
If a language has infinitely many pairwise distinguishable prefixes, then no finite state set can separate them, and the language is not regular. That is the Myhill-Nerode view, and it is the cleanest route to the non-regularity results of Lesson 11.
\[ \text{infinitely many distinguishable prefixes} \;\Rightarrow\; \text{not regular} \]
Lesson 10 reaches the same conclusions by a different road — the pumping lemma — which is easier to apply mechanically but proves slightly less. Both roads start from the observation on this slide.
Explain it
Discussion prompt
Explain This technique returns, and gets a name to a student a year behind you. No notation, no jargon they have not met — and it still has to be true.
Hint: If your explanation needs a symbol they have never seen, you are describing the notation rather than the idea.
Answer:
Counting pairwise distinguishable prefixes proves lower bounds on machine size. Pushed one step further, it proves that no machine exists at all.
Prediction
Predict first
Why does every DFA for 'the k-th symbol from the end is a 1' need at least two-to-the-k states?
Answer it in your own words, now, with nothing to choose from. The options are on the next slide — and picking the right one off a list is an easier skill than producing it.
Correct: Any two distinct length-k blocks are distinguishable, so no two may share a state
Why: For any two different blocks of length k there is a suffix sending exactly one of them into the language, so a machine giving them the same state would give both extensions the same verdict. Counting the blocks therefore bounds the states from below.
Check
Recall which machine had to remember the window and which one guessed.
Check your understanding
Why does every DFA for 'the k-th symbol from the end is a 1' need at least two-to-the-k states?
Answer: A
Why: For any two different blocks of length k there is a suffix sending exactly one of them into the language, so a machine giving them the same state would give both extensions the same verdict. Counting the blocks therefore bounds the states from below.
Concept
It would be a mistake to leave this section pessimistic. The exponential is a ceiling that most machines never approach.
| Machine | Original states | Reachable subsets |
|---|---|---|
| ends in 01 | three | three |
| exactly ab or ba | five | five |
| k-th from the end is 1 | k plus one | two to the k |
The first two rows are typical and the third is engineered to be extreme. The worklist procedure charges you only for the subsets you actually reach, which is why determinization is a routine step in real tools.
Trade off
Comparison matrix
From Blowup is the worst case, not the usual case: every row here is a choice with a cost. Fill the Reachable subsets column, then say which row you would actually pick and what you give up for it.
| Machine | Original states | Reachable subsets |
|---|---|---|
| ends in 01 | three | three |
| exactly ab or ba | five | five |
| k-th from the end is 1 | k plus one | two to the k |
Section
Section 6
Concept
With the two models proved interchangeable, every later argument may use whichever is convenient without further comment.
\[ \text{DFA} \;\equiv\; \text{NFA} \;\equiv\; \varepsilon\text{-NFA} \]
Estimation
Predict first
The operation that failed in Lesson 5 now works, provided the steps are taken in the right order.
Commit before you compute: what does Complement a nondeterministic machine end to end come out to? A rough magnitude and the right form is enough — the point is to have something concrete to be wrong about.
Correct: Verify on one string from each side
Why: A prediction you can defend turns the computation into a check rather than a leap of faith — and an answer that contradicts it is caught on the spot. A string the original accepts drives the deterministic machine into an accepting subset, which is non-accepting after the swap.
Worked example
The operation that failed in Lesson 5 now works, provided the steps are taken in the right order.
Determinize first
Why: Run the subset construction, keeping only the reachable subsets. The result is a deterministic machine for the same language.
\[ N \;\longrightarrow\; D, \qquad L(D) = L(N) \]
Make sure the transition function is total
Why: The construction guarantees this automatically, because the empty subset is present as a genuine dead state. Skipping it here is the classic error, since a missing transition breaks the next step.
Swap the accepting set
Why: Replace the accepting subsets with all the others. Nothing else changes, exactly as in Lesson 4.
\[ D' = (Q_D, \Sigma, \delta_D, s_0, Q_D \setminus F_D) \]
Note why the order cannot be reversed
Why: Swapping before determinizing fails because several branches can be live at once, so a set can meet both the accepting set and its complement. Determinizing first collapses each input to exactly one state, and negation becomes meaningful again.
Verify on one string from each side
Why: A string the original accepts drives the deterministic machine into an accepting subset, which is non-accepting after the swap. A string it rejects does the reverse. Every string switches sides, which is what complementing means.
\[ w \in L(N) \iff w \notin L(D') \ \checkmark \]
Picture it
Animation
Shows: Each line of the worked example "Complement a nondeterministic machine end to end", appearing one at a time.
The same working the example does, in the order a tutor would write it.
Takeaway: A string the original accepts drives the deterministic machine into an accepting subset, which is non-accepting after the swap. A string it rejects does the reverse. Every string switches sides, which is what complementing means.
Concept
Once a machine is deterministic and finite, several questions about its language become simple graph questions.
| Question | How to answer |
|---|---|
| is the language empty? | is any accepting state reachable from the start? |
| is the language infinite? | is there a cycle on a path from start to an accepting state? |
| does it contain the empty string? | is the start state accepting? |
| do two machines agree? | determinize both, then test the symmetric difference for emptiness |
Every one of these is decided by ordinary reachability on a finite graph, so all of them terminate. Lesson 24 returns to this list and asks the same questions of far stronger machines, where the answers are very different.
Analogy
Discussion prompt
Explain Decision problems become easy by analogy to something with no Theory of Computation in it at all — a queue, a recipe, a map, a bank balance, whatever fits. Then say where your analogy breaks.
Hint: An analogy that never breaks is not an analogy, it is the same idea wearing a hat. Find the seam — that is the part that is actually new.
Answer:
Once a machine is deterministic and finite, several questions about its language become simple graph questions.
Step zero
Discussion prompt
Decide emptiness and infiniteness of a converted machine — before any calculation: what is the plan? Name the moves in order, in plain English, without doing the arithmetic.
Hint: It starts with: Determinize and keep only the reachable part
Answer:
Worked example
Take a nondeterministic machine, determinize it, and answer both questions about its language.
Determinize and keep only the reachable part
Why: The worklist already produces exactly the reachable subsets, so this step is free.
Decide emptiness by reachability
Why: Search the graph from the start subset. If no accepting subset is ever visited, no string can be accepted and the language is empty.
\[ L = \varnothing \iff \text{no reachable accepting state} \]
Decide infiniteness by looking for a cycle
Why: The language is infinite exactly when some cycle lies on a path from the start to an accepting state, since going round it repeatedly produces unboundedly many accepted strings.
\[ L \text{ infinite} \iff \exists \text{ a cycle between start and an accepting state} \]
Note why the restriction to the reachable part was needed
Why: A cycle among unreachable subsets proves nothing, since no input ever gets there. Both tests are only meaningful on the reachable subgraph.
Verify both answers against the diagram directly
Why: For emptiness, confirm by eye that the accepting subset really is reachable along a concrete path. For infiniteness, name the cycle found and give a string that goes round it twice, then confirm the machine accepts it. Both checks agree with the graph algorithms.
\[ L \neq \varnothing \text{ and } L \text{ infinite} \ \checkmark \]
Picture it
Animation
Shows: Each line of the worked example "Decide emptiness and infiniteness of a converted machine", appearing one at a time.
The same working the example does, in the order a tutor would write it.
Takeaway: For emptiness, confirm by eye that the accepting subset really is reachable along a concrete path. For infiniteness, name the cycle found and give a string that goes round it twice, then confirm the machine accepts it. Both checks agree with the graph algorithms.
Ranking
Put in order
Put the moves of Decide whether two machines are equivalent into the order they have to happen.
Why: These are the moves of the worked example in the order it makes them, and each one is set up by the one before it. Whatever form the two arrived in, convert each to a deterministic machine over the shared alphabet.
Worked example
Equivalence testing is the decision problem that makes the rest usable, and it reduces to emptiness.
Determinize both machines
Why: Whatever form the two arrived in, convert each to a deterministic machine over the shared alphabet. Now each input has exactly one run in each.
Build a machine for the symmetric difference
Why: Take the product of the two, and mark a pair accepting when exactly one component is accepting. That machine accepts precisely the strings the two originals disagree on.
\[ L(P) = \big(L_1 \setminus L_2\big) \cup \big(L_2 \setminus L_1\big) \]
Test that product machine for emptiness
Why: Search from its start state. If no accepting state is reachable, there is no string of disagreement.
Read off the answer
Why: An empty symmetric difference means the two languages are equal, so the machines are equivalent. A reachable accepting state gives a concrete string on which they differ.
\[ L(P) = \varnothing \iff L_1 = L_2 \]
Verify the method on an obvious pair
Why: Run it on a machine and a copy of itself. Every product pair has both components accepting or neither, so no pair is accepting, the product language is empty, and the method reports equivalent — which is correct, and confirms the accepting rule was set up the right way round.
\[ L_1 = L_2 \;\Rightarrow\; L(P) = \varnothing \ \checkmark \]
Picture it
Animation
Shows: Each line of the worked example "Decide whether two machines are equivalent", appearing one at a time.
The same working the example does, in the order a tutor would write it.
Takeaway: Run it on a machine and a copy of itself. Every product pair has both components accepting or neither, so no pair is accepting, the product language is empty, and the method reports equivalent — which is correct, and confirms the accepting rule was set up the right way round.
Concept
The construction produces a deterministic machine, not the smallest one. Those are separate problems, and it is worth keeping them apart.
| Question | Answered by |
|---|---|
| is there a DFA at all? | the subset construction — this lesson |
| how small can a DFA be? | distinguishable prefixes — the lower bound |
| what is the smallest DFA? | a minimization algorithm, not covered here |
The useful fact to carry forward: every regular language has a unique smallest deterministic machine, up to renaming states, and its states correspond exactly to the classes of indistinguishable prefixes. So the lower-bound technique and the minimal machine are two views of one thing.
Comparison
Comparison matrix
From Minimization is a different question: refill the Answered by column from what you know. The rest of the table is as it appeared.
| Question | Answered by |
|---|---|
| is there a DFA at all? | the subset construction — this lesson |
| how small can a DFA be? | distinguishable prefixes — the lower bound |
| what is the smallest DFA? | a minimization algorithm, not covered here |
Intuition
The word regular now has several definitions that this lesson has proved interchangeable.
Having several equivalent definitions is what makes the class useful. Each proof in the rest of the course picks whichever definition makes it shortest, and this theorem is the licence to do so.
Counterexample
Discussion prompt
The word regular now has several definitions that this lesson has proved interchangeable.
That is stated as though it always holds. Do one of two things: produce a case where it fails, or say precisely what rules such a case out. "It just does" is not on the menu.
Hint: Hunt at the extremes first — zero, one, negative, empty, equal. If every extreme survives, the reason they survive is the proof.
Answer:
Having several equivalent definitions is what makes the class useful. Each proof in the rest of the course picks whichever definition makes it shortest, and this theorem is the licence to do so.
Intuition
It is tempting to conclude that nondeterminism never adds power. That conclusion is false, and knowing why sharpens what was actually proved.
The proof worked because the set of possible situations was finite, so it could be made a state set. A machine with unbounded memory has infinitely many possible situations, and the same move is unavailable.
For the machines of Lesson 16 the determinization genuinely fails: nondeterministic pushdown automata recognize strictly more languages than deterministic ones. For the machines of Lesson 20 the models are equivalent again, but the analogous question about time is the open problem of Lesson 31.
| Model | Does nondeterminism add power? |
|---|---|
| finite automata | no — this lesson |
| pushdown automata | yes — Lesson 16 |
| Turing machines | no — Lesson 22 |
| polynomial-time machines | unknown — Lesson 31 |
Comparison
Comparison matrix
From Why this theorem does not generalize: refill the Does nondeterminism add power? column from what you know. The rest of the table is as it appeared.
| Model | Does nondeterminism add power? |
|---|---|
| finite automata | no — this lesson |
| pushdown automata | yes — Lesson 16 |
| Turing machines | no — Lesson 22 |
| polynomial-time machines | unknown — Lesson 31 |
Elimination
Eliminate the wrong options
You are given an NFA and asked for a machine recognizing the complement of its language. What is the correct order of operations?
3 of these 4 are wrong. Strike them one at a time, and say what rules each one out before you strike the next. The survivor is the answer.
Survives elimination: A
Why: Swapping only negates the verdict when each input reaches exactly one final state. Determinizing first guarantees that, after which the Lesson 4 argument applies unchanged.
Check
Think about which step makes negation meaningful.
Check your understanding
You are given an NFA and asked for a machine recognizing the complement of its language. What is the correct order of operations?
Answer: A
Why: Swapping only negates the verdict when each input reaches exactly one final state. Determinizing first guarantees that, after which the Lesson 4 argument applies unchanged.
Ranking
Put in order
These are the steps of The determinization workflow, scrambled. Put them back in order before the next slide shows you.
Why: This is the order the recipe itself gives. Recalling the sequence without the slide in front of you is the difference between recognising the method and being able to run it — most of what goes wrong in practice is a step done out of turn.
Pattern
Put together, this is the routine every later lesson assumes you can run.
If the goal was complement, swap the accepting set now. If the goal was a smaller machine, minimization is a separate procedure that this course does not need.
Real world
Discussion prompt
Outside this lesson: where does Equivalence of DFAs & NFAs actually turn up? Name one concrete situation — a job, a piece of software someone ships, a decision somebody has to make — and say which part of The determinization workflow is doing the work in it.
Hint: Vague is the failure mode here. "Engineering" is not a situation; "deciding whether this build is fast enough to ship" is.
Answer:
Lesson 6 proves that nondeterminism buys convenience but not power. It states the equivalence theorem and disposes of its trivial direction, then builds the subset construction component by component, including the empty subset as a dead state and the accepting rule people get wrong, the epsilon-closure in the start subset, and the transition rule. It works conversions from a worklist both with and without free moves, proves correctness by induction on the input length, and gives the pigeonhole lower bound showing that the exponential blowup is unavoidable. It ends with the consequences: complementing an NFA in the right order, and deciding emptiness and infiniteness by graph search.
Connect it up
Draw it
One page, no notation unless you need it: draw how these connect — The Claim · The Construction, Component by Component · Worked Conversions · Why It Works · The Cost: An Unavoidable Blowup · Consequences. Put an arrow wherever one of them is what makes another possible, and label the arrow with why.
Recap
You can move freely between the two machine models, and you know exactly what that freedom costs.
| Situation | Move |
|---|---|
| a branching machine to run fast | subset construction, worklist only |
| free moves in the diagram | close, read, close |
| the opposite language | determinize, then swap |
| is the language empty? | reachability on the reachable subgraph |
| how big will the result be? | count reachable subsets, not all subsets |
Lesson 7 uses this freedom to prove the closure properties, building whichever machine is easier and appealing to this theorem to finish.
Want this taught 1-on-1? Alexander tutors Theory of Computation — $55/session, free consultation.