SlideShare a Scribd company logo
1 of 40
M. S. Ramaiah School of Advanced Studies 1
CSN2505 AFM Presentation
Turing Machine
Anshuman Biswal
PT 2012 Batch, Reg. No.: CJB0412001
M. Sc. (Engg.) in Computer Science and Networking
Module Leader: Dr. Hariharan Ramasangu
Module Name: Applied Formal Methods
Module Code : CSN2505
M. S. Ramaiah School of Advanced Studies 2
Marking
Head Maximum Score
Technical Content 10
Grasp and Understanding 10
Delivery – Technical and
General Aspects
10
Handling Questions 10
Total 40
M. S. Ramaiah School of Advanced Studies 3
Presentation Outline
• Introduction and Historical background
• Historical Background-TM in WW-II
• A Thinking machine-Successor Program Example
• Turing Machine
• Turing Machine Formal Definition and Description
• Turing Machine Transition Functions
• Turing Machine Instantaneous Description and Move
• Turing Machine Example
• Turing Machine Variants
• Conclusion
• Referenses
M. S. Ramaiah School of Advanced Studies 4
Introduction and Historical Background
• The desire to capture the complexities of mathematical reasoning and
computation in a simple and powerful manner has been a major theme
of 20th Century mathematics.
• The 1930’s saw two of these great negative results in the foundations
of mathematics, the first of which was Godel’s very unexpected proof
of 1931 (Godel’s Incompleteness Theorem).
• 1936 saw the independent development of three influential models of
computation :lambda calculus, recursive functions and Turing
machines.
• Alonzo Church’s lambda calculus and Steven Kleene’s recursive
functions were arguably more elegant in this respect, but it was the
mechanical action of Turing’s machines that most agreed with
intuitions about how people go about computing mathematical
functions.
M. S. Ramaiah School of Advanced Studies 5
• 1936-Alan Turing a British cryptologist invented a mechanical device,
which from that day forth was called the “Turing machine”.
• Based on Turing’s prior thoughts and ideas, his invention was able to
compute every given mathematical expression .
• It only consists of three main components: A tape (e.g. paper) that can
hold data and serves as some kind of memory,a head that can read data
from or write data to the tape and finally an application, which controls
the whole process.
• The Turing machine addresses two major problems of theoretical
computer science, namely the decision problem and the halting
problem.
Introduction and Historical Background
M. S. Ramaiah School of Advanced Studies 6
• In 1936 Alan Turing was member of the Royal Army
and worked in the British codebreaking centre, located at
Bletchley Park in South East England.
• His major task during World War II was breaking the
Enigma, a device that was used by the Germans, in order
to encode military messages. At least two different
versions of the Enigma were commonly used at wartime:
On the one hand the so-called “Wehrmachts-Enigma”
and on the other hand a naval edition, which was primary
used by German warships and submarines
Historical Background-TM in WW-II
M. S. Ramaiah School of Advanced Studies 7
• Alan Turing made use of terms and phrases that were
frequently used in German military so-called “cribs”.
• He searched certain patterns and tried to understand the
encoding algorithm. However a single message could be
interpreted in more than 150 quadrillion ways (>
150,000,000,000,000 or 150 * 10¹²).
• British scientists made use of technical support. They used a
cluster of four Turing machines which could successfully
decode a secret message within several hours and thus was a
huge advantage for the Royal British Army in their battle
against Nazi Germany. This machine is called the “Turing
Bombe”.
Historical Background-TM in WW-II
M. S. Ramaiah School of Advanced Studies 8
A Thinking Machine-Successor Program
Imagine a super-organized, obsessive-compulsive human computer.
The computer wants to avoid mistakes so everything written down is
completely specified one letter/number at a time. The computer
follows a finite set of rules which are referred to every time another
symbol is written down. Rules are such that at any given time, only
one rule is active so no ambiguity can arise. Each rule activates
another rule depending on what letter/number is currently read, EG:
Sample Rules:
If read 1, write 0, go right, repeat.
If read 0, write 1, HALT!
If read •, write 1, HALT!
Let’s see how they are carried out on a piece of paper that contains
the reverse binary representation of 47:
M. S. Ramaiah School of Advanced Studies 9
If read 1, write 0, go right, repeat.
If read 0, write 1, HALT!
If read •, write 1, HALT!
1 1 1 1 0 1
A Thinking Machine-Successor Program
M. S. Ramaiah School of Advanced Studies 10
If read 1, write 0, go right, repeat.
If read 0, write 1, HALT!
If read •, write 1, HALT!
0 1 1 1 0 1
A Thinking Machine-Successor Program
M. S. Ramaiah School of Advanced Studies 11
If read 1, write 0, go right, repeat.
If read 0, write 1, HALT!
If read •, write 1, HALT!
0 0 1 1 0 1
A Thinking Machine-Successor Program
M. S. Ramaiah School of Advanced Studies 12
If read 1, write 0, go right, repeat.
If read 0, write 1, HALT!
If read •, write 1, HALT!
0 0 0 1 0 1
A Thinking Machine-Successor Program
M. S. Ramaiah School of Advanced Studies 13
If read 1, write 0, go right, repeat.
If read 0, write 1, HALT!
If read •, write 1, HALT!
0 0 0 0 0 1
A Thinking Machine-Successor Program
M. S. Ramaiah School of Advanced Studies 14
If read 1, write 0, go right, repeat.
If read 0, write 1, HALT!
If read •, write 1, HALT!
0 0 0 0 1 1
A Thinking Machine-Successor Program
M. S. Ramaiah School of Advanced Studies 15
So the successor’s output on 111101 was
000011 which is the reverse binary
representation of 48.
Similarly, the successor of 127 should be 128:
A Thinking Machine-Successor Program
M. S. Ramaiah School of Advanced Studies 16
If read 1, write 0, go right, repeat.
If read 0, write 1, HALT!
If read •, write 1, HALT!
1 1 1 1 1 1 1
A Thinking Machine-Successor Program
M. S. Ramaiah School of Advanced Studies 17
If read 1, write 0, go right, repeat.
If read 0, write 1, HALT!
If read •, write 1, HALT!
0 1 1 1 1 1 1
A Thinking Machine-Successor Program
M. S. Ramaiah School of Advanced Studies 18
If read 1, write 0, go right, repeat.
If read 0, write 1, HALT!
If read •, write 1, HALT!
0 0 1 1 1 1 1
A Thinking Machine-Successor Program
M. S. Ramaiah School of Advanced Studies 19
If read 1, write 0, go right, repeat.
If read 0, write 1, HALT!
If read •, write 1, HALT!
0 0 0 1 1 1 1
A Thinking Machine-Successor Program
M. S. Ramaiah School of Advanced Studies 20
If read 1, write 0, go right, repeat.
If read 0, write 1, HALT!
If read •, write 1, HALT!
0 0 0 0 1 1 1
A Thinking Machine-Successor Program
M. S. Ramaiah School of Advanced Studies 21
If read 1, write 0, go right, repeat.
If read 0, write 1, HALT!
If read •, write 1, HALT!
0 0 0 0 0 1 1
A Thinking Machine-Successor Program
M. S. Ramaiah School of Advanced Studies 22
If read 1, write 0, go right, repeat.
If read 0, write 1, HALT!
If read •, write 1, HALT!
0 0 0 0 0 0 1
A Thinking Machine-Successor Program
M. S. Ramaiah School of Advanced Studies 23
If read 1, write 0, go right, repeat.
If read 0, write 1, HALT!
If read •, write 1, HALT!
0 0 0 0 0 0 0
A Thinking Machine-Successor Program
M. S. Ramaiah School of Advanced Studies 24
If read 1, write 0, go right, repeat.
If read 0, write 1, HALT!
If read •, write 1, HALT!
0 0 0 0 0 0 0 1
A Thinking Machine-Successor Program
M. S. Ramaiah School of Advanced Studies 25
It was hard for the ancients to believe that any
algorithm could be carried out on such a device.
For us, it’s much easier to believe, especially if
we’ve programmed in assembly!
However, ancients did finally believe Turing when
Church’s lambda-calculus paradigm (on which
lisp programming is based) proved equivalent!
A Thinking Machine
M. S. Ramaiah School of Advanced Studies 26
Turing Machines
A Turing Machine (TM) is a device with a finite
amount of read-only “hard” memory (states), and
an unbounded amount of read/write tape-memory.
There is no separate input. Rather, the input is
assumed to reside on the tape at the time when the
TM starts running.
M. S. Ramaiah School of Advanced Studies 27
TM Formal Definition
• DEF: A Turing machine (TM) consists of a
the 8-tuple: M = (Q, , Γ, δ, q0, B, qa, qr)
G is the tape alphabet which necessarily contains the
blank symbol •, as well as the input alphabet S. d is
as follows:
Therefore given a non-halt state p, and a tape symbol
x, d(p,x) = (q,y,D) means that TM goes into state q,
replaces x by y, and the tape head moves in
direction D.
}RL,{}),{-(:δ rejacc GG QQ qq
M. S. Ramaiah School of Advanced Studies 28
Turing Machine Description
• Q = finite states of the control , set of states
•  = finite set of input symbols, which is a subset of Γ below,
input alphabet
• Γ = finite set of tape symbols, tape alphabet
• δ = partial transition function. δ(q,X) are a state and tape
symbol X.
– The output is the triple, (p, Y, D)
– Where p = next state, Y = new symbol written on the tape, D =
direction to move the tape head
• q0= start state for finite control, initial state
• B = blank symbol. This symbol is in Γ but not in .
• qaccept = set of final or accepting states of Q.
• qreject = set of rejecting states of Q
M. S. Ramaiah School of Advanced Studies 29
TM Transition Functions
The transition function for Turing machines is
given by
}RL,{}),{-(:δ rejacc GG QQ qq
This means: When the machine is in a given state (Q) and reads a given
symbol (Γ) from the tape, it replaces the symbol on the tape with some
other symbol (Γ), goes to some other state (Q), and moves the tape head
one square left (L) or right (R)
M. S. Ramaiah School of Advanced Studies 30
TM Instantaneous description and Move
• An instantaneous description or configuration of a Turing machine
requires (1) the state the Turing machine is in, (2) the contents of the
tape, and (3) the position of the tape head on the tape. This can be
summarized in a string of the form
xi...xjqmxk...xl
where the x's are the symbols on the tape, qm is the current state, and the
tape head is on the square containing xk (the symbol immediately
following qm).
• A move of a Turing machine can therefore be represented as a pair of
instaneous descriptions, separated by the symbol " ├”.
For example, if (q5, b) = (q8, c, R)then a possible move might be
abbabq5babb ├ abbabcq8abb
M. S. Ramaiah School of Advanced Studies 31
TM Example
• Make a TM that recognizes the language L = { w#w | w  (0,1)* }. That
is, we have a language separated by a # symbol with the same string on
both sides.
• Here is a strategy we can employ to create the Turing machine:
– read the first symbol, then cross it out, and then, remember what that
symbol was, move until it reaches the #
– Then check to see if the symbols match, and if they do cross it off
and go back to the symbol after the one we crossed out,
– and then continue in this same manner, except going to the first non-
crossed off symbol in the transversals.
– Finally we need to make sure that we accept if this is all that the
input consists of.
• Here is a formal description of a Turing machine which does this
1. Q = {q1; q2; : : : q8; qa; qr}
2.  = {0,1,#} and G = {0, 1,x,#,_}
3. The start state is q1. The accept state is qa. The reject state is qr.
M. S. Ramaiah School of Advanced Studies 32
TM Example
And now we need to specify the transition function. We do this
with a state diagram.
M. S. Ramaiah School of Advanced Studies 33
• Now there are some points about this transition function which we
should point out. First of all where is the reject state qr? Well we have
obmitted it. Indeed we have followed a convention where every
allowed transition which is not labeled is a transition to qr.
•All rules should be of the form s → a, d where s, a ϵ G and d ϵ {L,R}
But some of these don't have an a, i.e. they are of the form
s → d. This is shorthand for the fact that the same symbol which is
on the tape is being written onto the tape, i.e. that symbol is not
changed. Finally we often write multiple elements which lead to the
transition separated via commas.
TM Example
M. S. Ramaiah School of Advanced Studies 34
TM Example- Instantaneous Description
• Sometimes it is useful to describe what a TM does in terms of its ID
(instantaneous description.)
• The ID shows all non-blank cells in the tape, pointer to the cell the head is
over with the name of the current state
– use the turnstile symbol ├ to denote the move.
– As before, to denote zero or many moves, we can use ├*.
• Let's run through how this machine acts on an input. Lets do 010#010.
M. S. Ramaiah School of Advanced Studies 35
TM Example
Inputs i.e Symbols on Tape is 010#010 • q1010#010 ├ xq210#010
• ├ x1q20#010├ x10q2#010
• ├ x10#q4010 ├ x10q6#x10
• ├ x1q70#x10 ├ xq710#x10
• ├ q7x10#x10 ├ xq110#x10
• ├ xxq30#x10 ├ xx0q3#x10
• ├ xx0#q5x10 ├ xx0#xq510
• ├ xx0#q6xx0 ├ xx0q6#xx0
• ├ xxq70#xx0 ├ xq7x0#xx0
• ├ xxq10#xx0 ├ xxxq2#xx0
• ├ xxx#q4xx0 ├ xxx#xq4x0
• ├ xxx#xq6xx ├ xxx#q6xxx
• ├xxxq6#xxx├xxq7x#xxx
• ├xxxq1#xxx├xxx#q8xxx
• ├ xxx#xq8xx ├ xxx#xxq8x
• ├ xxx#xxxq8 ├ xxx#xxx_qa
M. S. Ramaiah School of Advanced Studies 36
Turing Machine Variants
• There are a number of other types of Turing machines in addition to
the one we have seen.
• Turing Machines with Two Dimensional Tapes : It has one finite
control, one read-write head and one two dimensional tape. The tape
has the top end and the left end but extends indefinitely to the right and
down.
•
Here the numbers indicate the correspondence
of squares in the two tapes: square i of the two
dimensional tape is mapped to square i of the
one dimensional tape. h and v are symbols
which are not in the tape alphabet and they
are used to mark the left and the top end
of the tape, respectively.
M. S. Ramaiah School of Advanced Studies 37
• Turing Machines with Multiple Tapes : This is a kind of Turing machines
that have one finite control and more than one tapes each with its own read-
write head. It is denoted by a 5-tuple < Q , , q0, d >
• Its transition function is a partial function
d : Q X ( G  {} )n -> ( Q  { h } ) X ( G  {} )n X{R ,L,S }n .
• A configuration for this kind of Turing machine must show the current state
the machine is in and the state of each tape.
• Turing Machines with Multiple Heads : This is a kind of Turing machines
that have one finite control and one tape but more than one read-write heads.
In each state only one of the heads is allowed to read and write. It is denoted
by a 5-tuple < Q , , G, q0, d >. The transition function is a partial function
d : Q X { H1 , H2 ... , Hn } X( G  {} ) -> (Q  { h } )X( G  {} )X {
R , L , S } ,
where H1 , H2 ... , Hn denote the tape heads.
Turing Machine Variants
M. S. Ramaiah School of Advanced Studies 38
• Turing Machines with Infinite Tape : This is a kind of Turing
machines that have one finite control and one tape which extends
infinitely in both directions.
• Nondeterministic Turing Machines :A nondeterministic Turing
machine is a Turing machine which, at any state it is in and for the tape
symbol it is reading, can take any action selecting from a set of
specified actions rather than taking one definite predetermined action.
Even in the same situation it may take different actions at different
times. Here an action means the combination of writing a symbol on
the tape, moving the tape head and going to a next state.
• Formally a nondeterministic Turing machine is a Turing machine
whose transition function takes values that are subsets of
(Q  { h } ) X (G  {}X{ R , L , S }
Turing Machine Variants
M. S. Ramaiah School of Advanced Studies 39
Conclusion
• It is often said that Turing machines, are as powerful as
real machines, and are able to execute any operation that a
real program can.
• According to Church-Turing thesis any possible
calculation can be performed by an algorithm, running on a
computer that provides sufficient time and storage space.
Admittedly it is just pure theory, when we say that a
Turing machine can solve every given mathematical
problem. In practice this idea is very limited like they do
not model the concurrency well i.e. There is a bound on the
size of the integer
M. S. Ramaiah School of Advanced Studies 40
References
[1] H,Willkommen. (June 25 2006) “The Turing Machine
Artikel ” [Online]. Available
from:http://www.saschaseidel.de/html/programmierung/pr
ogrammierungindex.html (Accessed: 08 June 2013).
[2] Wikipedia. “Turing machine”. [Online].Available from:
http://en.wikipedia.org/wiki/Turing_machine (Accessed:18
June 2013)

More Related Content

What's hot

What's hot (20)

Turing machines
Turing machinesTuring machines
Turing machines
 
Turing machine - theory of computation
Turing machine - theory of computationTuring machine - theory of computation
Turing machine - theory of computation
 
Variants of Turing Machine
Variants of Turing MachineVariants of Turing Machine
Variants of Turing Machine
 
Turing machine
Turing machineTuring machine
Turing machine
 
Turing Machine
Turing MachineTuring Machine
Turing Machine
 
Turing Machine
Turing MachineTuring Machine
Turing Machine
 
Working principle of Turing machine
Working principle of Turing machineWorking principle of Turing machine
Working principle of Turing machine
 
Turing machine by_deep
Turing machine by_deepTuring machine by_deep
Turing machine by_deep
 
Undecidabality
UndecidabalityUndecidabality
Undecidabality
 
Introduction to Turing Machine
Introduction to Turing MachineIntroduction to Turing Machine
Introduction to Turing Machine
 
Regular expressions
Regular expressionsRegular expressions
Regular expressions
 
Push Down Automata (PDA) | TOC (Theory of Computation) | NPDA | DPDA
Push Down Automata (PDA) | TOC  (Theory of Computation) | NPDA | DPDAPush Down Automata (PDA) | TOC  (Theory of Computation) | NPDA | DPDA
Push Down Automata (PDA) | TOC (Theory of Computation) | NPDA | DPDA
 
Turing machine-TOC
Turing machine-TOCTuring machine-TOC
Turing machine-TOC
 
Turing machines
Turing machinesTuring machines
Turing machines
 
Finite automata
Finite automataFinite automata
Finite automata
 
push down automata
push down automatapush down automata
push down automata
 
pushdown automata
pushdown automatapushdown automata
pushdown automata
 
Turing machine
Turing machineTuring machine
Turing machine
 
Moore and mealy machines
Moore and mealy machinesMoore and mealy machines
Moore and mealy machines
 
Push down automata
Push down automataPush down automata
Push down automata
 

Viewers also liked

Viewers also liked (17)

Turing machine Introduction
Turing machine IntroductionTuring machine Introduction
Turing machine Introduction
 
Turing machine
Turing machineTuring machine
Turing machine
 
Church Turing Thesis
Church Turing ThesisChurch Turing Thesis
Church Turing Thesis
 
Turing Machine
Turing MachineTuring Machine
Turing Machine
 
Introduction to the theory of computation
Introduction to the theory of computationIntroduction to the theory of computation
Introduction to the theory of computation
 
Turing machine
Turing  machine Turing  machine
Turing machine
 
Turing Church Online Workshop 2
Turing Church Online Workshop 2Turing Church Online Workshop 2
Turing Church Online Workshop 2
 
The Cosmic Visions of the Turing Church
The Cosmic Visions of the Turing ChurchThe Cosmic Visions of the Turing Church
The Cosmic Visions of the Turing Church
 
touch screen technology presentation
touch screen technology presentationtouch screen technology presentation
touch screen technology presentation
 
Huffman tree
Huffman tree Huffman tree
Huffman tree
 
Turing Machine
Turing MachineTuring Machine
Turing Machine
 
Pushdown automata
Pushdown automataPushdown automata
Pushdown automata
 
Push down automata
Push down automataPush down automata
Push down automata
 
Lathe – turning machine
Lathe – turning machineLathe – turning machine
Lathe – turning machine
 
Theory of computation Lec1
Theory of computation Lec1Theory of computation Lec1
Theory of computation Lec1
 
Deciability (automata presentation)
Deciability (automata presentation)Deciability (automata presentation)
Deciability (automata presentation)
 
Regular expression (compiler)
Regular expression (compiler)Regular expression (compiler)
Regular expression (compiler)
 

More from Anshuman Biswal

भक्ति वृक्षा – CHAPTER 1 (1).pptx
भक्ति वृक्षा – CHAPTER 1 (1).pptxभक्ति वृक्षा – CHAPTER 1 (1).pptx
भक्ति वृक्षा – CHAPTER 1 (1).pptxAnshuman Biswal
 
Wireless Networking Security
Wireless Networking SecurityWireless Networking Security
Wireless Networking SecurityAnshuman Biswal
 
Ir da in_linux_presentation
Ir da in_linux_presentationIr da in_linux_presentation
Ir da in_linux_presentationAnshuman Biswal
 
Message Signaled Interrupts
Message Signaled InterruptsMessage Signaled Interrupts
Message Signaled InterruptsAnshuman Biswal
 
Bangalore gayatri pariwar gayatri ashwamedha mahayagya
Bangalore gayatri pariwar gayatri ashwamedha mahayagyaBangalore gayatri pariwar gayatri ashwamedha mahayagya
Bangalore gayatri pariwar gayatri ashwamedha mahayagyaAnshuman Biswal
 
Six Sigma and/For Software Engineering
Six Sigma and/For Software EngineeringSix Sigma and/For Software Engineering
Six Sigma and/For Software EngineeringAnshuman Biswal
 
Fast web development using groovy on grails
Fast web development using groovy on grailsFast web development using groovy on grails
Fast web development using groovy on grailsAnshuman Biswal
 

More from Anshuman Biswal (12)

भक्ति वृक्षा – CHAPTER 1 (1).pptx
भक्ति वृक्षा – CHAPTER 1 (1).pptxभक्ति वृक्षा – CHAPTER 1 (1).pptx
भक्ति वृक्षा – CHAPTER 1 (1).pptx
 
Wireless Networking Security
Wireless Networking SecurityWireless Networking Security
Wireless Networking Security
 
Pervasive Computing
Pervasive ComputingPervasive Computing
Pervasive Computing
 
Observer Pattern
Observer PatternObserver Pattern
Observer Pattern
 
Ir da in_linux_presentation
Ir da in_linux_presentationIr da in_linux_presentation
Ir da in_linux_presentation
 
Message Signaled Interrupts
Message Signaled InterruptsMessage Signaled Interrupts
Message Signaled Interrupts
 
Array Processor
Array ProcessorArray Processor
Array Processor
 
Bangalore gayatri pariwar gayatri ashwamedha mahayagya
Bangalore gayatri pariwar gayatri ashwamedha mahayagyaBangalore gayatri pariwar gayatri ashwamedha mahayagya
Bangalore gayatri pariwar gayatri ashwamedha mahayagya
 
Six Sigma and/For Software Engineering
Six Sigma and/For Software EngineeringSix Sigma and/For Software Engineering
Six Sigma and/For Software Engineering
 
SNMP
SNMPSNMP
SNMP
 
Fibonacci Heap
Fibonacci HeapFibonacci Heap
Fibonacci Heap
 
Fast web development using groovy on grails
Fast web development using groovy on grailsFast web development using groovy on grails
Fast web development using groovy on grails
 

Recently uploaded

Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxNirmalaLoungPoorunde1
 
ACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfSpandanaRallapalli
 
Judging the Relevance and worth of ideas part 2.pptx
Judging the Relevance  and worth of ideas part 2.pptxJudging the Relevance  and worth of ideas part 2.pptx
Judging the Relevance and worth of ideas part 2.pptxSherlyMaeNeri
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxthorishapillay1
 
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...Nguyen Thanh Tu Collection
 
Atmosphere science 7 quarter 4 .........
Atmosphere science 7 quarter 4 .........Atmosphere science 7 quarter 4 .........
Atmosphere science 7 quarter 4 .........LeaCamillePacle
 
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfLike-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfMr Bounab Samir
 
What is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPWhat is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPCeline George
 
DATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersDATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersSabitha Banu
 
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdfAMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdfphamnguyenenglishnb
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxOH TEIK BIN
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17Celine George
 
Romantic Opera MUSIC FOR GRADE NINE pptx
Romantic Opera MUSIC FOR GRADE NINE pptxRomantic Opera MUSIC FOR GRADE NINE pptx
Romantic Opera MUSIC FOR GRADE NINE pptxsqpmdrvczh
 
Grade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.pptxGrade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.pptxChelloAnnAsuncion2
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxpboyjonauth
 
Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Celine George
 

Recently uploaded (20)

Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
 
ACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdf
 
Judging the Relevance and worth of ideas part 2.pptx
Judging the Relevance  and worth of ideas part 2.pptxJudging the Relevance  and worth of ideas part 2.pptx
Judging the Relevance and worth of ideas part 2.pptx
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptx
 
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
 
Atmosphere science 7 quarter 4 .........
Atmosphere science 7 quarter 4 .........Atmosphere science 7 quarter 4 .........
Atmosphere science 7 quarter 4 .........
 
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfLike-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
 
What is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPWhat is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERP
 
DATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersDATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginners
 
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdfAMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptx
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17
 
Romantic Opera MUSIC FOR GRADE NINE pptx
Romantic Opera MUSIC FOR GRADE NINE pptxRomantic Opera MUSIC FOR GRADE NINE pptx
Romantic Opera MUSIC FOR GRADE NINE pptx
 
Grade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.pptxGrade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.pptx
 
OS-operating systems- ch04 (Threads) ...
OS-operating systems- ch04 (Threads) ...OS-operating systems- ch04 (Threads) ...
OS-operating systems- ch04 (Threads) ...
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptx
 
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
 
Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 
9953330565 Low Rate Call Girls In Rohini Delhi NCR
9953330565 Low Rate Call Girls In Rohini  Delhi NCR9953330565 Low Rate Call Girls In Rohini  Delhi NCR
9953330565 Low Rate Call Girls In Rohini Delhi NCR
 

Turing Machine

  • 1. M. S. Ramaiah School of Advanced Studies 1 CSN2505 AFM Presentation Turing Machine Anshuman Biswal PT 2012 Batch, Reg. No.: CJB0412001 M. Sc. (Engg.) in Computer Science and Networking Module Leader: Dr. Hariharan Ramasangu Module Name: Applied Formal Methods Module Code : CSN2505
  • 2. M. S. Ramaiah School of Advanced Studies 2 Marking Head Maximum Score Technical Content 10 Grasp and Understanding 10 Delivery – Technical and General Aspects 10 Handling Questions 10 Total 40
  • 3. M. S. Ramaiah School of Advanced Studies 3 Presentation Outline • Introduction and Historical background • Historical Background-TM in WW-II • A Thinking machine-Successor Program Example • Turing Machine • Turing Machine Formal Definition and Description • Turing Machine Transition Functions • Turing Machine Instantaneous Description and Move • Turing Machine Example • Turing Machine Variants • Conclusion • Referenses
  • 4. M. S. Ramaiah School of Advanced Studies 4 Introduction and Historical Background • The desire to capture the complexities of mathematical reasoning and computation in a simple and powerful manner has been a major theme of 20th Century mathematics. • The 1930’s saw two of these great negative results in the foundations of mathematics, the first of which was Godel’s very unexpected proof of 1931 (Godel’s Incompleteness Theorem). • 1936 saw the independent development of three influential models of computation :lambda calculus, recursive functions and Turing machines. • Alonzo Church’s lambda calculus and Steven Kleene’s recursive functions were arguably more elegant in this respect, but it was the mechanical action of Turing’s machines that most agreed with intuitions about how people go about computing mathematical functions.
  • 5. M. S. Ramaiah School of Advanced Studies 5 • 1936-Alan Turing a British cryptologist invented a mechanical device, which from that day forth was called the “Turing machine”. • Based on Turing’s prior thoughts and ideas, his invention was able to compute every given mathematical expression . • It only consists of three main components: A tape (e.g. paper) that can hold data and serves as some kind of memory,a head that can read data from or write data to the tape and finally an application, which controls the whole process. • The Turing machine addresses two major problems of theoretical computer science, namely the decision problem and the halting problem. Introduction and Historical Background
  • 6. M. S. Ramaiah School of Advanced Studies 6 • In 1936 Alan Turing was member of the Royal Army and worked in the British codebreaking centre, located at Bletchley Park in South East England. • His major task during World War II was breaking the Enigma, a device that was used by the Germans, in order to encode military messages. At least two different versions of the Enigma were commonly used at wartime: On the one hand the so-called “Wehrmachts-Enigma” and on the other hand a naval edition, which was primary used by German warships and submarines Historical Background-TM in WW-II
  • 7. M. S. Ramaiah School of Advanced Studies 7 • Alan Turing made use of terms and phrases that were frequently used in German military so-called “cribs”. • He searched certain patterns and tried to understand the encoding algorithm. However a single message could be interpreted in more than 150 quadrillion ways (> 150,000,000,000,000 or 150 * 10¹²). • British scientists made use of technical support. They used a cluster of four Turing machines which could successfully decode a secret message within several hours and thus was a huge advantage for the Royal British Army in their battle against Nazi Germany. This machine is called the “Turing Bombe”. Historical Background-TM in WW-II
  • 8. M. S. Ramaiah School of Advanced Studies 8 A Thinking Machine-Successor Program Imagine a super-organized, obsessive-compulsive human computer. The computer wants to avoid mistakes so everything written down is completely specified one letter/number at a time. The computer follows a finite set of rules which are referred to every time another symbol is written down. Rules are such that at any given time, only one rule is active so no ambiguity can arise. Each rule activates another rule depending on what letter/number is currently read, EG: Sample Rules: If read 1, write 0, go right, repeat. If read 0, write 1, HALT! If read •, write 1, HALT! Let’s see how they are carried out on a piece of paper that contains the reverse binary representation of 47:
  • 9. M. S. Ramaiah School of Advanced Studies 9 If read 1, write 0, go right, repeat. If read 0, write 1, HALT! If read •, write 1, HALT! 1 1 1 1 0 1 A Thinking Machine-Successor Program
  • 10. M. S. Ramaiah School of Advanced Studies 10 If read 1, write 0, go right, repeat. If read 0, write 1, HALT! If read •, write 1, HALT! 0 1 1 1 0 1 A Thinking Machine-Successor Program
  • 11. M. S. Ramaiah School of Advanced Studies 11 If read 1, write 0, go right, repeat. If read 0, write 1, HALT! If read •, write 1, HALT! 0 0 1 1 0 1 A Thinking Machine-Successor Program
  • 12. M. S. Ramaiah School of Advanced Studies 12 If read 1, write 0, go right, repeat. If read 0, write 1, HALT! If read •, write 1, HALT! 0 0 0 1 0 1 A Thinking Machine-Successor Program
  • 13. M. S. Ramaiah School of Advanced Studies 13 If read 1, write 0, go right, repeat. If read 0, write 1, HALT! If read •, write 1, HALT! 0 0 0 0 0 1 A Thinking Machine-Successor Program
  • 14. M. S. Ramaiah School of Advanced Studies 14 If read 1, write 0, go right, repeat. If read 0, write 1, HALT! If read •, write 1, HALT! 0 0 0 0 1 1 A Thinking Machine-Successor Program
  • 15. M. S. Ramaiah School of Advanced Studies 15 So the successor’s output on 111101 was 000011 which is the reverse binary representation of 48. Similarly, the successor of 127 should be 128: A Thinking Machine-Successor Program
  • 16. M. S. Ramaiah School of Advanced Studies 16 If read 1, write 0, go right, repeat. If read 0, write 1, HALT! If read •, write 1, HALT! 1 1 1 1 1 1 1 A Thinking Machine-Successor Program
  • 17. M. S. Ramaiah School of Advanced Studies 17 If read 1, write 0, go right, repeat. If read 0, write 1, HALT! If read •, write 1, HALT! 0 1 1 1 1 1 1 A Thinking Machine-Successor Program
  • 18. M. S. Ramaiah School of Advanced Studies 18 If read 1, write 0, go right, repeat. If read 0, write 1, HALT! If read •, write 1, HALT! 0 0 1 1 1 1 1 A Thinking Machine-Successor Program
  • 19. M. S. Ramaiah School of Advanced Studies 19 If read 1, write 0, go right, repeat. If read 0, write 1, HALT! If read •, write 1, HALT! 0 0 0 1 1 1 1 A Thinking Machine-Successor Program
  • 20. M. S. Ramaiah School of Advanced Studies 20 If read 1, write 0, go right, repeat. If read 0, write 1, HALT! If read •, write 1, HALT! 0 0 0 0 1 1 1 A Thinking Machine-Successor Program
  • 21. M. S. Ramaiah School of Advanced Studies 21 If read 1, write 0, go right, repeat. If read 0, write 1, HALT! If read •, write 1, HALT! 0 0 0 0 0 1 1 A Thinking Machine-Successor Program
  • 22. M. S. Ramaiah School of Advanced Studies 22 If read 1, write 0, go right, repeat. If read 0, write 1, HALT! If read •, write 1, HALT! 0 0 0 0 0 0 1 A Thinking Machine-Successor Program
  • 23. M. S. Ramaiah School of Advanced Studies 23 If read 1, write 0, go right, repeat. If read 0, write 1, HALT! If read •, write 1, HALT! 0 0 0 0 0 0 0 A Thinking Machine-Successor Program
  • 24. M. S. Ramaiah School of Advanced Studies 24 If read 1, write 0, go right, repeat. If read 0, write 1, HALT! If read •, write 1, HALT! 0 0 0 0 0 0 0 1 A Thinking Machine-Successor Program
  • 25. M. S. Ramaiah School of Advanced Studies 25 It was hard for the ancients to believe that any algorithm could be carried out on such a device. For us, it’s much easier to believe, especially if we’ve programmed in assembly! However, ancients did finally believe Turing when Church’s lambda-calculus paradigm (on which lisp programming is based) proved equivalent! A Thinking Machine
  • 26. M. S. Ramaiah School of Advanced Studies 26 Turing Machines A Turing Machine (TM) is a device with a finite amount of read-only “hard” memory (states), and an unbounded amount of read/write tape-memory. There is no separate input. Rather, the input is assumed to reside on the tape at the time when the TM starts running.
  • 27. M. S. Ramaiah School of Advanced Studies 27 TM Formal Definition • DEF: A Turing machine (TM) consists of a the 8-tuple: M = (Q, , Γ, δ, q0, B, qa, qr) G is the tape alphabet which necessarily contains the blank symbol •, as well as the input alphabet S. d is as follows: Therefore given a non-halt state p, and a tape symbol x, d(p,x) = (q,y,D) means that TM goes into state q, replaces x by y, and the tape head moves in direction D. }RL,{}),{-(:δ rejacc GG QQ qq
  • 28. M. S. Ramaiah School of Advanced Studies 28 Turing Machine Description • Q = finite states of the control , set of states •  = finite set of input symbols, which is a subset of Γ below, input alphabet • Γ = finite set of tape symbols, tape alphabet • δ = partial transition function. δ(q,X) are a state and tape symbol X. – The output is the triple, (p, Y, D) – Where p = next state, Y = new symbol written on the tape, D = direction to move the tape head • q0= start state for finite control, initial state • B = blank symbol. This symbol is in Γ but not in . • qaccept = set of final or accepting states of Q. • qreject = set of rejecting states of Q
  • 29. M. S. Ramaiah School of Advanced Studies 29 TM Transition Functions The transition function for Turing machines is given by }RL,{}),{-(:δ rejacc GG QQ qq This means: When the machine is in a given state (Q) and reads a given symbol (Γ) from the tape, it replaces the symbol on the tape with some other symbol (Γ), goes to some other state (Q), and moves the tape head one square left (L) or right (R)
  • 30. M. S. Ramaiah School of Advanced Studies 30 TM Instantaneous description and Move • An instantaneous description or configuration of a Turing machine requires (1) the state the Turing machine is in, (2) the contents of the tape, and (3) the position of the tape head on the tape. This can be summarized in a string of the form xi...xjqmxk...xl where the x's are the symbols on the tape, qm is the current state, and the tape head is on the square containing xk (the symbol immediately following qm). • A move of a Turing machine can therefore be represented as a pair of instaneous descriptions, separated by the symbol " ├”. For example, if (q5, b) = (q8, c, R)then a possible move might be abbabq5babb ├ abbabcq8abb
  • 31. M. S. Ramaiah School of Advanced Studies 31 TM Example • Make a TM that recognizes the language L = { w#w | w  (0,1)* }. That is, we have a language separated by a # symbol with the same string on both sides. • Here is a strategy we can employ to create the Turing machine: – read the first symbol, then cross it out, and then, remember what that symbol was, move until it reaches the # – Then check to see if the symbols match, and if they do cross it off and go back to the symbol after the one we crossed out, – and then continue in this same manner, except going to the first non- crossed off symbol in the transversals. – Finally we need to make sure that we accept if this is all that the input consists of. • Here is a formal description of a Turing machine which does this 1. Q = {q1; q2; : : : q8; qa; qr} 2.  = {0,1,#} and G = {0, 1,x,#,_} 3. The start state is q1. The accept state is qa. The reject state is qr.
  • 32. M. S. Ramaiah School of Advanced Studies 32 TM Example And now we need to specify the transition function. We do this with a state diagram.
  • 33. M. S. Ramaiah School of Advanced Studies 33 • Now there are some points about this transition function which we should point out. First of all where is the reject state qr? Well we have obmitted it. Indeed we have followed a convention where every allowed transition which is not labeled is a transition to qr. •All rules should be of the form s → a, d where s, a ϵ G and d ϵ {L,R} But some of these don't have an a, i.e. they are of the form s → d. This is shorthand for the fact that the same symbol which is on the tape is being written onto the tape, i.e. that symbol is not changed. Finally we often write multiple elements which lead to the transition separated via commas. TM Example
  • 34. M. S. Ramaiah School of Advanced Studies 34 TM Example- Instantaneous Description • Sometimes it is useful to describe what a TM does in terms of its ID (instantaneous description.) • The ID shows all non-blank cells in the tape, pointer to the cell the head is over with the name of the current state – use the turnstile symbol ├ to denote the move. – As before, to denote zero or many moves, we can use ├*. • Let's run through how this machine acts on an input. Lets do 010#010.
  • 35. M. S. Ramaiah School of Advanced Studies 35 TM Example Inputs i.e Symbols on Tape is 010#010 • q1010#010 ├ xq210#010 • ├ x1q20#010├ x10q2#010 • ├ x10#q4010 ├ x10q6#x10 • ├ x1q70#x10 ├ xq710#x10 • ├ q7x10#x10 ├ xq110#x10 • ├ xxq30#x10 ├ xx0q3#x10 • ├ xx0#q5x10 ├ xx0#xq510 • ├ xx0#q6xx0 ├ xx0q6#xx0 • ├ xxq70#xx0 ├ xq7x0#xx0 • ├ xxq10#xx0 ├ xxxq2#xx0 • ├ xxx#q4xx0 ├ xxx#xq4x0 • ├ xxx#xq6xx ├ xxx#q6xxx • ├xxxq6#xxx├xxq7x#xxx • ├xxxq1#xxx├xxx#q8xxx • ├ xxx#xq8xx ├ xxx#xxq8x • ├ xxx#xxxq8 ├ xxx#xxx_qa
  • 36. M. S. Ramaiah School of Advanced Studies 36 Turing Machine Variants • There are a number of other types of Turing machines in addition to the one we have seen. • Turing Machines with Two Dimensional Tapes : It has one finite control, one read-write head and one two dimensional tape. The tape has the top end and the left end but extends indefinitely to the right and down. • Here the numbers indicate the correspondence of squares in the two tapes: square i of the two dimensional tape is mapped to square i of the one dimensional tape. h and v are symbols which are not in the tape alphabet and they are used to mark the left and the top end of the tape, respectively.
  • 37. M. S. Ramaiah School of Advanced Studies 37 • Turing Machines with Multiple Tapes : This is a kind of Turing machines that have one finite control and more than one tapes each with its own read- write head. It is denoted by a 5-tuple < Q , , q0, d > • Its transition function is a partial function d : Q X ( G  {} )n -> ( Q  { h } ) X ( G  {} )n X{R ,L,S }n . • A configuration for this kind of Turing machine must show the current state the machine is in and the state of each tape. • Turing Machines with Multiple Heads : This is a kind of Turing machines that have one finite control and one tape but more than one read-write heads. In each state only one of the heads is allowed to read and write. It is denoted by a 5-tuple < Q , , G, q0, d >. The transition function is a partial function d : Q X { H1 , H2 ... , Hn } X( G  {} ) -> (Q  { h } )X( G  {} )X { R , L , S } , where H1 , H2 ... , Hn denote the tape heads. Turing Machine Variants
  • 38. M. S. Ramaiah School of Advanced Studies 38 • Turing Machines with Infinite Tape : This is a kind of Turing machines that have one finite control and one tape which extends infinitely in both directions. • Nondeterministic Turing Machines :A nondeterministic Turing machine is a Turing machine which, at any state it is in and for the tape symbol it is reading, can take any action selecting from a set of specified actions rather than taking one definite predetermined action. Even in the same situation it may take different actions at different times. Here an action means the combination of writing a symbol on the tape, moving the tape head and going to a next state. • Formally a nondeterministic Turing machine is a Turing machine whose transition function takes values that are subsets of (Q  { h } ) X (G  {}X{ R , L , S } Turing Machine Variants
  • 39. M. S. Ramaiah School of Advanced Studies 39 Conclusion • It is often said that Turing machines, are as powerful as real machines, and are able to execute any operation that a real program can. • According to Church-Turing thesis any possible calculation can be performed by an algorithm, running on a computer that provides sufficient time and storage space. Admittedly it is just pure theory, when we say that a Turing machine can solve every given mathematical problem. In practice this idea is very limited like they do not model the concurrency well i.e. There is a bound on the size of the integer
  • 40. M. S. Ramaiah School of Advanced Studies 40 References [1] H,Willkommen. (June 25 2006) “The Turing Machine Artikel ” [Online]. Available from:http://www.saschaseidel.de/html/programmierung/pr ogrammierungindex.html (Accessed: 08 June 2013). [2] Wikipedia. “Turing machine”. [Online].Available from: http://en.wikipedia.org/wiki/Turing_machine (Accessed:18 June 2013)