SlideShare a Scribd company logo
1 of 25
Download to read offline
Computer
Science
Foundations
Turing Machine Edition


Jason Dew
Geezeo / Catamorphic Labs
Alan
Turing
Entscheidungsproblem




             David
            Hilbert
Alphabet
any set of symbols

examples:
● {a, b, c, d, ..., z}

● {0, 1, 2, 3, ..., 9}

● {0, 1}
String
sequence of symbols from the alphabet

examples:
● foobar

● 0101001

● (empty string)
Formal Language
any set of strings over an alphabet

examples:
● {foo, bar, baz}

● {00, 01, 10, 11}

● {b, ab, aab, aaab, aaaab, ... }
Deterministic
Finite Automata




    http://15mmvsf.bagofmice.com/vsf/prev_robot.htm
Formal Definition
● an alphabet

● a set of states
   ○ one denoted as a "starting state"
   ○ one or more denoted as "accepting states"

● a transition function
   ○ takes a symbol and a state and returns a new state
DFA accepting
multiples of 3
Nondeterministic
Finite Automata
Formal Definition
● an alphabet

● a set of states
   ○ one denoted as a "starting state"
   ○ one or more denoted as "accepting states"

● a transition function
  ○ takes a symbol and a state and returns
      zero or more states
Example NFA
Theorem


 Any NFA can be converted
  into an equivalent DFA.
Regular Language


    Any language which
   can be recognized by
  some finite automaton.
Regular Expressions
Theorem


  A language is regular
       if and only if
 some regular expression
       describes it.
Turing machines
Formal Definition                      (slightly simplified)



● two alphabets
  ○ one for reading, the input alphabet
  ○ one for writing, the output (or tape) alphabet

● a set of states
   ○ one starting state
   ○ one accepting state
   ○ one rejecting state

● a transition function
     takes a symbol and a state and returns
       a new state, a symbol to write, and Left or Right
Example TM
Let's call it M

It accepts strings whose length is a power of 2

Accepted strings: "0", "00", "0000"

Rejected strings: "", "000", "000000"
A description of M




                     Attribution: Sipser, Figure 3.8
Running on "00"
                  tape   state

                  .00_   q1

                  _.0_   q2

                  _x._   q3

                  _.x_   q5

                  ._x_   q5

                  _.x_   q2

                  _x._   q2

                  _x_.   qaccept
Running on "0000"
tape     state

.0000_   q1      tape     state

_.000_   q2      _.x0x_   q2

_x.00_   q3      _x.0x_   q2

_x0.0_   q4      _xx.x_   q3
                                  tape     state
_x0x._   q3      _xxx._   q3      _.xxx_   q2

_x0.x_   q5      _xx.x_   q5      _x.xx_   q2

_x.0x_   q5      _x.xx_   q5      _xx.x_   q2

_.x0x_   q5      _.xxx_   q5      _xxx._   q2

._x0x_   q5      ._xxx_   q5      _xxx_.   qaccept
Wrapping up


Why do we care about
 Turing machines?
References
Deterministic finite automaton. (2012, March 11). Retrieved from http://en.wikipedia.
org/wiki/Deterministic_finite_automaton

Nondeterministic finite automaton. (2012, April 20). Retrieved from http://en.
wikipedia.org/wiki/Nondeterministic_finite_automaton

Petzold, C. (2008). The annotated turing. Indianapolis: Wiley Publishing, Inc.

Sipser, M. (2006). Introduction to the theory of computation. (2nd ed.). Boston:
Thompson Course Technology.

Turing machine. (2012, April 17). Retrieved from http://en.wikipedia.
org/wiki/Turing_machine
Come work with me!

More Related Content

Similar to Computer Science Fundamentals - Turing Machines (10)

FF and Latches.ppt
FF and Latches.pptFF and Latches.ppt
FF and Latches.ppt
 
Theory of computation:Finite Automata, Regualr Expression, Pumping Lemma
Theory of computation:Finite Automata, Regualr Expression, Pumping LemmaTheory of computation:Finite Automata, Regualr Expression, Pumping Lemma
Theory of computation:Finite Automata, Regualr Expression, Pumping Lemma
 
13.ppt
13.ppt13.ppt
13.ppt
 
3.pdf
3.pdf3.pdf
3.pdf
 
TuringMachines.pdf
TuringMachines.pdfTuringMachines.pdf
TuringMachines.pdf
 
flat unit1
flat unit1flat unit1
flat unit1
 
Lecture 3
Lecture 3Lecture 3
Lecture 3
 
Module 1 ppt class.pptx
Module 1 ppt class.pptxModule 1 ppt class.pptx
Module 1 ppt class.pptx
 
Module ppt class.pptx
Module ppt class.pptxModule ppt class.pptx
Module ppt class.pptx
 
2012 mdsp pr06  hmm
2012 mdsp pr06  hmm2012 mdsp pr06  hmm
2012 mdsp pr06  hmm
 

Recently uploaded

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Recently uploaded (20)

Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptx
 
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
AI in Action: Real World Use Cases by Anitaraj
AI in Action: Real World Use Cases by AnitarajAI in Action: Real World Use Cases by Anitaraj
AI in Action: Real World Use Cases by Anitaraj
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 

Computer Science Fundamentals - Turing Machines

  • 3. Entscheidungsproblem David Hilbert
  • 4. Alphabet any set of symbols examples: ● {a, b, c, d, ..., z} ● {0, 1, 2, 3, ..., 9} ● {0, 1}
  • 5. String sequence of symbols from the alphabet examples: ● foobar ● 0101001 ● (empty string)
  • 6. Formal Language any set of strings over an alphabet examples: ● {foo, bar, baz} ● {00, 01, 10, 11} ● {b, ab, aab, aaab, aaaab, ... }
  • 7. Deterministic Finite Automata http://15mmvsf.bagofmice.com/vsf/prev_robot.htm
  • 8. Formal Definition ● an alphabet ● a set of states ○ one denoted as a "starting state" ○ one or more denoted as "accepting states" ● a transition function ○ takes a symbol and a state and returns a new state
  • 11. Formal Definition ● an alphabet ● a set of states ○ one denoted as a "starting state" ○ one or more denoted as "accepting states" ● a transition function ○ takes a symbol and a state and returns zero or more states
  • 13. Theorem Any NFA can be converted into an equivalent DFA.
  • 14. Regular Language Any language which can be recognized by some finite automaton.
  • 16. Theorem A language is regular if and only if some regular expression describes it.
  • 18. Formal Definition (slightly simplified) ● two alphabets ○ one for reading, the input alphabet ○ one for writing, the output (or tape) alphabet ● a set of states ○ one starting state ○ one accepting state ○ one rejecting state ● a transition function takes a symbol and a state and returns a new state, a symbol to write, and Left or Right
  • 19. Example TM Let's call it M It accepts strings whose length is a power of 2 Accepted strings: "0", "00", "0000" Rejected strings: "", "000", "000000"
  • 20. A description of M Attribution: Sipser, Figure 3.8
  • 21. Running on "00" tape state .00_ q1 _.0_ q2 _x._ q3 _.x_ q5 ._x_ q5 _.x_ q2 _x._ q2 _x_. qaccept
  • 22. Running on "0000" tape state .0000_ q1 tape state _.000_ q2 _.x0x_ q2 _x.00_ q3 _x.0x_ q2 _x0.0_ q4 _xx.x_ q3 tape state _x0x._ q3 _xxx._ q3 _.xxx_ q2 _x0.x_ q5 _xx.x_ q5 _x.xx_ q2 _x.0x_ q5 _x.xx_ q5 _xx.x_ q2 _.x0x_ q5 _.xxx_ q5 _xxx._ q2 ._x0x_ q5 ._xxx_ q5 _xxx_. qaccept
  • 23. Wrapping up Why do we care about Turing machines?
  • 24. References Deterministic finite automaton. (2012, March 11). Retrieved from http://en.wikipedia. org/wiki/Deterministic_finite_automaton Nondeterministic finite automaton. (2012, April 20). Retrieved from http://en. wikipedia.org/wiki/Nondeterministic_finite_automaton Petzold, C. (2008). The annotated turing. Indianapolis: Wiley Publishing, Inc. Sipser, M. (2006). Introduction to the theory of computation. (2nd ed.). Boston: Thompson Course Technology. Turing machine. (2012, April 17). Retrieved from http://en.wikipedia. org/wiki/Turing_machine