DFA simulator
Trace a word through a deterministic finite automaton and check acceptance. Your inputs stay on your device.
Set up your task
Starting local processing
Ready. Processing stays in this browser.
2 Your result
Your result updates in this browser. Check your input if the result looks unexpected.
How to use DFA simulator
Trace a word through a deterministic finite automaton and check acceptance. The pre-filled problem gives you a worked starting point. Compare the response with your own working before trying the self-check below.
- Check the example inputs: States, Start state, Accepting states, Transitions (state symbol target), Input word.
- Change the inputs for your problem. Results update as you type, so finish entering the values before copying an answer.
- Use the working to check an intermediate value or assumption. Then change the example as suggested in the self-check and compare the result.
Supported inputs and limits
Use up to 12 named states, six single-character symbols and 100 transitions. Supply exactly one target per state and alphabet symbol.
How it works
A deterministic finite automaton is a machine with a fixed finite set of states. Reading one symbol moves it to exactly one next state. After the final input symbol, membership depends on whether that final state is marked as accepting.
The trace shows the entire run so it is possible to debug a transition table before proving a language property. A conventional complete DFA needs a transition for every state and alphabet symbol. A rejecting sink with self-loops is useful when a pattern becomes impossible after a particular prefix.
Example
Run the pre-filled example. Its first result is βAcceptedβ.
- States
- even odd
- Start state
- even
- Accepting states
- even
- Transitions (state symbol target)
- even 0 even
even 1 odd
odd 0 odd
odd 1 even - Input word
- 101
Accepted even β1β odd β0β odd β1β even Final state: even
Questions about DFA simulator
How is the alphabet determined?
It is the set of symbols appearing in your transition rules. Then every listed state must have a target for each of those symbols.
What happens on an empty word?
No transition runs. The machine accepts exactly when the start state is accepting.
Try the word 111 in the example.
It ends in odd and is rejected because there are three ones. A zero would leave the state unchanged.
Related tools
Last updated