SlideShare a Scribd company logo
1 of 26
Regular Languages
0n1n
Described by DFA, NFA,
RegExp, RegGram
0n
w
 Is it possible to design a formal model of a
computational device that capture the capabilities of
any algorithm?
Alan Turing, 1940’s: Yes!
Turing Machine is COOOOOL, why?
Understanding it makes us more like CS guys
But, probably there are few graduate students who
really understand it.
Because, most of us forgot the details very soon after
we learnt it. 
Anyway, it is cool, instinctively.
Why it is cool, seriously
Anything a real computer can compute, a TM can also
compute.
Despite its simplicity, TM can be adapted to simulate the
logic of any computer that could possibly be constructed.
Therefore, TM is the foundation of computational
complexity theory.
A basis to analyze algorithms
Alan Turing
1912-1954
Great mathematician
The father of
the modern computer
Alan Turing’s Statue
at Bletchley Park
His masterpiece is On Computable Numbers, with an Application to
the Entscheidungsproblem
He achieved world-class Marathon standards.
His best time is 2 hours, 46 minutes, 3 seconds,
only 11 minutes slower than the winner in the 1948 Olympic Games.
Alan Turing is the father of computer science. The ACM Turing
Award is widely considered to be the CS world’s “Nobel Prize”
Every computer algorithm can be
implemented as a Turing machine
Therefore, C, C++, Prolog, Lisp, Small talk, and Java programs can
be simulated in Turing machines
Definition: a programming language is Turing-complete if it is
equivalent to a Turing machine.
whether there was a way to define which problems
were/were not decidable (computable)?
can we create a machine to simulate the human brain so
that those computable problems can be solved
automatically?
1935-36, Turing was working on a paper, “computable
numbers”. The Turing machine in this paper turned out
to be the simplest prototype of all computers!
thinks
State of mind changes
reads
Move left/right one square
Change
state
Write a new symbol
onto the current tape square
depending on current state
and
current tape symbol
In the year 1941:
•The world is at war
•Nazi Germany has succeeded in conquering most of west
Europe
•Britain is under siege
•British supply lines are threaten by German
•Germany used the Enigma Code, considered unbreakable
•Alan Turing led a group of scientist that broke the enigma code
Finite
Control
This tape is for input, storage and output
TM is a 7-Tuple (Q, , , , q0, B, F)
Q is a set of states
 is a set of tape symbols
B   is a blank symbol
  {B} is a set of input symbols
q0 is the start state
F  Q is a set of final states
Tape head
: the transition function
(q,X): a state q and a tape symbol X
(q,X) = (p,Y,D) where:
p is next state in Q
Y is the symbol written in the cell being scanned
D is a direction, either L or R
A transition can be described as follows
Change from state q to p, update the current symbol X
with Y, and move the tape head to D (left or right)
q p
X/Y, D
Initially, the input string (finite-length string of symbols)
is placed on the tape
All other tape cells, extending infinitely to left and right,
hold blanks
Blank is a tape symbol, but not an input symbol
Initially, tape head points to the beginning of the input
string
Tape head: always positioned at one of tape
cells
A move (or say ‘a step’) may:
Read an input symbol
Change machine state
Write a tape symbol in the cell scanned
Move the tape head left or right
So simple, right? But…
The computational capabilities of all other known
computational models (e.g. any automata) are less
than or equivalent to TM
Their speeds may not be as same as that of the TM’s
Their computational capabilities are less than or equivalent to
TM, i.e., no ‘more’ mathematical functions can be calculated
“Every function that can be physically computed can
be computed by a Turing Machine."
This is the famous Church-Turing Thesis
L = {0n1n | n  1}
Idea: Repeatedly change the first ‘0’ to X, then
find a ‘1’ and change it to Y, until all ‘0’s and ‘1’s
have been matched.
0 0 0 1
X
Y
1
0/X, R
0, R
Y, R
1/Y, L
0, L
Y, L
X, R
Y, R
Y, R
#, R
q0
q1
q2
q3 q4
Start
0/X, R
0, R
Y, R
1/Y, L
0, L
Y, L
X, R
Y, R
Y, R
#, R
q0
q1
q2
q3 q4
Consider the input “0011”
1. Tape # # 0 0 1 1 # # #
2. Tape # # X 0 1 1 # # #
3. Tape # # X 0 Y 1 # # #
0/X, R
0, R
Y, R
1/Y, L
0, L
Y, L
X, R
Y, R
Y, R
#, R
q0
q1
q2
q3 q4
Consider the input “0011”
5. Tape # # X X Y Y # # #
6. Tape # # X X Y Y # # #
4. Tape # # X X Y 1 # # #
0/X, R
0, R
Y, R
1/Y, L
0, L
Y, L
X, R
Y, R
Y, R
#, R
q0
q1
q2
q3 q4
Consider the input “0111”
1. Tape # # 0 1 1 1 # # #
2. Tape # # X 1 1 1 # # #
3. Tape # # X Y 1 1 # # #
4. Tape # # X Y 1 1 # # #
Example #1: {0n1n | n >= 1}
0 1 X Y B
q0 (q1, X, R) - - (q3, Y, R) -
q1 (q1, 0, R) (q2, Y, L) - (q1, Y, R) -
q2 (q2, 0, L) - (q0, X, R) (q2, Y, L) -
q3 - - - (q3, Y, R) (q4, B, R)
q4 - - - - -
Sample Computation: (on 0011)
q00011 |— Xq1011
|— X0q111
|— Xq20Y1
|— q2X0Y1
|— Xq00Y1
|— XXq1Y1
|— XXYq11
|— XXq2YY
|— Xq2XYY
|— XXq0YY
|— XXYq3Y
|— XXYYq3
|— XXYYBq4
Example #2: {w | w is in {0,1}* and w ends with a 0}
Q = {q0, q1, q2}
Γ = {0, 1, B}
Σ = {0, 1}
F = {q2}
δ:
0 1 B
q0 (q0, 0, R) (q0, 1, R) (q1, B, L)
q1 (q2, 0, R) - -
q2 - - -
Construct a TM for each of the following.
To recognize the language {0n1n2n}

More Related Content

Similar to Turing Machine.pptx

2009 CSBB LAB 新生訓練
2009 CSBB LAB 新生訓練2009 CSBB LAB 新生訓練
2009 CSBB LAB 新生訓練Abner Huang
 
Time series anomaly discovery with grammar-based compression
Time series anomaly discovery with grammar-based compressionTime series anomaly discovery with grammar-based compression
Time series anomaly discovery with grammar-based compressionPavel Senin
 
Turing machine seminar report
Turing machine seminar reportTuring machine seminar report
Turing machine seminar reportYashwant Dagar
 
Turing Machine
Turing MachineTuring Machine
Turing MachineRajendran
 
souraj Toc.pptx
souraj Toc.pptxsouraj Toc.pptx
souraj Toc.pptxLifo4
 
5 decidability theory of computation
5 decidability theory of computation 5 decidability theory of computation
5 decidability theory of computation parmeet834
 
1LECTURE 9TuringMachines.ppt
1LECTURE 9TuringMachines.ppt1LECTURE 9TuringMachines.ppt
1LECTURE 9TuringMachines.pptMarvin886766
 
Alan turing's work before, during & after bletchley park
Alan turing's work before, during & after bletchley parkAlan turing's work before, during & after bletchley park
Alan turing's work before, during & after bletchley parkDavid Bew
 
2010 3-24 cryptography stamatiou
2010 3-24 cryptography stamatiou2010 3-24 cryptography stamatiou
2010 3-24 cryptography stamatiouvafopoulos
 
Sampling and Reconstruction (Online Learning).pptx
Sampling and Reconstruction (Online Learning).pptxSampling and Reconstruction (Online Learning).pptx
Sampling and Reconstruction (Online Learning).pptxHamzaJaved306957
 
Turing machines 1
Turing machines 1Turing machines 1
Turing machines 1grahamwell
 
Introduction of Algorithm.pdf
Introduction of Algorithm.pdfIntroduction of Algorithm.pdf
Introduction of Algorithm.pdfLaxmiMobile1
 

Similar to Turing Machine.pptx (20)

Turing Machine
Turing MachineTuring Machine
Turing Machine
 
2009 CSBB LAB 新生訓練
2009 CSBB LAB 新生訓練2009 CSBB LAB 新生訓練
2009 CSBB LAB 新生訓練
 
Turing machine
Turing machineTuring machine
Turing machine
 
NP completeness
NP completenessNP completeness
NP completeness
 
Turing machine by_deep
Turing machine by_deepTuring machine by_deep
Turing machine by_deep
 
Time series anomaly discovery with grammar-based compression
Time series anomaly discovery with grammar-based compressionTime series anomaly discovery with grammar-based compression
Time series anomaly discovery with grammar-based compression
 
Turing machine seminar report
Turing machine seminar reportTuring machine seminar report
Turing machine seminar report
 
Turing Machine
Turing MachineTuring Machine
Turing Machine
 
souraj Toc.pptx
souraj Toc.pptxsouraj Toc.pptx
souraj Toc.pptx
 
Turing Machine
Turing MachineTuring Machine
Turing Machine
 
5 decidability theory of computation
5 decidability theory of computation 5 decidability theory of computation
5 decidability theory of computation
 
1LECTURE 9TuringMachines.ppt
1LECTURE 9TuringMachines.ppt1LECTURE 9TuringMachines.ppt
1LECTURE 9TuringMachines.ppt
 
Alan turing's work before, during & after bletchley park
Alan turing's work before, during & after bletchley parkAlan turing's work before, during & after bletchley park
Alan turing's work before, during & after bletchley park
 
2010 3-24 cryptography stamatiou
2010 3-24 cryptography stamatiou2010 3-24 cryptography stamatiou
2010 3-24 cryptography stamatiou
 
l1.ppt
l1.pptl1.ppt
l1.ppt
 
Turing machine
Turing machineTuring machine
Turing machine
 
Sampling and Reconstruction (Online Learning).pptx
Sampling and Reconstruction (Online Learning).pptxSampling and Reconstruction (Online Learning).pptx
Sampling and Reconstruction (Online Learning).pptx
 
Turing machine
Turing machineTuring machine
Turing machine
 
Turing machines 1
Turing machines 1Turing machines 1
Turing machines 1
 
Introduction of Algorithm.pdf
Introduction of Algorithm.pdfIntroduction of Algorithm.pdf
Introduction of Algorithm.pdf
 

Recently uploaded

College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCall Girls in Nagpur High Profile
 
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Call Girls in Nagpur High Profile
 
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordCCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordAsst.prof M.Gokilavani
 
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service NashikCall Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service NashikCall Girls in Nagpur High Profile
 
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...RajaP95
 
UNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its PerformanceUNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its Performancesivaprakash250
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVRajaP95
 
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escortsranjana rawat
 
Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingrakeshbaidya232001
 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...ranjana rawat
 
Extrusion Processes and Their Limitations
Extrusion Processes and Their LimitationsExtrusion Processes and Their Limitations
Extrusion Processes and Their Limitations120cr0395
 
Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxupamatechverse
 
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingUNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingrknatarajan
 
KubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlyKubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlysanyuktamishra911
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Dr.Costas Sachpazis
 
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
Introduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxIntroduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxupamatechverse
 
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSKurinjimalarL3
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxAsutosh Ranjan
 

Recently uploaded (20)

College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
 
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
 
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordCCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
 
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service NashikCall Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
 
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
 
UNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its PerformanceUNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its Performance
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
 
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
 
Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writing
 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
 
Extrusion Processes and Their Limitations
Extrusion Processes and Their LimitationsExtrusion Processes and Their Limitations
Extrusion Processes and Their Limitations
 
Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptx
 
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingUNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
 
KubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlyKubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghly
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
 
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
Introduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxIntroduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptx
 
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptx
 

Turing Machine.pptx

  • 1.
  • 2. Regular Languages 0n1n Described by DFA, NFA, RegExp, RegGram 0n w
  • 3.  Is it possible to design a formal model of a computational device that capture the capabilities of any algorithm? Alan Turing, 1940’s: Yes!
  • 4. Turing Machine is COOOOOL, why? Understanding it makes us more like CS guys But, probably there are few graduate students who really understand it. Because, most of us forgot the details very soon after we learnt it.  Anyway, it is cool, instinctively.
  • 5. Why it is cool, seriously Anything a real computer can compute, a TM can also compute. Despite its simplicity, TM can be adapted to simulate the logic of any computer that could possibly be constructed. Therefore, TM is the foundation of computational complexity theory. A basis to analyze algorithms
  • 6. Alan Turing 1912-1954 Great mathematician The father of the modern computer
  • 7. Alan Turing’s Statue at Bletchley Park
  • 8. His masterpiece is On Computable Numbers, with an Application to the Entscheidungsproblem He achieved world-class Marathon standards. His best time is 2 hours, 46 minutes, 3 seconds, only 11 minutes slower than the winner in the 1948 Olympic Games. Alan Turing is the father of computer science. The ACM Turing Award is widely considered to be the CS world’s “Nobel Prize”
  • 9. Every computer algorithm can be implemented as a Turing machine Therefore, C, C++, Prolog, Lisp, Small talk, and Java programs can be simulated in Turing machines Definition: a programming language is Turing-complete if it is equivalent to a Turing machine.
  • 10. whether there was a way to define which problems were/were not decidable (computable)? can we create a machine to simulate the human brain so that those computable problems can be solved automatically? 1935-36, Turing was working on a paper, “computable numbers”. The Turing machine in this paper turned out to be the simplest prototype of all computers!
  • 11. thinks State of mind changes reads
  • 12. Move left/right one square Change state Write a new symbol onto the current tape square depending on current state and current tape symbol
  • 13. In the year 1941: •The world is at war •Nazi Germany has succeeded in conquering most of west Europe •Britain is under siege •British supply lines are threaten by German •Germany used the Enigma Code, considered unbreakable •Alan Turing led a group of scientist that broke the enigma code
  • 14. Finite Control This tape is for input, storage and output TM is a 7-Tuple (Q, , , , q0, B, F) Q is a set of states  is a set of tape symbols B   is a blank symbol   {B} is a set of input symbols q0 is the start state F  Q is a set of final states Tape head
  • 15. : the transition function (q,X): a state q and a tape symbol X (q,X) = (p,Y,D) where: p is next state in Q Y is the symbol written in the cell being scanned D is a direction, either L or R A transition can be described as follows Change from state q to p, update the current symbol X with Y, and move the tape head to D (left or right) q p X/Y, D
  • 16. Initially, the input string (finite-length string of symbols) is placed on the tape All other tape cells, extending infinitely to left and right, hold blanks Blank is a tape symbol, but not an input symbol Initially, tape head points to the beginning of the input string
  • 17. Tape head: always positioned at one of tape cells A move (or say ‘a step’) may: Read an input symbol Change machine state Write a tape symbol in the cell scanned Move the tape head left or right
  • 18. So simple, right? But… The computational capabilities of all other known computational models (e.g. any automata) are less than or equivalent to TM Their speeds may not be as same as that of the TM’s Their computational capabilities are less than or equivalent to TM, i.e., no ‘more’ mathematical functions can be calculated “Every function that can be physically computed can be computed by a Turing Machine." This is the famous Church-Turing Thesis
  • 19. L = {0n1n | n  1} Idea: Repeatedly change the first ‘0’ to X, then find a ‘1’ and change it to Y, until all ‘0’s and ‘1’s have been matched. 0 0 0 1 X Y 1
  • 20. 0/X, R 0, R Y, R 1/Y, L 0, L Y, L X, R Y, R Y, R #, R q0 q1 q2 q3 q4 Start
  • 21. 0/X, R 0, R Y, R 1/Y, L 0, L Y, L X, R Y, R Y, R #, R q0 q1 q2 q3 q4 Consider the input “0011” 1. Tape # # 0 0 1 1 # # # 2. Tape # # X 0 1 1 # # # 3. Tape # # X 0 Y 1 # # #
  • 22. 0/X, R 0, R Y, R 1/Y, L 0, L Y, L X, R Y, R Y, R #, R q0 q1 q2 q3 q4 Consider the input “0011” 5. Tape # # X X Y Y # # # 6. Tape # # X X Y Y # # # 4. Tape # # X X Y 1 # # #
  • 23. 0/X, R 0, R Y, R 1/Y, L 0, L Y, L X, R Y, R Y, R #, R q0 q1 q2 q3 q4 Consider the input “0111” 1. Tape # # 0 1 1 1 # # # 2. Tape # # X 1 1 1 # # # 3. Tape # # X Y 1 1 # # # 4. Tape # # X Y 1 1 # # #
  • 24. Example #1: {0n1n | n >= 1} 0 1 X Y B q0 (q1, X, R) - - (q3, Y, R) - q1 (q1, 0, R) (q2, Y, L) - (q1, Y, R) - q2 (q2, 0, L) - (q0, X, R) (q2, Y, L) - q3 - - - (q3, Y, R) (q4, B, R) q4 - - - - - Sample Computation: (on 0011) q00011 |— Xq1011 |— X0q111 |— Xq20Y1 |— q2X0Y1 |— Xq00Y1 |— XXq1Y1 |— XXYq11 |— XXq2YY |— Xq2XYY |— XXq0YY |— XXYq3Y |— XXYYq3 |— XXYYBq4
  • 25. Example #2: {w | w is in {0,1}* and w ends with a 0} Q = {q0, q1, q2} Γ = {0, 1, B} Σ = {0, 1} F = {q2} δ: 0 1 B q0 (q0, 0, R) (q0, 1, R) (q1, B, L) q1 (q2, 0, R) - - q2 - - -
  • 26. Construct a TM for each of the following. To recognize the language {0n1n2n}