
- Automata Theory - Applications
- Automata Terminology
- Basics of String in Automata
- Set Theory for Automata
- Finite Sets and Infinite Sets
- Algebraic Operations on Sets
- Relations Sets in Automata Theory
- Graph and Tree in Automata Theory
- Transition Table in Automata
- What is Queue Automata?
- Compound Finite Automata
- Complementation Process in DFA
- Closure Properties in Automata
- Concatenation Process in DFA
- Language and Grammars
- Language and Grammar
- Grammars in Theory of Computation
- Language Generated by a Grammar
- Chomsky Classification of Grammars
- Context-Sensitive Languages
- Finite Automata
- What is Finite Automata?
- Finite Automata Types
- Applications of Finite Automata
- Limitations of Finite Automata
- Two-way Deterministic Finite Automata
- Deterministic Finite Automaton (DFA)
- Non-deterministic Finite Automaton (NFA)
- NDFA to DFA Conversion
- Equivalence of NFA and DFA
- Dead State in Finite Automata
- Minimization of DFA
- Automata Moore Machine
- Automata Mealy Machine
- Moore vs Mealy Machines
- Moore to Mealy Machine
- Mealy to Moore Machine
- Myhill–Nerode Theorem
- Mealy Machine for 1’s Complement
- Finite Automata Exercises
- Complement of DFA
- Regular Expressions
- Regular Expression in Automata
- Regular Expression Identities
- Applications of Regular Expression
- Regular Expressions vs Regular Grammar
- Kleene Closure in Automata
- Arden’s Theorem in Automata
- Convert Regular Expression to Finite Automata
- Conversion of Regular Expression to DFA
- Equivalence of Two Finite Automata
- Equivalence of Two Regular Expressions
- Convert Regular Expression to Regular Grammar
- Convert Regular Grammar to Finite Automata
- Pumping Lemma in Theory of Computation
- Pumping Lemma for Regular Grammar
- Pumping Lemma for Regular Expression
- Pumping Lemma for Regular Languages
- Applications of Pumping Lemma
- Closure Properties of Regular Set
- Closure Properties of Regular Language
- Decision Problems for Regular Languages
- Decision Problems for Automata and Grammars
- Conversion of Epsilon-NFA to DFA
- Regular Sets in Theory of Computation
- Context-Free Grammars
- Context-Free Grammars (CFG)
- Derivation Tree
- Parse Tree
- Ambiguity in Context-Free Grammar
- CFG vs Regular Grammar
- Applications of Context-Free Grammar
- Left Recursion and Left Factoring
- Closure Properties of Context Free Languages
- Simplifying Context Free Grammars
- Removal of Useless Symbols in CFG
- Removal Unit Production in CFG
- Removal of Null Productions in CFG
- Linear Grammar
- Chomsky Normal Form (CNF)
- Greibach Normal Form (GNF)
- Pumping Lemma for Context-Free Grammars
- Decision Problems of CFG
- Pushdown Automata
- Pushdown Automata (PDA)
- Pushdown Automata Acceptance
- Deterministic Pushdown Automata
- Non-deterministic Pushdown Automata
- Construction of PDA from CFG
- CFG Equivalent to PDA Conversion
- Pushdown Automata Graphical Notation
- Pushdown Automata and Parsing
- Two-stack Pushdown Automata
- Turing Machines
- Basics of Turing Machine (TM)
- Representation of Turing Machine
- Examples of Turing Machine
- Turing Machine Accepted Languages
- Variations of Turing Machine
- Multi-tape Turing Machine
- Multi-head Turing Machine
- Multitrack Turing Machine
- Non-Deterministic Turing Machine
- Semi-Infinite Tape Turing Machine
- K-dimensional Turing Machine
- Enumerator Turing Machine
- Universal Turing Machine
- Restricted Turing Machine
- Convert Regular Expression to Turing Machine
- Two-stack PDA and Turing Machine
- Turing Machine as Integer Function
- Post–Turing Machine
- Turing Machine for Addition
- Turing Machine for Copying Data
- Turing Machine as Comparator
- Turing Machine for Multiplication
- Turing Machine for Subtraction
- Modifications to Standard Turing Machine
- Linear-Bounded Automata (LBA)
- Church's Thesis for Turing Machine
- Recursively Enumerable Language
- Computability & Undecidability
- Turing Language Decidability
- Undecidable Languages
- Turing Machine and Grammar
- Kuroda Normal Form
- Converting Grammar to Kuroda Normal Form
- Decidability
- Undecidability
- Reducibility
- Halting Problem
- Turing Machine Halting Problem
- Rice's Theorem in Theory of Computation
- Post’s Correspondence Problem (PCP)
- Types of Functions
- Recursive Functions
- Injective Functions
- Surjective Function
- Bijective Function
- Partial Recursive Function
- Total Recursive Function
- Primitive Recursive Function
- μ Recursive Function
- Ackermann’s Function
- Russell’s Paradox
- Gödel Numbering
- Recursive Enumerations
- Kleene's Theorem
- Kleene's Recursion Theorem
- Advanced Concepts
- Matrix Grammars
- Probabilistic Finite Automata
- Cellular Automata
- Reduction of CFG
- Reduction Theorem
- Regular expression to ∈-NFA
- Quotient Operation
- Parikh’s Theorem
- Ladner’s Theorem
Representation of Turing Machine in Automata Theory
The Turing Machine is the basic fundamental model of a modern computer. It is an abstract model of computation. It was proposed by Alan Turing in 1936. At that time, there were no computers. The Turing machine can carry out any computational process that a modern computer can perform. It is the machine format of unrestricted language.
In this chapter, we will cover the basic concepts of Turing machine with its representation and examples of how it works.
Basics of Turing Machine
A Turing machine (TM) is defined by 7 tuples: (Q, Σ, Γ, δ, q0, B, F)
- Q − Finite set of states
- Σ − Finite set of input alphabets
- Γ − Finite set of allowable tape symbols
- δ − Transitional function
- q0 − Initial state
- B − A symbol of Γ called blank
- F − Final state
The transitional function δ is a mapping from Q × Γ → (Q Γ × {L, R, H}). This means that from one state, by getting one input from the input tape, the machine moves to a state. It writes a symbol on the tape and moves to left, right, or halts.
Mechanical Diagram of Turing Machine
A Turing machine consists of three main parts: an input tape, a read-write head, finite control.

The input tape contains the input alphabets. It has an infinite number of blanks at the left and right side of the input symbols. The read-write head reads an input symbol from the input tape and sends it to the finite control. The machine must be in some state. In the finite control, the transitional functions are written. Based on the present state and the present input, a suitable transitional function is executed.
Operations of Turing Machine
When a transitional function is executed, the Turing machine performs these operations −
- The machine goes into some state.
- The machine writes a symbol in the cell of the input tape from where the input symbol was scanned.
- The machine moves the reading head to the left or right or halts.
Instantaneous Description (ID) of Turing Machine
The Instantaneous Description (ID) of a Turing machine remembers the following at a given instance of time −
- The contents of all the cells of the tape, starting from the rightmost cell up to at least the last cell, containing a non-blank symbol and containing all cells up to the cell being scanned.
- The cell currently being scanned by the read-write head.
- The state of the machine.
Example of Turing Machine
Let us look at an example of a Turing machine that accepts the language $\mathrm{L \:=\: \{ a^n b^n\:, \:n \:\geq\: 1 \}}$. This language consists of strings with equal number of a's followed by b's, where the number of a's and b's is at least 1.
Transition Functions (B denotes blank)
$$\mathrm{\delta(q0, \: a) \: \rightarrow \: (q1, \: X, \: R)}$$
$$\mathrm{\delta(q1, \: a) \: \rightarrow \: (q1, \: a, \: R)}$$
$$\mathrm{\delta(q1, \: b) \: \rightarrow \: (q2, \: Y, \: L)}$$
$$\mathrm{\delta(q2, \: a) \: \rightarrow \: (q2, \: a, \: L)}$$
$$\mathrm{\delta(q2, \: X) \: \rightarrow \: (q0, \: X, \: R)}$$
$$\mathrm{\delta(q1, \: Y) \: \rightarrow \: (q1, \: Y, \: R)}$$
$$\mathrm{\delta(q2, \: Y) \: \rightarrow \: (q2, \: Y, \: L)}$$
$$\mathrm{\delta(q0, \: Y) \: \rightarrow \: (q3, \: Y, \: R)}$$
$$\mathrm{\delta(q3, \: Y) \: \rightarrow \: (q3, \: Y, \: R)}$$
$$\mathrm{\delta(q3, \: B) \: \rightarrow \: (q4, \: B, \: H)}$$

Explanation of Transition Functions
Let's break down how this Turing machine works −
- It starts in state q0 and replaces the first 'a' with 'X'.
- It moves right, keeping 'a's unchanged, until it finds the first 'b'.
- It replaces the first 'b' with 'Y' and moves left.
- It moves left until it finds 'X', then goes back to step 1.
- If it finds 'Y' instead of 'b', it moves right until it finds a blank, then halts in an accepting state.
Instantaneous Description (ID) for the string "aaabbb"
$$\mathrm{BaaabbbB \: \rightarrow \: BXaabbbB}$$
$$\mathrm{BXaabbbB \: \rightarrow \: BXaaYbbB}$$
$$\mathrm{BXaaYbbB \: \rightarrow \: BXXaYbbB}$$
$$\mathrm{BXXaYbbB \: \rightarrow \: BXXaYYbB}$$
$$\mathrm{BXXaYYbB \: \rightarrow \: BXXXYYbB}$$
$$\mathrm{BXXXYYbB \: \rightarrow \: BXXXYYYB \:\:\text{ (Halt in accepting state)}}$$
This ID shows how the Turing machine processes the string "aaabbb" step by step, replacing a's with X's and b's with Y's until it accepts the string.
Conclusion
The Turing machine is a powerful model of computation. It can represent complex languages and perform sophisticated computations. In this chapter, we presented the basic idea of Turing machines with how it works. In addition, we provided suitable state diagram for a machine where it checks equal number of as and bs.