AUTOMATA THEORY

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.

UPDATED 2026-09-24
TYPEState
EXAMPLENFA with epsilon transitions for a or b
Make this diagram your own.

Open it in the AI editor with a prompt pre-filled — keep what works, change what doesn't.

CASE ANALYSIS

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.

FAQ

Frequently asked questions

What does ε mean on an arrow?01
It means the automaton changes state without reading an input symbol.
Does this NFA accept the empty string?02
No. Each path to qf must still consume either a or b.
Why do both branches end at qf?03
A shared accepting state expresses that either alternative is a successful match.
Open this example in the editor →

Tweak it with chat, export PNG/SVG, or fork it for your own use case.