Skip to content
Tape‑n‑Trace
PracticeSearch 26 tools

← All conversions

DFA → regular expression

State elimination: rip out one state at a time, relabelling the paths that went through it.

Source · DFA

fixed
01010, 1q0q1q2

Result

built as the steps run

Nothing built yet — step forward to watch it appear.

Working

7 rows
Edges of the generalised automaton. Labels are regular expressions, not symbols.
FromToReads
q0q10
q0q01
q1q10
q1q21
q2q20+1
Sq0ε
q2Fε

Add a new start S and a new accepting state F, joined to the machine by ε-transitions. Now there is exactly one way in and one way out, whatever the original machine looked like.

The answer appears at the last step. if you would rather read it than watch it.

How to read itHopcroft 2e, §3.2.2
  • A fresh start and a fresh accepting state come first, so there is one way in and one way out.
  • Removing r turns every p → r → q into a single edge labelled R(p,q) + R(p,r) R(r,r)* R(r,q).
  • When only the two new states remain, the label between them is the answer.