TOC Chapter 5
TOC Chapter 5
COMPUTATION
Subject Code: 3160704
Nidhi S. Periwal
CKPCET, Surat
Chapter-5
Turing Machine (TM)
Topics: TM Definition, Model Of Computation, Turing Machine as Language Acceptor, TM that Compute Partial
Function, Church Turing Thesis, Combining TM, Variations Of TM, Non Deterministic TM, Universal TM, Recursively
and Enumerable Languages, Context sensitive languages and Chomsky hierarchy.
GTU ASKED QUESTIONS
● What is Turing machine? Explain its capabilities.
● Explain Church Turing thesis.
● Design a Turing machine to copy a string.
● Explain Universal Turing machine
● Design a Turing machine to delete a symbol.
● Develop a Turing Machine to accept palindromes over {a,b}*
● Develop a Turing Machine to accept the language L = {X / Na(X)=Nb(X) , X ∈
{a,b}*}
● Discuss universal turing machine with example.
● Write down 7-tuple definition for the turing machine.
● Construct the turing machine and its transition table over Σ = {a,b} for the
language L = {an bn/ n>=1}.
Turing Machine
● A Turing machine is a mathematical model of computation describing an abstract machine that manipulates
symbols on a strip of tape according to a table of rules.
● Turing Machine was invented by Alan Turing in 1936 and it is used to accept Recursive Enumerable
Languages (generated by Type-0 Grammar).
● The machine operates on an infinite memory tape divided into discrete cells each of which can hold a
single symbol drawn from a finite set of symbols called the alphabet of the machine.
● A Turing Machine is a general model of computation is simply to say that any algorithmic procedure that can
be carried out at all can be carried out by a turing machine- Church’s Thesis - in - 1930s
● A Turing machine is an abstract computational model that performs computations by reading and writing to an
infinite tape. Turing machines provide a powerful computational model for solving problems in
computer science and testing the limits of computation.
● Turing Machine was invented by Alan Turing in 1936 and it is used to accept Recursive Enumerable
Languages (generated by Type-0 Grammar).
● A Turing machine is a finite automaton that can read, write, and erase symbols on an infinitely long tape.
● The Turing machine can only read one symbol at a time, and it uses a set of rules (the transition function)
to determine its next action based on the current state and the symbol it is reading.
Computation using Turing Machine
● The Turing machine’s behavior is determined by a finite state machine, which consists of a finite set
of states, a transition function that defines the actions to be taken based on the current state and the
symbol being read, and a set of start and accept states.
● The Turing machine begins in the start state and performs the actions specified by the transition
function until it reaches an accept or reject state.
● If it reaches an accept state, the computation is considered successful; if it reaches a reject state,
the computation is considered unsuccessful.
Turing Machine (TM)- Defination
TM
● If we are in a state and read a letter that offers no choice of path to another
state, we crash; that means we terminate execution unsuccessfully. To
terminate execution of a certain input successfully – HALT state.
● The word on the input TAPE is then said to be accepted by the TM.
● A crash also occurs when we are in the first cell on the TAPE and try to
move the TAPE HEAD left.
Turing machines are Deterministic
● By definition, all Turing machines are deterministic. This means that there is
no state q that has two or more edges leaving it labeled with the same first
letter.
● For example,
Turing Machine - (a+b)b(a+b)*
Turing Machine - (a+b)b(a+b)*
Eg: input aba execution over TM
Eg: input aba execution over TM
Eg: input aba execution over TM
TM for {anbn}
TM for {anbn}
INPUT : aabb
TM for PALINDROME
Draw a Turing machine to find 1’s complement of a binary number.
Approach:
Steps:
● Step-1. Convert all 0’s into 1’s and all 1’s into 0’s
and go right if B is found go to left.
● Step-2. Then ignore 0’s and 1’s and go left & if B
found go to right
● Step-3. Stop the machine.
Explanation:
● State q0 replace ‘1’ with ‘0’ and ‘0’ with ‘1’ and move to right.
● When BLANK is reached move towards left.
● Using state ‘q2’ we reach start of the string.
● When BLANK is reached move towards right and reaches the final state q2.
Draw a Turing machine to find 2’s complement of a binary number.
Explanation:
In 1936, A method named as lambda-calculus was created by Alonzo Church in which the Church numerals are well defined,
i.e. the encoding of natural numbers. Also in 1936, Turing machines (earlier called theoretical model for machines) was created
by Alan Turing, that is used for manipulating the symbols of string with the help of tape.
Church’s Turing thesis say that “Every computation that can be carried out in the real world can be
effectively performed by a Turing Machine.”
https://www.hse.ru/mirror/pubs/share/216440737#:~:text=A%20partial%20function%20can%20be,TM%20S%20that%
20simulates%20M.