NFA with epsilon transitions for a or b
This epsilon-NFA accepts the language described by the regular expression a|b. It begins at q0 and takes one of two epsilon transitions, which change state without consuming an input symbol. The upper branch reaches q1 and accepts an a; the lower branch reaches q2 and accepts a b. Both branches end at qf, the accepting state. The drawing is a small version of the union rule used in Thompson construction: introduce a new start state, split by epsilon to the alternatives, then join successful alternatives at a shared final state. Because epsilon moves consume nothing, the choice of branch is made before the machine reads the only input symbol.
Open it in the AI editor with a prompt pre-filled — keep what works, change what doesn't.
Scenario
Regular-expression union
Key decisions
- Epsilon split: q0 reaches either branch without consuming input.
- Separate symbols: each branch consumes exactly one alternative.
- Shared accepting state: both successful paths merge at qf.
When to reuse this
Use an epsilon split when translating a regular-expression union into an NFA.
Frequently asked questions
What does ε mean on an arrow?
Does this NFA accept the empty string?
Why do both branches end at qf?
Tweak it with chat, export PNG/SVG, or fork it for your own use case.