TM (Turing Machine) Simulator
Design, edit, and run computations in an interactive Turing Machine simulator
About This Simulation
This Turing machine simulator lets you design states and transition rules, load an input onto the tape and run the machine step by step, watching the head read, write and move.
Features
- Design states and transition rules on a canvas
- Tape with the head position highlighted
- Read, write and move (left or right) at every step
- Accept, reject and halt states
- Step-by-step or continuous execution
Explanation
A Turing machine is a model of computation with a finite set of states and an infinite tape. At each step it reads the symbol under its head, writes a symbol, moves the head left or right and changes state. Despite its simplicity, it can compute anything a real computer can.
How it works
- Write the input on the tape; every other cell holds the blank symbol.
- Start in the start state with the head on the first input symbol.
- Look up the rule δ(state, symbol) = (new state, symbol to write, direction).
- Write the symbol, move the head one cell left or right and change to the new state.
- Repeat until the machine enters the accept or reject state. It may also run forever.
Why it matters
Turing machines define what is computable. They are used to prove that some problems, such as the halting problem, cannot be solved by any program, and they underpin complexity classes like P and NP. They are the final machine model in CSE331.
Frequently Asked Questions
What is the transition function of a Turing machine?
δ: Q × Γ → Q × Γ × {L, R}. Given the current state and the symbol under the head, it gives the next state, the symbol to write and the direction to move.
What is the halting problem?
The problem of deciding, for any program and input, whether the program eventually halts. Alan Turing proved that no Turing machine can solve it for all inputs, so it is undecidable.
What is the difference between a Turing machine and a PDA?
A pushdown automaton has a stack and can only read its input once from left to right. A Turing machine has a tape it can read, write and move over in both directions, which makes it strictly more powerful.
What is the Church-Turing thesis?
The idea that anything that can be computed by an algorithm can be computed by a Turing machine. It is accepted as the definition of what 'computable' means.
Topics covered
- Turing Machine
- Tape and Head
- Transition Function
- Halting
- Decidability
- Church-Turing Thesis
Tags
- tape
- head
- computability
Related Simulations
Theory of Computation: Automata and Computability
DFA Simulator
Build, edit, and simulate strings in a DFA visualizer
Theory of Computation: Automata and Computability
State Transition Diagram
Create, edit, and test state machines interactively.
Theory of Computation: Automata and Computability
CFG (Context Free Grammar) Simulator
Interactive Context-Free Grammar parser and derivation visualizer
Theory of Computation: Automata and Computability
NFA Simulator
Build, edit, and simulate strings in an NFA visualizer

