“Draw an epsilon-NFA for the regular expression a|b: start at q0, branch by epsilon to q1 and q2, read a from q1 or b from q2, then reach accepting qf.”
看懂背後的決策。
q0 reaches either branch without consuming input.
each branch consumes exactly one alternative.
both successful paths merge at qf.
Use an epsilon split when translating a regular-expression union into an NFA.
常見問題
What does ε mean on an arrow?
It means the automaton changes state without reading an input symbol.
Does this NFA accept the empty string?
No. Each path to qf must still consume either a or b.
Why do both branches end at qf?
A shared accepting state expresses that either alternative is a successful match.