0% found this document useful (0 votes)
15 views50 pages

TOC Chapter 5

Uploaded by

rashibhagat2202
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views50 pages

TOC Chapter 5

Uploaded by

rashibhagat2202
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 50

THEORY OF

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:

1. Scanning input string from left to right


2. Converting 1’s into 0’s
3. Converting 0’s into 1’s
4. Move the head to the start when BLANK is
reached.

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:

● Using state ‘q0’ we reach end of the string.


● When BLANK is reached move towards left.
● Using state ‘q1’ we passes all 0’s and move left first 1 is found.
● Pass single ‘1’ and move left.
● Using state ‘q2’ we complement the each digit and move left.
● When BLANK is reached move towards right and reaches the final state q2.
Variants of Turing Machine
Comparison between Pushdown Automata and Turing Machine

● Pushdown Automata is not Deterministic where as Turing Machine is Deterministic in nature.


● A Pushdown Automata can access only top of the stack as it works on the Last In First Out(LIFO) concept where as the
Turing Machine can access any position on the infinite tape.
● As the infinite tape cannot be simulated with a single stack, hence Pushdown Automata becomes less computationally
powerful and also there are algorithms that can be programmed with a Turing Machine that cannot be programmed with a
Pushdown Automata.
● Pushdown Automata is used for designing the parsing phase of a compiler in Syntax Analysis. Turing Machine is used for
implementation in Neural Networks.
● The popular Tower of Hanoi Problem is solved using the Pushdown Automata. Turing Machine has got applications in the
field of Artificial Intelligence and Robotics.
● All the applications in which is stack is involved are done using Pushdown Automata and it is also helpful in solving
arithmetic expressions. Turing Machine is very helpful in understanding complexity theory.
Church’s Thesis for Turing Machine

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 Turing Thesis :


Turing machine is defined as an abstract representation of a computing device such as hardware in computers. Alan Turing
proposed Logical Computing Machines (LCMs), i.e. Turing’s expressions for Turing Machines. This was done to define algorithms
properly. So, Church made a mechanical method named as ‘M’ for manipulation of strings by using logic and mathematics. This
method M must pass the following statements:
● Number of instructions in M must be finite.
● Output should be produced after performing finite number of steps.
● It should not be imaginary, i.e. can be made in real life.
● It should not require any complex understanding.
Church’s Thesis for Turing Machine

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.”

The recursive functions can be computable after taking following assumptions:


1. Each and every function must be computable.
2. Let ‘F’ be the computable function and after performing some elementary operations to ‘F’, it will
transform a new function ‘G’ then this function ‘G’ automatically becomes the computable function.
3. If any functions that follow above two assumptions must be states as computable function.
Recursively Enumerable Language
References
Book : Daniel Cohen, Introduction to Computation theory
Book : J Martin, Introduction to the Theory of Computation, 3rd ed.
https://www.youtube.com/watch?v=GPSk9tRsK2I
https://www.youtube.com/watch?v=ce2hfGH3ysc- Design of Turing Machine to copy a string

https://www.youtube.com/watch?v=ps83VJlzQL8 - for 1 and 2’s complement

https://www.hse.ru/mirror/pubs/share/216440737#:~:text=A%20partial%20function%20can%20be,TM%20S%20that%
20simulates%20M.

You might also like