Turing Machine and Finite Automata Simulator
Simulates DFAs, NFAs and Turing machines with a state diagram and step-through, runs batch tests and does subset construction, minimisation and regex conversion.
Läuft in Ihrem Browser. Ihre Dateien verlassen nie Ihr Gerät. So prüfen Sie es
…
So geht's
- 1Choose a tab
Use DFA / NFA, Regex → automaton or Turing machine.
- 2Load or type a machine
Press a preset or enter states, start, accepting states and transitions.
- 3Run an input
Type the input string and press Step to move one symbol at a time.
- 4Test many strings
Enter one string per line in Batch test to see accept or reject for each.
- 5Convert
Use Convert NFA → DFA, Minimise DFA, or open the minimal DFA from a regular expression.
- 6Run a Turing machine
Enter rules and input, then Step or Run to halt and watch the tape.
Über dieses Tool
Automata theory is easier to learn when you can run a machine and watch it. This simulator covers the machines of a first theory of computation course. Type a DFA or NFA as a list of transitions, mark the start and accepting states and a state diagram is drawn. Step through an input one symbol at a time with the active states highlighted, or test a batch of strings at once. The DFA checker warns about missing or duplicate moves. NFAs, including ε-moves, can be converted to an equivalent DFA by the subset construction, and any DFA can be minimised. A regular expression with union, concatenation, star, plus and optional parts is turned into an NFA by Thompson's construction and then into a minimal DFA. The Turing machine tab runs rule tables on a tape with a moving head, step by step or to the halt, with presets for binary increment, unary addition and the language aⁿbⁿ.
Writing transitions
Each line is from-state, symbol, to-state, for example q0 a q1. Use ε (or eps) for an empty move in an NFA. States are listed separated by spaces; the start state and accepting states are typed in their boxes. The diagram puts states on a circle, marks the start with a green arrow and accepting states with a double ring.
DFA versus NFA
A DFA has exactly one move for every state and symbol. An NFA may have several moves, none, or ε-moves, and accepts if any path ends in an accepting state. The simulator tracks the set of all states the NFA could be in, which is exactly what the subset construction turns into the states of a DFA.
Regular expressions
Thompson's construction builds a small NFA for each symbol and joins them for concatenation, | and *. Converting and minimising then gives the smallest DFA for the language, so you can compare expressions: two expressions describe the same language exactly when their minimal DFAs match up to renaming.
Worked example
For (a|b)*abb, the minimal DFA has 4 states. Reading aabb ends in the accepting state; reading abab does not. The binary increment Turing machine moves right to the end of 1011, then turns trailing 1s into 0s and the first 0 into 1, leaving 1100 and halting in the accept state.
Limits
Subset construction stops at 64 DFA states to keep the page responsive. Turing machines are single-tape and deterministic, and a run stops after 5,000 steps, so a machine that loops forever is reported as still running rather than proved to loop. Pushdown automata and grammars are not included. It is a teaching simulator, not a verification tool.
Rechenbeispiel
(a|b)*abb → minimal DFA with 4 states; aabb accepted, abab rejected. Turing machine: 1011 + 1 = 1100.
Kurzinfos
- Kategorie: Mathe & Wissenschaft
- Läuft in Ihrem Browser, ohne Anmeldung, ohne Upload.
- Ihre Eingaben bleiben auf Ihrem Gerät.
- Auf Englisch verfügbar.
- Inhalt zuletzt geprüft:
- Offizielle Quelle: Sipser, Introduction to the Theory of Computation (3rd ed.): DFA, NFA, subset construction, Thompson's regular expression construction and Turing machines; MIT OCW 18.404J
Häufig gestellte Fragen
How do I enter a DFA?
List the states, the start state and the accepting states, then type one transition per line as from symbol to.
How does the NFA simulation work?
It keeps the set of every state the machine could be in, adding ε-reachable states, and accepts if the final set contains an accepting state.
What does Convert NFA → DFA do?
It runs the subset construction: each DFA state is a set of NFA states, and the transitions follow all NFA moves at once.
Which regular expression features are supported?
Literal characters, concatenation, | for alternatives, * for zero or more, + for one or more, ? for optional and brackets.
How do I write Turing machine rules?
One per line as state read write move next, with move L, R or S (stay). The blank symbol is _.
What if the Turing machine never halts?
Run to halt stops after 5,000 steps and reports that the machine is still running; it may be looping.
