1
15/09/2025 07:11 AM
By:
Dr. Monali Bordoloi,
Assistant Professor Senior Grade 2
SCOPE.
Course Code:
CSE1008
Theory of Computation
09/15/2025
2
Module 6
Turing Machine
Turing machines (TM): Basic model, definition and representation,
Instantaneous Description, Language acceptance by TM- Undecidable
problems about TMs-Post correspondence problem (PCP)-Modified PCP-
Introduction to recursive function theory - Introductory ideas on Time
complexity of deterministic and nondeterministic Turing machines
Turing Machine- Introduction
 Turing's machine is essentially an abstract model of modern-day computer
execution and storage, developed in order to provide a precise mathematical
definition of an algorithm or mechanical procedure.
Alan Turing conceived the first "infinite" (or unbounded) model of computation: the Turing machine, in
1936, to solve the Entscheindungs problem.
 The Turing machine can be thought of as a finite
automaton or control unit equipped with an infinite
storage (memory).
 Its "memory" consists of an infinite number of
one-dimensional array of cells, i.e., an infinite
tape.
 The model has a facility by which the input at left
or right on the tape can be read easily.
 It is a language acceptor for the class of languages
known as recursively enumerable languages.
 Recursively enumerable languages are also called
Turing recognizable languages.
 The grammar associated with this class of
languages is a type 0 grammar.
 A Turing machine can not only recognize languages, but
also generate results.
 Turing machines can recognize and generate
languages by modifying inputs, making them more
powerful than PDAs or FAs.
Turing Machine
Model of a Turing machine:
3 general components:
1. an infinite input tape,
2. a read/write head,
3. a finite control.
Input Tape:
 Two-way infinite tape : Infinite in both directions.
 Divided into Cells: Each cell holds one symbol only.
 Default State: Empty cells contain the blank symbol
(B).
 Flexible Storage: Input can be placed at any location
on the tape.
 Example: Input "001" occupies 3 cells; remaining
cells hold B.
 Note: No cell can contain more than one symbol at a
time.
Read/Write Head:
 Reads from and writes to the input tape.
 Movement: Can move left or right along the tape.
 Function: Observes the current symbol and modifies it
if needed.
 Operations: Supports read, write, and shift actions.
 Movement Symbols:
 L – Move left by one cell
 R – Move right by one cell
 N – No movement (neutral)
 Action Depends on: Transition rules defined in the
Turing machine.
Turing Machine
Model of a Turing machine:
3 general components:
1. an infinite input tape,
2. a read/write head,
3. a finite control.
Finite Control:
 Controls all transitions in the Turing machine.
 Acts like the CPU of a computer system.
 Keeps track of the current state of the machine.
 Makes decisions based on the current state and input symbol.
 Decides:
 What symbol to write,
 Which state to move to,
 Direction of head movement (L, R, or N).
 State register stores the current state.
 After reading a symbol:
 Replaces it with another,
 Changes the internal state,
 Moves the read/write head.
 Accepts input if final state is reached; otherwise, rejects.
Turing Machine
Model of a Turing machine:
Working Process:
• Initially, the read/write head is positioned over a cell on the
tape.
• The machine scans the current cell.
• Each move is determined by the current state and the symbol
under the head.
• In a move, the Turing machine:
• Changes the state (next state can be new or same),
• Writes or skips the symbol in the cell,
• Moves the head one cell left or right.
• NOTE: Only one cell movement is allowed per move.
Turing Machine
Formal Definition:
M = (Q, Σ, Γ, δ, q0, B, F )
Q: The finite set of states of the finite control
Σ: The finite set of input symbols
Γ: The complete set of tape symbols;
Σ is always a subset of Γ
δ: The transition function: maps the state and the present tape symbol to some state, some tape
symbol, and the direction of navigation of the read/write head, i.e., Q×Γ→Q×Γ×{L,N,R}.
• The arguments of δ(q, X) are: a state q and a tape symbol X.
• The value of δ(q, X), if it is defined, is (p, Y, D) where:
• p is the next state, in Q
• Y is the symbol, in Γ, written in the cell being scanned, replacing whatever symbol was there.
• D is a direction (either L or R), telling us the direction in which the head moves.
E.g. δ(q0,a)=(q1,B,R). Here, the Turing machine is in state q0, and presently the tape symbol under
the read/write head is a. For this combination, Turing machine makes a move and enters into the
state q1, replaces the tape symbol a by B, and moves the read/write head to the right by one cell.
q0: The start state (q0 Q) in which the finite control is found initially.
∈
B: blank symbol (B Γ but B Σ).
∈
F : the set of final or accepting states (F Q).
⊆
Turing Machine- Representation
TM Representation
Transition table Transition diagram Instantaneous description
Transition table
• Transition table rows = machine states, columns = tape symbols.
• Each cell defines a move/transition for a state-symbol pair.
• A dash (−) indicates no transition available.
• Example: machine has:
States: q0, q1
Input alphabet: {a}
Tape symbols: Γ = {a, B}
Initial state: q0 (denoted by →q0)
Final state: q1 (denoted by *q1)
Sample transitions:
In state q0, reading a → move to q1, write B, move right (R).
In state q1, reading a → move to q0, write B, move right (R).
Turing Machine- Representation
TM Representation
Transition table Transition diagram Instantaneous description
Transition diagram
• A graphical representation of Turing machine.
• States are shown as circles (vertices).
• Transitions are shown as arcs (arrows) between states.
• Each arc is labeled with:
• Input symbol,
• Symbol to write,
• Head movement direction (L, R, or N).
• Example:
• Initial state: Marked with a headed arrow (e.g., →q0).
• Final state: Marked with a double circle (e.g., q1).
• Transitions:
• From q0, on input a → write B, move right, go to q1.
• From q1, on input a → write B, move right, go to q0.
Turing Machine- Representation
TM Representation
Transition table Transition diagram Instantaneous description
Instantaneous description: Another way to represent Turing machine execution steps.
• Shows the configuration of moves over an input string.
• Helps trace tape content and check if the machine reaches the final state.
• Uses turnstile notation ( ) to denote each step/configuration.
⊢
• IDs show: Current state, Tape content, Read/write head position
X1X2…Xi-1qXiXi+1…Xn means: q is the current state, and tape head is pointing to Xi
where, X1X2…Xi-1XiXi+1…Xn are the current tape symbols
If δ(q,Xi) = (p,Y,R) then X1…Xi-1qXi…Xn |---- X1…Xi-1YpXi+1…Xn
If δ(q,Xi) = (p,Y,L) then X1…Xi-1qXi…Xn |---- X1…pXi-1YXi+1…Xn
Example 1: Input = aaa
ID: q0aaa Bq1aa BBq0a BBBq1
⊢ ⊢ ⊢
Ends in q1 (final state) → Input accepted
Example 2: Input = aa
ID: q0aa Bq1a BBq0
⊢ ⊢
Ends in q0 (not a final state) → Input rejected
Turing Machine- Language Acceptance
Acceptance/rejection of strings in a Turing machine:
• A Turing machine is used as an acceptor of language.
• Turing machine accepts all recursively enumerable languages.
• Recursive: Repeating the same set of rules any number of times.
• Enumerable: A list of elements that can be counted or listed.
• TM also accepts computable functions like:
• Addition, Subtraction, Multiplication, Division, Power function, and more.
• Acceptance depends on the transition path taken by the machine.
• The input string is placed on the tape, with the head at the leftmost symbol.
• If the machine reaches the final state, the string is accepted.
• If the machine does not reach the final state, the string is rejected.
• A string is accepted if the TM halts in a final state after processing the entire input (or as
specified by its transitions).
• Accept w if TM enters final state and halts.
• If TM halts and not final state, then reject.
The TM need not read the entire input string to accept the string.
Definition: Let M = (Q, Σ, Г, δ, q0, B, F) be a TM, and let w be a string in Σ*. Then w is accepted
by M iff q0w |—* α1pα2 where p is in F and α1 and α2 are in Г*
Acceptance/rejection of strings in a Turing machine:
• Recursive language:
• Turing machine always halts.
• It either accepts and halts or rejects and halts.
• Recursively enumerable language:
• Turing machine halts only if it accepts the string.
• If the string is not in the language, the machine may not halt (can loop indefinitely).
Turing Machine- Language Acceptance
NOTE:
 All recursive languages are recursively enumerable, but not all recursively enumerable
languages are recursive.
 A subset of recursively enumerable languages is context-sensitive languages.
 Every context-sensitive language is recursive.
 Some recursive languages are not context-sensitive.
 If a language is recursive, the problem is decidable.
 A problem is decidable if there exists an algorithm that solves it in finite time.
 If a language is recursively enumerable, the problem is undecidable.
 A problem is undecidable if no algorithm exists to solve it in finite time.
• Time complexity of a Turing machine:
• Number of times the tape head moves for a given input.
• Space complexity:
• Number of tape cells written during computation.
• Turing machine's time complexity for reasonable functions:
T(n) = O(n log n)
• Turing machine's space complexity:
S(n) = O(n)
Turing Machine- Complexity
Turing Machine- Comparison
Turing Machine- Comparison
Designing a Turing Machine
• While designing, the Turing machine remembers the previously scanned symbol.
• It does this by transitioning into a unique state that encodes that memory.
• Care must be taken to minimize the number of states in the Turing machine design.
Example 1: Construct a Turing machine that recognizes the strings consisting of even number of
0s. The input alphabet is {0}
The set of strings for this language is L={00,0000,000000,…}.
1. Initially, Turing machine is in state q0.
2. Turing machine then scans the input 0 and remembers this by entering into next state, say q1.
Remember that the number of 0s scanned so far is odd.
3. At q1, Turing machine scans the input tape and gets the symbol 0. Then the machine enters into state
q0 again and remembers that the number of 0s scanned so far is even. Hence q0 will also act as the final
state.
4. Toggle among these two states until all the 0s have been scanned.
5. The read/write head will continuously move to the right side.
6. Upon scanning every occurrence of 0, the machine will replace it with B to indicate that the symbol
has been processed.
Designing a Turing Machine
• While designing, the Turing machine remembers the previously scanned symbol.
• It does this by transitioning into a unique state that encodes that memory.
• Care must be taken to minimize the number of states in the Turing machine design.
Example 1: Construct a Turing machine that recognizes the strings consisting of even number of
0s. The input alphabet is {0}
Acceptance/rejection of the string:
Draw an instantaneous description of the string.
Let us consider the strings 0000 and 000 and check them through instantaneous description.
1. 0000: We know that this string contains an even number of 0s. Hence Turing machine must accept
this string. The instantaneous description is
q00000 Bq1000 BBq000 BBBq10 BBBBq0
⊢ ⊢ ⊢ ⊢
accepted
2. 000: We know that this string contains an odd number of 0s, so Turing machine must reject this
string. The instantaneous description is
q0000 Bq100 BBq00 BBBq1
⊢ ⊢ ⊢
rejected
Designing a Turing Machine
Example 2: Construct a Turing machine for the language L= “010”.
The Input tape for language “010” is shown
After placing the given language “010” in the input tape, special
symbols are inserted. After the arrival of first special symbol the
given language is accepted.
Consider,
Q = {q0,q1,q2,q3} where q0 is initial state.
T = {0,1,X,Y,$} where $ represents blank B.
∑ = {0,1}
F = {q3}
Note:
Symbols “X” and “Y” on the input tape are used to mark the
processed values of 0 and 1, respectively.
These symbols serve as indicators to confirm that the input
symbols have been read successfully.
For example:
• When the machine reads “0”, it replaces it with “X”.
• When it reads “1”, it replaces it with “Y”.
For First Input “0”
• Transition goes from initial state (q0) to state (q1)
• The first symbol “0” of input tape is replaced by “X”
• Read/Write Head goes to one position Right
δ( q0 ,0 ) = (q1, X,R)
Designing a Turing Machine
Example 2: Construct a Turing machine for the language L= “010”.
For Second Input “1”
• Transition goes from state (q1) to state (q2)
• The second symbol “1” of input tape is updated to “Y”
• Read/Write Head Goes to one Position Right
δ( q1 , 1 ) = ( q2, Y,R)
For Third Input “0”
• Transition goes from state (q2) to state (q3)
• The third symbol “0” of input tape is updated to “X”
• Read/Write Head Goes to one Position Right
δ( q2 ,0 ) = (q3, X,R)
For First Special Symbol “$”
• Transition goes from state (q3) to state (q4), which
is the accepting state.
• The special symbol “$” of the input tape remains
unchanged and the same as “$”
• Read/Write Head moves one position right.
δ( q3 , $) = (q4, $, R)
Designing a Turing Machine
Example 2: Construct a Turing machine for the language L= “010”.
Other than “010” all other strings are rejected.
All possible path for each input (0,1 and $) at each state is shown in the fig.
ID for 010 : q0w |- q0010
|- Xq1 10
|- XYq20
|- XYXq3$
|- XYX$q4$
As q4 is in F, w is accepted.
Designing a Turing Machine
Example 3: Design a Turing Machine which recognizes the language L = where N>=0.
Given language (L = ) will generate equal number of 0’s and 1’s. So, consider an input-tape which
hold L=”000111” as shown below
An algorithm for the above language in Turing Machine to accept is given below:
Step 01: Change “0” to “X”
Step 02: Move Right to First “1”.If no “1” found, then simply reject the language
Step 03: Change “1” to “Y”
Step 04: Move Left to Leftmost “0”
Step 05: Repeat Steps 01 to 04 until no more “0” and “1” remain in the input tape.
According to Step 01, for the first Input “0”
• Transition goes from initial state (q0) to state (q1).
• The first symbol “0” of input tape is updated to “X”
• Read/Write Head Move to One position Right
Designing a Turing Machine
Example 3: Design a Turing Machine which recognizes the language L = where N>=0.
According to Steps 2 and 3, R/W Head moves to the right to
update the first “1” on the right side of the input Tape
• Transition goes from state (q1) to state (q2).
• The symbol “1” of the input tape is updated to “Y”
• R/W Head Move one Position Left to update the Leftmost “0”
in the next.
At q1, transition will remain in the same state for input “0” as
shown in the fig
According to Step 4 and 01, Move Left to the Leftmost “0”
and update it to “X”, as
• Transition goes from state (q2) to state (q0) for input “X”
• The Leftmost “0” of input tape is updated to “X”
• After Update Leftmost “0” to “X”, R/W head move to Right
for upcoming “1” updating
Designing a Turing Machine
Example 3: Design a Turing Machine which recognizes the language L = where N>=0.
Again, according to Step 2 and 3, R/W Head Move to Right
To update first “1” in right side of input tape.
Input tape and Turing machine transition diagram are shown in
the fig.
Again, According To Step 4 and 01, Move Left to Leftmost
“0” and update it to “X”, As given below
Transition goes from state (q2) to state (q0) for input “X”
• The Leftmost “0” of input tape is updated to “X”
• After Update Leftmost “0” to “X”, R/W head move to Right
for upcoming “1” updating
Designing a Turing Machine
Example 3: Design a Turing Machine which recognizes the language L = where N>=0.
Again, According to Step 2 and 3 R/W Head Move to Right To
update first “1” in right side of input tape
At this point,
• all the 0’s and 1’s are updated with X and Y respectively in input
tape.
• Current State is q2 and R/W head is moving toward Left of each
input “Y”
• As X input occur, state goes to q0 and R/W Head moves toward
Right.
• By consuming all input “Y”, state will be q3.
• As first special symbol “$” occur, state goes to final state (q4) and
R/W head will point the last symbol of considered language.
Note: For Special symbol (“$”) at state q0, language is accepted.
Final set of transitions are:
δ( q0 , 0) = (q1, X, R)
δ( q1 , Y) = (q1, Y, R)
δ( q1 , 0) = (q1, 0, R)
δ q1 , 1) = (q2, Y, L)
δ( q2 , 0) = (q2, 0, L)
δ( q2 , Y) = (q2, Y, L)
δ( q2 , X) = (q0, X, R)
δ( q0 , Y) = (q3, Y, R)
δ( q3 , Y) = (q3, Y, R)
δ( q3 , $) = (q4, $, L)
δ( q0 , $) = (q4, $, L)
Designing a Turing Machine
Example 3: Design a Turing Machine which recognizes the language L = where N>=0.
The particular input ‘0011’ gives the following successive instantaneous descriptions.
q00011├ Xq1011 using δ(q0,0) = (q1,X, R)
├ X0q111 using δ(q1,0) = (q1,0, R)
├ Xq20Y1 using δ(q1,1) = (q2,Y, L)
├ q2X0Y1 using δ(q2,0) = (q2,0,L)
├ Xq00Y1 using δ(q2,X) = (q0,X,R)
├ XXq1Y1 using δ(q0,0) = (q1,X, R)
├ XXYq11 using δ(q1,Y)= (q1,Y,R)
├ XXq2YY using δ(q1,1) = (q2,Y, L)
├ Xq2XYY using δ(q2,Y) = (q2,Y,L)
├ XXq0YY using δ(q2,X) = (q0, X, R)
├ XXYq3Y using δ(q0,Y) = (q3, Y, R)
├ XXYYq3$ using δ(q3,Y) = (q3, Y, R)
├ XXYYq4$ using δ(q3, $) = (q4, $, L)
ACCEPT!!
Final set of transitions are:
δ( q0 , 0) = (q1, X, R)
δ( q1 , Y) = (q1, Y, R)
δ( q1 , 0) = (q1, 0, R)
δ q1 , 1) = (q2, Y, L)
δ( q2 , 0) = (q2, 0, L)
δ( q2 , Y) = (q2, Y, L)
δ( q2 , X) = (q0, X, R)
δ( q0 , Y) = (q3, Y, R)
δ( q3 , Y) = (q3, Y, R)
δ( q3 , $) = (q4, $, L)
δ( q0 , $) = (q4, $, L)
Designing a Turing Machine
Example 4: Design a Turing Machine which recognizes the language L = where N>0
Algorithm For Language
Algorithm for above language in Turing Machine to Accept is given below
• Step 01: Change “a” to “X”
• Step 02: Move Right to First “b”. If “b” found then Change “b” to “Y” otherwise simply reject the
language.
• Step 03: Move Right to First “c”. If “c” found then Change “c” to “Z” otherwise simply reject the language.
• Step 04: Move Left to Leftmost “a”
• Step 05: Repeat Step 01 to 04 until no more “a”, “b” and “c” remain in the input tape.
Let us construct the Turing Machine for the language considering the string “aabbcc”.
Designing a Turing Machine
Example 5: Design a TM to accept even length palindromes over the alphabet {a, b}.
• Match the first and last element and erase them and go on doing the same. Once we reach epsilon without any
mismatch then the string is even-length palindrome.
• For an even-length palindrome a TM is defined after the machine runs and erases the first and last element
without encountering a mismatch. Later on the turing machine accepts the string and the string is even-length
palindrome.
Algorithm for Even Palindromes
• Step 01: Replace first leftmost
symbol with Blank symbol “$”.
• Step 02: Replace rightmost
symbol with Blank symbol “$”.
• Step 03: repeat above both steps
(1&2) until all symbols are
replaced with “$”
Designing a Turing Machine
Practice Questions:
1. Design a TM to accept odd length palindromes over the alphabet {a, b}.
2. Design a TM to accept the language L = { | n >=0}
3. Design a TM to accept the language L = {| i x j = k and i, j, k ≥1}
4. Construct a Turing machine to concatenate two unary strings
5. Construct Turing machine that finds the 1s complement of a given binary number
Variants of Turing Machine
1. Multi-tape Turing Machine
2. Multi-head Turing Machine
3. Multi-track Turing Machine
4. Semi-infinite Turing Machine
5. Universal Turing Machine
6. K-dimensional Turing Machine
7. Non-Deterministic Turing Machine
8. Alternating Turing machine
9. Unambiguous Turing Machine
10. Quantum Turing Machine
11. Read-Only Turing Machine
12. Probabilistic Turing Machine
Basic TM is equivalent to all the above
Variants of Turing Machine
1. Multi-tape Turing Machine
Multi-tape Turing machine is an extension of the standard Turing machine where
• multiple tapes are available for input, output, and computation,
• each tape has its own read-write head, and
• the machine's transition function is based on the current state and the symbols read by each
head.
• In the beginning, the input is only on the first tape while the rest of the tapes remain blank. In
the next step, the machine reads consecutive symbols under its head and prints a symbol on
each tape then shifts its head.
Example 1: Check if a binary string is a palindrome.
Step 1: Copy the input string from Tape 1 to Tape 2.
Step 2: Move the head on Tape 1 from left to right to read the input.
Step 3: Simultaneously, move the head on Tape 2 from left to right to copy the input.
Step 4: Compare symbols by moving the head on Tape 1 from left to right and the head on Tape 2 from right to left.
Check: If all corresponding symbols match, the string is a palindrome.
Advantage: This approach reduces time complexity compared to a single-tape Turing machine.
Variants of Turing Machine
2. Multi-head Turing Machine
• A single tape is used, but it has multiple read-write heads.
• These heads can independently read and write symbols, enabling the machine to
perform complex tasks more efficiently.
• If multiple heads attempt to write different symbols to the same cell, a priority
system determines which head's action is executed.
• If a head tries to move left beyond the leftmost cell, a special condition known as
"hanging" occurs, which needs to be handled.
• The multi-head Turing machine, like the multi-tape machine, can be converted to
an equivalent single-head machine, although the process may be more complex.
Example 1: Check if a string is a palindrome.
The heads start at both ends of the string and move towards each other, checking if the corresponding symbols are
identical.
Variants of Turing Machine
3. Multi-track Turing Machine
• A specific type of Multi-tape Turing machine, contain multiple tracks but just one
tape head reads and writes on all tracks.
• A single tape head reads n symbols from n tracks at one step.
• It accepts recursively enumerable languages like a normal single-track single-tape
Turing Machine accepts.
Variants of Turing Machine
4. Semi-infinite Turing Machine
• Such machines have left ends limited by an end marker and an infinite right end.
They have two tracks, that is,
• a upper track that represents cells to the right of the initial head position and
• a lower track that represents cells to the left of the initial head position in
reverse order.
• The machine starts from a state q0 and scans from the left end marker. At each step it
reads the symbol on the tape under its head then writes a new symbol on that tape and
shifts the head to the left or right of one tape cell.
• A transition function determines the actions to be taken.
• Semi-infinite machines have two special states, the accept and reject states.
• The accept state means that the input is accepted and the reject state means that
input is rejected when the machine enters that state. In other cases, the machine
will continue infinitely without any rejections or acceptances for certain inputs.
Variants of Turing Machine
5. Universal Turing Machine
• This is a type of Turing machine that simulates an arbitrary Turing machine on an
arbitrary input.
• It does this by having three pieces of information for the machine it is simulating:
• the first is the basic description of the machine to be simulated,
• the second is the input to that machine's tape,
• and finally the internal state of the machine.
• It controls the machine by changing its state based on the input.
Variants of Turing Machine
6. K-dimensional Turing Machine
• A K-dimensional Turing machine extends the concept of the tape to multiple dimensions.
• Example: A two-dimensional Turing machine having a tape that extends infinitely in both the
X and Y directions.
• In a two-dimensional Turing machine, the read-write head can move not only left and right but also
up and down.
• This added flexibility allows the machine to process more complex data structures, such as matrices
or grids.
• This type of Turing machine is ideal for tasks that naturally fit a multi-dimensional space, such as
image processing or simulations of physical phenomena.
Variants of Turing Machine
7. Non-Deterministic Turing Machine
• It can transition into multiple possible states from a given state and symbol. Instead of
following a single path, the NDTM can explore many computational paths simultaneously.
• Computations of such machines form a tree of configurations that are reachable from the start
configuration and therefore input is accepted if there is at least one node in the tree that is an
accept configuration otherwise the input is not accepted.
Example
Consider the language L = {0n
1m
} where n and m are not necessarily equal. An NDTM can non-
deterministically choose how many 0's and 1's to match, accepting the string if it satisfies the
condition.
Every non-deterministic Turing machine has an equivalent deterministic Turing machine. The
deterministic version simulates all possible paths of the NDTM and accepts the string if any path
leads to an accepting state.
Variants of Turing Machine
8. Alternating Turing machine
• This is an NDTM that accepts computations that generalize rules used in the definition of
complexity classes of NP and Co-NP.
• Its states are divided into two sets namely existential and universal states. The former is
accepting if a transition leads to an accepting state while the latter is accepting if every
transition leads to an accepting state.
9. Unambiguous Turing Machine
• This is a special type of NDTM where for each input, there is exactly a single possible
computation. In many ways, it is similar to a deterministic Turing machine.
10. Quantum Turing Machine
• Also referred to as a universal quantum computer. It is an abstract machine that models the
effects of a quantum computer by providing a simple model that covers the power of
quantum computation.
• Any quantum algorithm can be expressed formally as a quantum Turing machine.
Variants of Turing Machine
11. Read-Only Turing Machine
• Also referred to as a two-way deterministic finite-state automaton. It is a class of models of
computability that behave like a standard Turing machine and move in both directions across a
given input
• It cannot write to the input tape, only read it.
• In its bare form, it is similar to a deterministic finite-state machine in computational power
and therefore only parses regular languages.
12. Probabilistic Turing Machine
• A Turing machine that is modified to execute randomized computations. These machines
make decisions based on the outcomes of unbiased coin tosses.
• Every NDTM can be simulated by a probabilistic Turing machine with a small error of
probability.
• Also unlike deterministic Turing machines, they have stochastic results whereby on a given
input and instruction state machine, it can have different run times or may not halt at all,
furthermore, it may accept input in one execution and reject the same input in another
execution.
• Common applications of such machines are modeling a robot that handles accidents in a
nuclear plant or modeling space missions that have strong radiations.
15/09/2025 07:11 AM
By: Dr. Monali Bordoloi, Asst. Prof. Sr. Gra
de 1, VIT-AP
39

THEORY OF COMPUTATION MOD 6 where we can learn cse

  • 1.
    1 15/09/2025 07:11 AM By: Dr.Monali Bordoloi, Assistant Professor Senior Grade 2 SCOPE. Course Code: CSE1008 Theory of Computation
  • 2.
    09/15/2025 2 Module 6 Turing Machine Turingmachines (TM): Basic model, definition and representation, Instantaneous Description, Language acceptance by TM- Undecidable problems about TMs-Post correspondence problem (PCP)-Modified PCP- Introduction to recursive function theory - Introductory ideas on Time complexity of deterministic and nondeterministic Turing machines
  • 3.
    Turing Machine- Introduction Turing's machine is essentially an abstract model of modern-day computer execution and storage, developed in order to provide a precise mathematical definition of an algorithm or mechanical procedure. Alan Turing conceived the first "infinite" (or unbounded) model of computation: the Turing machine, in 1936, to solve the Entscheindungs problem.  The Turing machine can be thought of as a finite automaton or control unit equipped with an infinite storage (memory).  Its "memory" consists of an infinite number of one-dimensional array of cells, i.e., an infinite tape.  The model has a facility by which the input at left or right on the tape can be read easily.  It is a language acceptor for the class of languages known as recursively enumerable languages.  Recursively enumerable languages are also called Turing recognizable languages.  The grammar associated with this class of languages is a type 0 grammar.  A Turing machine can not only recognize languages, but also generate results.  Turing machines can recognize and generate languages by modifying inputs, making them more powerful than PDAs or FAs.
  • 4.
    Turing Machine Model ofa Turing machine: 3 general components: 1. an infinite input tape, 2. a read/write head, 3. a finite control. Input Tape:  Two-way infinite tape : Infinite in both directions.  Divided into Cells: Each cell holds one symbol only.  Default State: Empty cells contain the blank symbol (B).  Flexible Storage: Input can be placed at any location on the tape.  Example: Input "001" occupies 3 cells; remaining cells hold B.  Note: No cell can contain more than one symbol at a time. Read/Write Head:  Reads from and writes to the input tape.  Movement: Can move left or right along the tape.  Function: Observes the current symbol and modifies it if needed.  Operations: Supports read, write, and shift actions.  Movement Symbols:  L – Move left by one cell  R – Move right by one cell  N – No movement (neutral)  Action Depends on: Transition rules defined in the Turing machine.
  • 5.
    Turing Machine Model ofa Turing machine: 3 general components: 1. an infinite input tape, 2. a read/write head, 3. a finite control. Finite Control:  Controls all transitions in the Turing machine.  Acts like the CPU of a computer system.  Keeps track of the current state of the machine.  Makes decisions based on the current state and input symbol.  Decides:  What symbol to write,  Which state to move to,  Direction of head movement (L, R, or N).  State register stores the current state.  After reading a symbol:  Replaces it with another,  Changes the internal state,  Moves the read/write head.  Accepts input if final state is reached; otherwise, rejects.
  • 6.
    Turing Machine Model ofa Turing machine: Working Process: • Initially, the read/write head is positioned over a cell on the tape. • The machine scans the current cell. • Each move is determined by the current state and the symbol under the head. • In a move, the Turing machine: • Changes the state (next state can be new or same), • Writes or skips the symbol in the cell, • Moves the head one cell left or right. • NOTE: Only one cell movement is allowed per move.
  • 7.
    Turing Machine Formal Definition: M= (Q, Σ, Γ, δ, q0, B, F ) Q: The finite set of states of the finite control Σ: The finite set of input symbols Γ: The complete set of tape symbols; Σ is always a subset of Γ δ: The transition function: maps the state and the present tape symbol to some state, some tape symbol, and the direction of navigation of the read/write head, i.e., Q×Γ→Q×Γ×{L,N,R}. • The arguments of δ(q, X) are: a state q and a tape symbol X. • The value of δ(q, X), if it is defined, is (p, Y, D) where: • p is the next state, in Q • Y is the symbol, in Γ, written in the cell being scanned, replacing whatever symbol was there. • D is a direction (either L or R), telling us the direction in which the head moves. E.g. δ(q0,a)=(q1,B,R). Here, the Turing machine is in state q0, and presently the tape symbol under the read/write head is a. For this combination, Turing machine makes a move and enters into the state q1, replaces the tape symbol a by B, and moves the read/write head to the right by one cell. q0: The start state (q0 Q) in which the finite control is found initially. ∈ B: blank symbol (B Γ but B Σ). ∈ F : the set of final or accepting states (F Q). ⊆
  • 8.
    Turing Machine- Representation TMRepresentation Transition table Transition diagram Instantaneous description Transition table • Transition table rows = machine states, columns = tape symbols. • Each cell defines a move/transition for a state-symbol pair. • A dash (−) indicates no transition available. • Example: machine has: States: q0, q1 Input alphabet: {a} Tape symbols: Γ = {a, B} Initial state: q0 (denoted by →q0) Final state: q1 (denoted by *q1) Sample transitions: In state q0, reading a → move to q1, write B, move right (R). In state q1, reading a → move to q0, write B, move right (R).
  • 9.
    Turing Machine- Representation TMRepresentation Transition table Transition diagram Instantaneous description Transition diagram • A graphical representation of Turing machine. • States are shown as circles (vertices). • Transitions are shown as arcs (arrows) between states. • Each arc is labeled with: • Input symbol, • Symbol to write, • Head movement direction (L, R, or N). • Example: • Initial state: Marked with a headed arrow (e.g., →q0). • Final state: Marked with a double circle (e.g., q1). • Transitions: • From q0, on input a → write B, move right, go to q1. • From q1, on input a → write B, move right, go to q0.
  • 10.
    Turing Machine- Representation TMRepresentation Transition table Transition diagram Instantaneous description Instantaneous description: Another way to represent Turing machine execution steps. • Shows the configuration of moves over an input string. • Helps trace tape content and check if the machine reaches the final state. • Uses turnstile notation ( ) to denote each step/configuration. ⊢ • IDs show: Current state, Tape content, Read/write head position X1X2…Xi-1qXiXi+1…Xn means: q is the current state, and tape head is pointing to Xi where, X1X2…Xi-1XiXi+1…Xn are the current tape symbols If δ(q,Xi) = (p,Y,R) then X1…Xi-1qXi…Xn |---- X1…Xi-1YpXi+1…Xn If δ(q,Xi) = (p,Y,L) then X1…Xi-1qXi…Xn |---- X1…pXi-1YXi+1…Xn Example 1: Input = aaa ID: q0aaa Bq1aa BBq0a BBBq1 ⊢ ⊢ ⊢ Ends in q1 (final state) → Input accepted Example 2: Input = aa ID: q0aa Bq1a BBq0 ⊢ ⊢ Ends in q0 (not a final state) → Input rejected
  • 11.
    Turing Machine- LanguageAcceptance Acceptance/rejection of strings in a Turing machine: • A Turing machine is used as an acceptor of language. • Turing machine accepts all recursively enumerable languages. • Recursive: Repeating the same set of rules any number of times. • Enumerable: A list of elements that can be counted or listed. • TM also accepts computable functions like: • Addition, Subtraction, Multiplication, Division, Power function, and more. • Acceptance depends on the transition path taken by the machine. • The input string is placed on the tape, with the head at the leftmost symbol. • If the machine reaches the final state, the string is accepted. • If the machine does not reach the final state, the string is rejected. • A string is accepted if the TM halts in a final state after processing the entire input (or as specified by its transitions). • Accept w if TM enters final state and halts. • If TM halts and not final state, then reject. The TM need not read the entire input string to accept the string. Definition: Let M = (Q, Σ, Г, δ, q0, B, F) be a TM, and let w be a string in Σ*. Then w is accepted by M iff q0w |—* α1pα2 where p is in F and α1 and α2 are in Г*
  • 12.
    Acceptance/rejection of stringsin a Turing machine: • Recursive language: • Turing machine always halts. • It either accepts and halts or rejects and halts. • Recursively enumerable language: • Turing machine halts only if it accepts the string. • If the string is not in the language, the machine may not halt (can loop indefinitely). Turing Machine- Language Acceptance NOTE:  All recursive languages are recursively enumerable, but not all recursively enumerable languages are recursive.  A subset of recursively enumerable languages is context-sensitive languages.  Every context-sensitive language is recursive.  Some recursive languages are not context-sensitive.  If a language is recursive, the problem is decidable.  A problem is decidable if there exists an algorithm that solves it in finite time.  If a language is recursively enumerable, the problem is undecidable.  A problem is undecidable if no algorithm exists to solve it in finite time.
  • 13.
    • Time complexityof a Turing machine: • Number of times the tape head moves for a given input. • Space complexity: • Number of tape cells written during computation. • Turing machine's time complexity for reasonable functions: T(n) = O(n log n) • Turing machine's space complexity: S(n) = O(n) Turing Machine- Complexity
  • 14.
  • 15.
  • 16.
    Designing a TuringMachine • While designing, the Turing machine remembers the previously scanned symbol. • It does this by transitioning into a unique state that encodes that memory. • Care must be taken to minimize the number of states in the Turing machine design. Example 1: Construct a Turing machine that recognizes the strings consisting of even number of 0s. The input alphabet is {0} The set of strings for this language is L={00,0000,000000,…}. 1. Initially, Turing machine is in state q0. 2. Turing machine then scans the input 0 and remembers this by entering into next state, say q1. Remember that the number of 0s scanned so far is odd. 3. At q1, Turing machine scans the input tape and gets the symbol 0. Then the machine enters into state q0 again and remembers that the number of 0s scanned so far is even. Hence q0 will also act as the final state. 4. Toggle among these two states until all the 0s have been scanned. 5. The read/write head will continuously move to the right side. 6. Upon scanning every occurrence of 0, the machine will replace it with B to indicate that the symbol has been processed.
  • 17.
    Designing a TuringMachine • While designing, the Turing machine remembers the previously scanned symbol. • It does this by transitioning into a unique state that encodes that memory. • Care must be taken to minimize the number of states in the Turing machine design. Example 1: Construct a Turing machine that recognizes the strings consisting of even number of 0s. The input alphabet is {0} Acceptance/rejection of the string: Draw an instantaneous description of the string. Let us consider the strings 0000 and 000 and check them through instantaneous description. 1. 0000: We know that this string contains an even number of 0s. Hence Turing machine must accept this string. The instantaneous description is q00000 Bq1000 BBq000 BBBq10 BBBBq0 ⊢ ⊢ ⊢ ⊢ accepted 2. 000: We know that this string contains an odd number of 0s, so Turing machine must reject this string. The instantaneous description is q0000 Bq100 BBq00 BBBq1 ⊢ ⊢ ⊢ rejected
  • 18.
    Designing a TuringMachine Example 2: Construct a Turing machine for the language L= “010”. The Input tape for language “010” is shown After placing the given language “010” in the input tape, special symbols are inserted. After the arrival of first special symbol the given language is accepted. Consider, Q = {q0,q1,q2,q3} where q0 is initial state. T = {0,1,X,Y,$} where $ represents blank B. ∑ = {0,1} F = {q3} Note: Symbols “X” and “Y” on the input tape are used to mark the processed values of 0 and 1, respectively. These symbols serve as indicators to confirm that the input symbols have been read successfully. For example: • When the machine reads “0”, it replaces it with “X”. • When it reads “1”, it replaces it with “Y”. For First Input “0” • Transition goes from initial state (q0) to state (q1) • The first symbol “0” of input tape is replaced by “X” • Read/Write Head goes to one position Right δ( q0 ,0 ) = (q1, X,R)
  • 19.
    Designing a TuringMachine Example 2: Construct a Turing machine for the language L= “010”. For Second Input “1” • Transition goes from state (q1) to state (q2) • The second symbol “1” of input tape is updated to “Y” • Read/Write Head Goes to one Position Right δ( q1 , 1 ) = ( q2, Y,R) For Third Input “0” • Transition goes from state (q2) to state (q3) • The third symbol “0” of input tape is updated to “X” • Read/Write Head Goes to one Position Right δ( q2 ,0 ) = (q3, X,R) For First Special Symbol “$” • Transition goes from state (q3) to state (q4), which is the accepting state. • The special symbol “$” of the input tape remains unchanged and the same as “$” • Read/Write Head moves one position right. δ( q3 , $) = (q4, $, R)
  • 20.
    Designing a TuringMachine Example 2: Construct a Turing machine for the language L= “010”. Other than “010” all other strings are rejected. All possible path for each input (0,1 and $) at each state is shown in the fig. ID for 010 : q0w |- q0010 |- Xq1 10 |- XYq20 |- XYXq3$ |- XYX$q4$ As q4 is in F, w is accepted.
  • 21.
    Designing a TuringMachine Example 3: Design a Turing Machine which recognizes the language L = where N>=0. Given language (L = ) will generate equal number of 0’s and 1’s. So, consider an input-tape which hold L=”000111” as shown below An algorithm for the above language in Turing Machine to accept is given below: Step 01: Change “0” to “X” Step 02: Move Right to First “1”.If no “1” found, then simply reject the language Step 03: Change “1” to “Y” Step 04: Move Left to Leftmost “0” Step 05: Repeat Steps 01 to 04 until no more “0” and “1” remain in the input tape. According to Step 01, for the first Input “0” • Transition goes from initial state (q0) to state (q1). • The first symbol “0” of input tape is updated to “X” • Read/Write Head Move to One position Right
  • 22.
    Designing a TuringMachine Example 3: Design a Turing Machine which recognizes the language L = where N>=0. According to Steps 2 and 3, R/W Head moves to the right to update the first “1” on the right side of the input Tape • Transition goes from state (q1) to state (q2). • The symbol “1” of the input tape is updated to “Y” • R/W Head Move one Position Left to update the Leftmost “0” in the next. At q1, transition will remain in the same state for input “0” as shown in the fig According to Step 4 and 01, Move Left to the Leftmost “0” and update it to “X”, as • Transition goes from state (q2) to state (q0) for input “X” • The Leftmost “0” of input tape is updated to “X” • After Update Leftmost “0” to “X”, R/W head move to Right for upcoming “1” updating
  • 23.
    Designing a TuringMachine Example 3: Design a Turing Machine which recognizes the language L = where N>=0. Again, according to Step 2 and 3, R/W Head Move to Right To update first “1” in right side of input tape. Input tape and Turing machine transition diagram are shown in the fig. Again, According To Step 4 and 01, Move Left to Leftmost “0” and update it to “X”, As given below Transition goes from state (q2) to state (q0) for input “X” • The Leftmost “0” of input tape is updated to “X” • After Update Leftmost “0” to “X”, R/W head move to Right for upcoming “1” updating
  • 24.
    Designing a TuringMachine Example 3: Design a Turing Machine which recognizes the language L = where N>=0. Again, According to Step 2 and 3 R/W Head Move to Right To update first “1” in right side of input tape At this point, • all the 0’s and 1’s are updated with X and Y respectively in input tape. • Current State is q2 and R/W head is moving toward Left of each input “Y” • As X input occur, state goes to q0 and R/W Head moves toward Right. • By consuming all input “Y”, state will be q3. • As first special symbol “$” occur, state goes to final state (q4) and R/W head will point the last symbol of considered language. Note: For Special symbol (“$”) at state q0, language is accepted. Final set of transitions are: δ( q0 , 0) = (q1, X, R) δ( q1 , Y) = (q1, Y, R) δ( q1 , 0) = (q1, 0, R) δ q1 , 1) = (q2, Y, L) δ( q2 , 0) = (q2, 0, L) δ( q2 , Y) = (q2, Y, L) δ( q2 , X) = (q0, X, R) δ( q0 , Y) = (q3, Y, R) δ( q3 , Y) = (q3, Y, R) δ( q3 , $) = (q4, $, L) δ( q0 , $) = (q4, $, L)
  • 25.
    Designing a TuringMachine Example 3: Design a Turing Machine which recognizes the language L = where N>=0. The particular input ‘0011’ gives the following successive instantaneous descriptions. q00011├ Xq1011 using δ(q0,0) = (q1,X, R) ├ X0q111 using δ(q1,0) = (q1,0, R) ├ Xq20Y1 using δ(q1,1) = (q2,Y, L) ├ q2X0Y1 using δ(q2,0) = (q2,0,L) ├ Xq00Y1 using δ(q2,X) = (q0,X,R) ├ XXq1Y1 using δ(q0,0) = (q1,X, R) ├ XXYq11 using δ(q1,Y)= (q1,Y,R) ├ XXq2YY using δ(q1,1) = (q2,Y, L) ├ Xq2XYY using δ(q2,Y) = (q2,Y,L) ├ XXq0YY using δ(q2,X) = (q0, X, R) ├ XXYq3Y using δ(q0,Y) = (q3, Y, R) ├ XXYYq3$ using δ(q3,Y) = (q3, Y, R) ├ XXYYq4$ using δ(q3, $) = (q4, $, L) ACCEPT!! Final set of transitions are: δ( q0 , 0) = (q1, X, R) δ( q1 , Y) = (q1, Y, R) δ( q1 , 0) = (q1, 0, R) δ q1 , 1) = (q2, Y, L) δ( q2 , 0) = (q2, 0, L) δ( q2 , Y) = (q2, Y, L) δ( q2 , X) = (q0, X, R) δ( q0 , Y) = (q3, Y, R) δ( q3 , Y) = (q3, Y, R) δ( q3 , $) = (q4, $, L) δ( q0 , $) = (q4, $, L)
  • 26.
    Designing a TuringMachine Example 4: Design a Turing Machine which recognizes the language L = where N>0 Algorithm For Language Algorithm for above language in Turing Machine to Accept is given below • Step 01: Change “a” to “X” • Step 02: Move Right to First “b”. If “b” found then Change “b” to “Y” otherwise simply reject the language. • Step 03: Move Right to First “c”. If “c” found then Change “c” to “Z” otherwise simply reject the language. • Step 04: Move Left to Leftmost “a” • Step 05: Repeat Step 01 to 04 until no more “a”, “b” and “c” remain in the input tape. Let us construct the Turing Machine for the language considering the string “aabbcc”.
  • 27.
    Designing a TuringMachine Example 5: Design a TM to accept even length palindromes over the alphabet {a, b}. • Match the first and last element and erase them and go on doing the same. Once we reach epsilon without any mismatch then the string is even-length palindrome. • For an even-length palindrome a TM is defined after the machine runs and erases the first and last element without encountering a mismatch. Later on the turing machine accepts the string and the string is even-length palindrome. Algorithm for Even Palindromes • Step 01: Replace first leftmost symbol with Blank symbol “$”. • Step 02: Replace rightmost symbol with Blank symbol “$”. • Step 03: repeat above both steps (1&2) until all symbols are replaced with “$”
  • 28.
    Designing a TuringMachine Practice Questions: 1. Design a TM to accept odd length palindromes over the alphabet {a, b}. 2. Design a TM to accept the language L = { | n >=0} 3. Design a TM to accept the language L = {| i x j = k and i, j, k ≥1} 4. Construct a Turing machine to concatenate two unary strings 5. Construct Turing machine that finds the 1s complement of a given binary number
  • 29.
    Variants of TuringMachine 1. Multi-tape Turing Machine 2. Multi-head Turing Machine 3. Multi-track Turing Machine 4. Semi-infinite Turing Machine 5. Universal Turing Machine 6. K-dimensional Turing Machine 7. Non-Deterministic Turing Machine 8. Alternating Turing machine 9. Unambiguous Turing Machine 10. Quantum Turing Machine 11. Read-Only Turing Machine 12. Probabilistic Turing Machine Basic TM is equivalent to all the above
  • 30.
    Variants of TuringMachine 1. Multi-tape Turing Machine Multi-tape Turing machine is an extension of the standard Turing machine where • multiple tapes are available for input, output, and computation, • each tape has its own read-write head, and • the machine's transition function is based on the current state and the symbols read by each head. • In the beginning, the input is only on the first tape while the rest of the tapes remain blank. In the next step, the machine reads consecutive symbols under its head and prints a symbol on each tape then shifts its head. Example 1: Check if a binary string is a palindrome. Step 1: Copy the input string from Tape 1 to Tape 2. Step 2: Move the head on Tape 1 from left to right to read the input. Step 3: Simultaneously, move the head on Tape 2 from left to right to copy the input. Step 4: Compare symbols by moving the head on Tape 1 from left to right and the head on Tape 2 from right to left. Check: If all corresponding symbols match, the string is a palindrome. Advantage: This approach reduces time complexity compared to a single-tape Turing machine.
  • 31.
    Variants of TuringMachine 2. Multi-head Turing Machine • A single tape is used, but it has multiple read-write heads. • These heads can independently read and write symbols, enabling the machine to perform complex tasks more efficiently. • If multiple heads attempt to write different symbols to the same cell, a priority system determines which head's action is executed. • If a head tries to move left beyond the leftmost cell, a special condition known as "hanging" occurs, which needs to be handled. • The multi-head Turing machine, like the multi-tape machine, can be converted to an equivalent single-head machine, although the process may be more complex. Example 1: Check if a string is a palindrome. The heads start at both ends of the string and move towards each other, checking if the corresponding symbols are identical.
  • 32.
    Variants of TuringMachine 3. Multi-track Turing Machine • A specific type of Multi-tape Turing machine, contain multiple tracks but just one tape head reads and writes on all tracks. • A single tape head reads n symbols from n tracks at one step. • It accepts recursively enumerable languages like a normal single-track single-tape Turing Machine accepts.
  • 33.
    Variants of TuringMachine 4. Semi-infinite Turing Machine • Such machines have left ends limited by an end marker and an infinite right end. They have two tracks, that is, • a upper track that represents cells to the right of the initial head position and • a lower track that represents cells to the left of the initial head position in reverse order. • The machine starts from a state q0 and scans from the left end marker. At each step it reads the symbol on the tape under its head then writes a new symbol on that tape and shifts the head to the left or right of one tape cell. • A transition function determines the actions to be taken. • Semi-infinite machines have two special states, the accept and reject states. • The accept state means that the input is accepted and the reject state means that input is rejected when the machine enters that state. In other cases, the machine will continue infinitely without any rejections or acceptances for certain inputs.
  • 34.
    Variants of TuringMachine 5. Universal Turing Machine • This is a type of Turing machine that simulates an arbitrary Turing machine on an arbitrary input. • It does this by having three pieces of information for the machine it is simulating: • the first is the basic description of the machine to be simulated, • the second is the input to that machine's tape, • and finally the internal state of the machine. • It controls the machine by changing its state based on the input.
  • 35.
    Variants of TuringMachine 6. K-dimensional Turing Machine • A K-dimensional Turing machine extends the concept of the tape to multiple dimensions. • Example: A two-dimensional Turing machine having a tape that extends infinitely in both the X and Y directions. • In a two-dimensional Turing machine, the read-write head can move not only left and right but also up and down. • This added flexibility allows the machine to process more complex data structures, such as matrices or grids. • This type of Turing machine is ideal for tasks that naturally fit a multi-dimensional space, such as image processing or simulations of physical phenomena.
  • 36.
    Variants of TuringMachine 7. Non-Deterministic Turing Machine • It can transition into multiple possible states from a given state and symbol. Instead of following a single path, the NDTM can explore many computational paths simultaneously. • Computations of such machines form a tree of configurations that are reachable from the start configuration and therefore input is accepted if there is at least one node in the tree that is an accept configuration otherwise the input is not accepted. Example Consider the language L = {0n 1m } where n and m are not necessarily equal. An NDTM can non- deterministically choose how many 0's and 1's to match, accepting the string if it satisfies the condition. Every non-deterministic Turing machine has an equivalent deterministic Turing machine. The deterministic version simulates all possible paths of the NDTM and accepts the string if any path leads to an accepting state.
  • 37.
    Variants of TuringMachine 8. Alternating Turing machine • This is an NDTM that accepts computations that generalize rules used in the definition of complexity classes of NP and Co-NP. • Its states are divided into two sets namely existential and universal states. The former is accepting if a transition leads to an accepting state while the latter is accepting if every transition leads to an accepting state. 9. Unambiguous Turing Machine • This is a special type of NDTM where for each input, there is exactly a single possible computation. In many ways, it is similar to a deterministic Turing machine. 10. Quantum Turing Machine • Also referred to as a universal quantum computer. It is an abstract machine that models the effects of a quantum computer by providing a simple model that covers the power of quantum computation. • Any quantum algorithm can be expressed formally as a quantum Turing machine.
  • 38.
    Variants of TuringMachine 11. Read-Only Turing Machine • Also referred to as a two-way deterministic finite-state automaton. It is a class of models of computability that behave like a standard Turing machine and move in both directions across a given input • It cannot write to the input tape, only read it. • In its bare form, it is similar to a deterministic finite-state machine in computational power and therefore only parses regular languages. 12. Probabilistic Turing Machine • A Turing machine that is modified to execute randomized computations. These machines make decisions based on the outcomes of unbiased coin tosses. • Every NDTM can be simulated by a probabilistic Turing machine with a small error of probability. • Also unlike deterministic Turing machines, they have stochastic results whereby on a given input and instruction state machine, it can have different run times or may not halt at all, furthermore, it may accept input in one execution and reject the same input in another execution. • Common applications of such machines are modeling a robot that handles accidents in a nuclear plant or modeling space missions that have strong radiations.
  • 39.
    15/09/2025 07:11 AM By:Dr. Monali Bordoloi, Asst. Prof. Sr. Gra de 1, VIT-AP 39

Editor's Notes

  • #3 What does this PDA do? What language does it recognize? Starts by pushing $, then it pushes letters on the stack as it reads them. At some point it nondeterministically moves to q2, and starts popping letters. Finally it accepts if it sees $ precisely when its input has run out. “noon” , “otto”, “zeus sees suez”
  • #4 What does this PDA do? What language does it recognize? Starts by pushing $, then it pushes letters on the stack as it reads them. At some point it nondeterministically moves to q2, and starts popping letters. Finally it accepts if it sees $ precisely when its input has run out. “noon” , “otto”, “zeus sees suez”
  • #5 What does this PDA do? What language does it recognize? Starts by pushing $, then it pushes letters on the stack as it reads them. At some point it nondeterministically moves to q2, and starts popping letters. Finally it accepts if it sees $ precisely when its input has run out. “noon” , “otto”, “zeus sees suez”
  • #6 What does this PDA do? What language does it recognize? Starts by pushing $, then it pushes letters on the stack as it reads them. At some point it nondeterministically moves to q2, and starts popping letters. Finally it accepts if it sees $ precisely when its input has run out. “noon” , “otto”, “zeus sees suez”
  • #7 What does this PDA do? What language does it recognize? Starts by pushing $, then it pushes letters on the stack as it reads them. At some point it nondeterministically moves to q2, and starts popping letters. Finally it accepts if it sees $ precisely when its input has run out. “noon” , “otto”, “zeus sees suez”
  • #8 What does this PDA do? What language does it recognize? Starts by pushing $, then it pushes letters on the stack as it reads them. At some point it nondeterministically moves to q2, and starts popping letters. Finally it accepts if it sees $ precisely when its input has run out. “noon” , “otto”, “zeus sees suez”
  • #9 What does this PDA do? What language does it recognize? Starts by pushing $, then it pushes letters on the stack as it reads them. At some point it nondeterministically moves to q2, and starts popping letters. Finally it accepts if it sees $ precisely when its input has run out. “noon” , “otto”, “zeus sees suez”
  • #10 What does this PDA do? What language does it recognize? Starts by pushing $, then it pushes letters on the stack as it reads them. At some point it nondeterministically moves to q2, and starts popping letters. Finally it accepts if it sees $ precisely when its input has run out. “noon” , “otto”, “zeus sees suez”
  • #11 What does this PDA do? What language does it recognize? Starts by pushing $, then it pushes letters on the stack as it reads them. At some point it nondeterministically moves to q2, and starts popping letters. Finally it accepts if it sees $ precisely when its input has run out. “noon” , “otto”, “zeus sees suez”
  • #12 What does this PDA do? What language does it recognize? Starts by pushing $, then it pushes letters on the stack as it reads them. At some point it nondeterministically moves to q2, and starts popping letters. Finally it accepts if it sees $ precisely when its input has run out. “noon” , “otto”, “zeus sees suez”
  • #13 What does this PDA do? What language does it recognize? Starts by pushing $, then it pushes letters on the stack as it reads them. At some point it nondeterministically moves to q2, and starts popping letters. Finally it accepts if it sees $ precisely when its input has run out. “noon” , “otto”, “zeus sees suez”
  • #14 What does this PDA do? What language does it recognize? Starts by pushing $, then it pushes letters on the stack as it reads them. At some point it nondeterministically moves to q2, and starts popping letters. Finally it accepts if it sees $ precisely when its input has run out. “noon” , “otto”, “zeus sees suez”
  • #15 What does this PDA do? What language does it recognize? Starts by pushing $, then it pushes letters on the stack as it reads them. At some point it nondeterministically moves to q2, and starts popping letters. Finally it accepts if it sees $ precisely when its input has run out. “noon” , “otto”, “zeus sees suez”
  • #16 What does this PDA do? What language does it recognize? Starts by pushing $, then it pushes letters on the stack as it reads them. At some point it nondeterministically moves to q2, and starts popping letters. Finally it accepts if it sees $ precisely when its input has run out. “noon” , “otto”, “zeus sees suez”
  • #17 What does this PDA do? What language does it recognize? Starts by pushing $, then it pushes letters on the stack as it reads them. At some point it nondeterministically moves to q2, and starts popping letters. Finally it accepts if it sees $ precisely when its input has run out. “noon” , “otto”, “zeus sees suez”
  • #18 What does this PDA do? What language does it recognize? Starts by pushing $, then it pushes letters on the stack as it reads them. At some point it nondeterministically moves to q2, and starts popping letters. Finally it accepts if it sees $ precisely when its input has run out. “noon” , “otto”, “zeus sees suez”
  • #19 What does this PDA do? What language does it recognize? Starts by pushing $, then it pushes letters on the stack as it reads them. At some point it nondeterministically moves to q2, and starts popping letters. Finally it accepts if it sees $ precisely when its input has run out. “noon” , “otto”, “zeus sees suez”
  • #20 What does this PDA do? What language does it recognize? Starts by pushing $, then it pushes letters on the stack as it reads them. At some point it nondeterministically moves to q2, and starts popping letters. Finally it accepts if it sees $ precisely when its input has run out. “noon” , “otto”, “zeus sees suez”
  • #21 What does this PDA do? What language does it recognize? Starts by pushing $, then it pushes letters on the stack as it reads them. At some point it nondeterministically moves to q2, and starts popping letters. Finally it accepts if it sees $ precisely when its input has run out. “noon” , “otto”, “zeus sees suez”
  • #22 What does this PDA do? What language does it recognize? Starts by pushing $, then it pushes letters on the stack as it reads them. At some point it nondeterministically moves to q2, and starts popping letters. Finally it accepts if it sees $ precisely when its input has run out. “noon” , “otto”, “zeus sees suez”
  • #23 What does this PDA do? What language does it recognize? Starts by pushing $, then it pushes letters on the stack as it reads them. At some point it nondeterministically moves to q2, and starts popping letters. Finally it accepts if it sees $ precisely when its input has run out. “noon” , “otto”, “zeus sees suez”
  • #24 What does this PDA do? What language does it recognize? Starts by pushing $, then it pushes letters on the stack as it reads them. At some point it nondeterministically moves to q2, and starts popping letters. Finally it accepts if it sees $ precisely when its input has run out. “noon” , “otto”, “zeus sees suez”
  • #25 What does this PDA do? What language does it recognize? Starts by pushing $, then it pushes letters on the stack as it reads them. At some point it nondeterministically moves to q2, and starts popping letters. Finally it accepts if it sees $ precisely when its input has run out. “noon” , “otto”, “zeus sees suez”
  • #26 What does this PDA do? What language does it recognize? Starts by pushing $, then it pushes letters on the stack as it reads them. At some point it nondeterministically moves to q2, and starts popping letters. Finally it accepts if it sees $ precisely when its input has run out. “noon” , “otto”, “zeus sees suez”
  • #27 What does this PDA do? What language does it recognize? Starts by pushing $, then it pushes letters on the stack as it reads them. At some point it nondeterministically moves to q2, and starts popping letters. Finally it accepts if it sees $ precisely when its input has run out. “noon” , “otto”, “zeus sees suez”
  • #28 What does this PDA do? What language does it recognize? Starts by pushing $, then it pushes letters on the stack as it reads them. At some point it nondeterministically moves to q2, and starts popping letters. Finally it accepts if it sees $ precisely when its input has run out. “noon” , “otto”, “zeus sees suez”
  • #29 What does this PDA do? What language does it recognize? Starts by pushing $, then it pushes letters on the stack as it reads them. At some point it nondeterministically moves to q2, and starts popping letters. Finally it accepts if it sees $ precisely when its input has run out. “noon” , “otto”, “zeus sees suez”
  • #30 What does this PDA do? What language does it recognize? Starts by pushing $, then it pushes letters on the stack as it reads them. At some point it nondeterministically moves to q2, and starts popping letters. Finally it accepts if it sees $ precisely when its input has run out. “noon” , “otto”, “zeus sees suez”
  • #31 What does this PDA do? What language does it recognize? Starts by pushing $, then it pushes letters on the stack as it reads them. At some point it nondeterministically moves to q2, and starts popping letters. Finally it accepts if it sees $ precisely when its input has run out. “noon” , “otto”, “zeus sees suez”
  • #32 What does this PDA do? What language does it recognize? Starts by pushing $, then it pushes letters on the stack as it reads them. At some point it nondeterministically moves to q2, and starts popping letters. Finally it accepts if it sees $ precisely when its input has run out. “noon” , “otto”, “zeus sees suez”
  • #33 What does this PDA do? What language does it recognize? Starts by pushing $, then it pushes letters on the stack as it reads them. At some point it nondeterministically moves to q2, and starts popping letters. Finally it accepts if it sees $ precisely when its input has run out. “noon” , “otto”, “zeus sees suez”
  • #34 What does this PDA do? What language does it recognize? Starts by pushing $, then it pushes letters on the stack as it reads them. At some point it nondeterministically moves to q2, and starts popping letters. Finally it accepts if it sees $ precisely when its input has run out. “noon” , “otto”, “zeus sees suez”
  • #35 What does this PDA do? What language does it recognize? Starts by pushing $, then it pushes letters on the stack as it reads them. At some point it nondeterministically moves to q2, and starts popping letters. Finally it accepts if it sees $ precisely when its input has run out. “noon” , “otto”, “zeus sees suez”
  • #36 What does this PDA do? What language does it recognize? Starts by pushing $, then it pushes letters on the stack as it reads them. At some point it nondeterministically moves to q2, and starts popping letters. Finally it accepts if it sees $ precisely when its input has run out. “noon” , “otto”, “zeus sees suez”
  • #37 What does this PDA do? What language does it recognize? Starts by pushing $, then it pushes letters on the stack as it reads them. At some point it nondeterministically moves to q2, and starts popping letters. Finally it accepts if it sees $ precisely when its input has run out. “noon” , “otto”, “zeus sees suez”
  • #38 What does this PDA do? What language does it recognize? Starts by pushing $, then it pushes letters on the stack as it reads them. At some point it nondeterministically moves to q2, and starts popping letters. Finally it accepts if it sees $ precisely when its input has run out. “noon” , “otto”, “zeus sees suez”