Theory of Computation Turing Machines.

Slides:



Advertisements
Similar presentations
Turing Machines Memory = an infinitely long tape Persistent storage A read/write tape head that can move around the tape Initially, the tape contains only.
Advertisements

Fall 2004COMP 3351 Turing Machines. Fall 2004COMP 3352 The Language Hierarchy Regular Languages Context-Free Languages ? ?
Courtesy Costas Busch - RPI1 Turing Machines. Courtesy Costas Busch - RPI2 The Language Hierarchy Regular Languages Context-Free Languages ? ?
Computability and Complexity 3-1 Turing Machine Computability and Complexity Andrei Bulatov.
Costas Busch - RPI1 Turing Machines. Costas Busch - RPI2 The Language Hierarchy Regular Languages Context-Free Languages ? ?
1 Turing Machines. 2 The Language Hierarchy Regular Languages Context-Free Languages ? ?
1 Turing Machines. 2 A Turing Machine Tape Read-Write head Control Unit.
More Theory of Computing
Randomized Turing Machines
Theory of Computing Lecture 15 MAS 714 Hartmut Klauck.
CSCI 2670 Introduction to Theory of Computing September 28, 2005.
 Computability Theory Turing Machines Professor MSc. Ivan A. Escobar
1 CO Games Development 2 Week 21 Turing Machines & Computability Gareth Bellaby.
Finite State Automata / Machines and Turing Machines.
Introduction to CS Theory Lecture 15 –Turing Machines Piotr Faliszewski
Halting Problem Introduction to Computing Science and Programming I.
Cs3102: Theory of Computation Class 14: Turing Machines Spring 2010 University of Virginia David Evans.
December 1, 2009Theory of Computation Lecture 21: Turing Machines II 1 Simulation of L n in T We will now construct a Post-Turing program Q that simulates.
THE CHURCH-TURING T H E S I S “ TURING MACHINES” Part 1 – Pages COMPUTABILITY THEORY.
CSE 311 Foundations of Computing I Lecture 26 Computability: Turing machines, Undecidability of the Halting Problem Spring
CSE 311 Foundations of Computing I Lecture 29 Computability: Turing machines, Undecidability of the Halting Problem Autumn 2012 CSE 3111.
Computer Science 101 Theory of Computing. Computer Science is... The study of algorithms, with respect to –their formal properties –their linguistic realizations.
TM Design Macro Language D and SD MA/CSSE 474 Theory of Computation.
Theory of computing, part 4. 1Introduction 2Theoretical background Biochemistry/molecular biology 3Theoretical background computer science 4History of.
1 Section 13.1 Turing Machines A Turing machine (TM) is a simple computer that has an infinite amount of storage in the form of cells on an infinite tape.
1 IDT Open Seminar ALAN TURING AND HIS LEGACY 100 Years Turing celebration Gordana Dodig Crnkovic, Computer Science and Network Department Mälardalen University.
1 Turing Machines and Equivalent Models Section 13.1 Turing Machines.
Overview of the theory of computation Episode 3 0 Turing machines The traditional concepts of computability, decidability and recursive enumerability.
Automata & Formal Languages, Feodor F. Dragan, Kent State University 1 CHAPTER 3 The Church-Turing Thesis Contents Turing Machines definitions, examples,
1 Introduction to Turing Machines
1 CD5560 FABER Formal Languages, Automata and Models of Computation Lecture 12 Mälardalen University 2007.
1 Turing Machines. 2 The Language Hierarchy Regular Languages Context-Free Languages ? ?
CS 154 Formal Languages and Computability April 12 Class Meeting Department of Computer Science San Jose State University Spring 2016 Instructor: Ron Mak.
1 Turing Machines. 2 The Language Hierarchy Regular Languages Context-Free Languages ? ?
Recursively Enumerable and Recursive Languages. Definition: A language is recursively enumerable if some Turing machine accepts it.
1 A Universal Turing Machine. 2 Turing Machines are “hardwired” they execute only one program A limitation of Turing Machines: Real Computers are re-programmable.
Fall 2013 Lecture 27: Turing machines and decidability CSE 311: Foundations of Computing.
KS3 Mathematics N5 Using Fractions
Turing’s Thesis.
Turing’s Thesis Costas Busch - LSU.
CSE202: Introduction to Formal Languages and Automata Theory
Introduction to Computing Science and Programming I
COMPUTER ARCHITECTURE AND THE CYNAIDE COATED APPLE.
Part VI NP-Hardness.
Class 30: Models of Computation CS200: Computer Science
CSE 311 Foundations of Computing I
(Universal Turing Machine)
CSE 105 theory of computation
Turing’s Thesis Costas Busch - RPI.
Theory of Computation Lecture 22: Turing Machines III
Turing Machines 2nd 2017 Lecture 9.
CSE 105 theory of computation
Modeling Computation:
Chapter 9 TURING MACHINES.
Jaya Krishna, M.Tech, Assistant Professor
OOP Paradigms There are four main aspects of Object-Orientated Programming Inheritance Polymorphism Abstraction Encapsulation We’ve seen Encapsulation.
Turing Machines (TM) Deterministic Turing Machine (DTM)
Decidable Languages Costas Busch - LSU.
Coding Concepts (Basics)
MA/CSSE 474 Theory of Computation
Recall last lecture and Nondeterministic TMs
Class 34: Models of Computation CS200: Computer Science
CSE S. Tanimoto Turing Completeness
CSE 105 theory of computation
Instructor: Aaron Roth
Variants of Turing machines
CO Games Development 2 Week 21 Turing Machines & Computability
Theory of Computation Lecture 23: Turing Machines III
CSE 105 theory of computation
Presentation transcript:

Theory of Computation Turing Machines

Turing Machines: Origin In the 40s, a mathematician called David Hilbert proposed a question Known as his 10th problem This was a decision problem The solution was either yes or no Alan Turing was intrigued by this problem Is it true that 𝑥 2 + 𝑦 2 +1=0 has roots which are whole numbers? Theory of Computation: Turing Machines

Turing Machines: Origin From this question, Turing devised an abstract model of computation Originally aimed solely at solving this problem He defined an effective procedure for solving this problem A more rigorous definition of an algorithm He based this procedure on how human computers carried out algorithms People which calculated values Theory of Computation: Turing Machines

Turing Machines: Origin The procedure involves a few things An infinitely long one-dimensional piece of tape (with equally-sized spaces on it) An instrument for writing/reading spaces on the tape A mechanism for moving to different spaces on the tape Theory of Computation: Turing Machines

Turing Machines: Origin Each space on the tape can contain Either nothing at all (an empty space) OR a specific symbol (chosen from an Alphabet) These symbols are usually restricted (i.e. 0 and 1) As we can easily create any other symbol as a combination of base symbols As shown in the table N Series 1 2 11 3 111 4 1111 5 11111 Theory of Computation: Turing Machines

Turing Machine: Origins Finally, the behaviour of the machine was determined solely by The current state-of-mind (or just ‘state’) of the machine, and The observed symbols in the current space on the tape While there may by infinite spaces on the tape, the machine can only observe one at a time The same also applies to the different state the machine can be in The machine has a finite number of them, and can only be in one at a time Theory of Computation: Turing Machines

Turing Machines: Origins Turing devised this idea for human computers Turing also thought that anything that is computable can be broken into its smallest computations And represented in one of these machines For any computer/program we’ve made so far, that is correct! Theory of Computation: Turing Machines

Worked Example Here is the problem we need to ‘solve’ This is another decision problem Which we are going to solve using a Turing machine To ‘set up’ this machine, we need To put any starting symbols on the tape To work out what are states are (and how to transition between them) Can we test if an input string has 𝑛 0s, followed by 𝑛 1s? Theory of Computation: Turing Machines

Theory of Computation: Turing Machines Worked Example Let’s start by getting the tape set up The tape is infinite Giving us as much space as we want to work with We’re going to have three symbols in our alphabet for this machine #, 0, 1 Then let’s start with an example input like so: # 1 Theory of Computation: Turing Machines

Theory of Computation: Turing Machines Worked Example For this machine, we either accept or reject the input based on The symbols between the two #s If there are no symbols between these #s, then the input is accepted If there are symbols left over, the input is rejected # 1 Theory of Computation: Turing Machines

Theory of Computation: Turing Machines Worked Example With the state of the tape set up, the next thing we need to work out is a bit trickier What states and transitions will the machine use? You may recognise both these terms from Finite-State Machines That’s because a Turing Machine uses the same concepts It has states that it is currently on And can transition between states based off of an input Theory of Computation: Turing Machines

Theory of Computation: Turing Machines Worked Example We need to create states and transitions so that the following happens Start at the left-most # Remove the first 0 that is found, then move to the right-most # Remove the first 1 that is found, then move to the left-most # Repeat this until no 0 or 1 is found, at which point the machine stops The transitions that go with these states need An input (the possible symbol we could read under the ‘read head’) An output (where the ‘read head’ will move, and what it could write in the current space) Theory of Computation: Turing Machines

Theory of Computation: Turing Machines Worked Example Here is the state transition diagram for this Turing Machine Each transition is a directional arrow From one state to another Each label on a transition is the input/output Input goes on the left of the bar (|) Output goes on the right Theory of Computation: Turing Machines

Theory of Computation: Turing Machines Worked Example Any input for a transition is what must be read from the tape in the current position Any output for a transition is what will be written to on that space The arrows show the direction of movement for the read head Theory of Computation: Turing Machines

Can we test if an input string only contains 0s (and no 1s at all)? Create a Turing Machine that answers the following problem You will need to show the starting tape (including any symbols) And you will need to create the state transition diagram Once done, state what possible tape symbols your Turing Machine may end with And what those mean Can we test if an input string only contains 0s (and no 1s at all)? Theory of Computation: Turing Machines

Transition Rules Reminder Remember (from our look at Finite State Machines) that transition rules have different representations They are commonly seen in state transition diagrams As labels on directed arrows However, we can represent them mathematically using a specific symbol Can you remember what that symbol is? Theory of Computation: Turing Machines

Transition Rules Reminder We use the symbol 𝛿 (delta)! The input goes inside brackets after it The output goes after the equal sign Here is an example: 𝛿 1, 0 =☐, → This means “if 1 or 0 is in the current space under the read/write head, replace it with a blank space and move the read/write head to the right” Theory of Computation: Turing Machines

Tracking Turing Machine Execution A handy thing to be able to do is track the execution of a Turing Machine This means keep track of all the states of the tape as the Turing Machine executes its states/transitions We can then show all these tape states in something like a table Theory of Computation: Turing Machines

Tracking Turing Machine Execution However, we first need to know the notation we’re going to use We’ll consider the tape as three different sections Everything to the left of the read/write head The cell under the read/write head Everything to the right of the read/write head We will show that using something like this: ☐, 1, 00☐1 Theory of Computation: Turing Machines

Tracking Turing Machine Execution Staying on this example: #, 1, 00☐1 The first value in the brackets means there is only one cell to the left of the read/write head And it contains # Then the read/write head is currently looking at the symbol 1 Finally, there are four spaces to the right of the read/write head And the order of them in the brackets is their order, from left-to-right The tape is infinite, meaning we ignore any blank spaces to the left/right of any written symbols Theory of Computation: Turing Machines

Tracking Turing Machine Execution Let’s use the same 0s as 1s machine from the worked example earlier With a tape of #0011#, here is the machine’s execution Execution of Machine (, #, 0011#) (#, 0, 011#) (#, ☐, 011#) (#☐, 0, 11#) (#☐0, 1, 1#) (#☐01, 1, #) (#☐011, #, ) Execution of Machine (#☐01, 1, #) (#☐01, ☐, #) (#☐0, 1, ☐#) (#☐, 0, 1☐#) (#, ☐, 01☐#) (#☐, ☐, 1☐#) Execution of Machine (#☐☐, 1, ☐#) (#☐☐1, ☐, #) (#☐☐, ☐, ☐#) (#☐, ☐, ☐☐#) Theory of Computation: Turing Machines

Theory of Computation: Turing Machines Copy down the execution of the machine you made for an earlier exercise Which tests if an input string only contains 0s (and no 1s) Make two executions for these inputs 0000 0100 Feel free to add any other symbols your Turing Machine requires And lay out the inputs at any position on the tape Theory of Computation: Turing Machines

Turing Machines and Computation Turing Machines are very important to the idea of computation And whether a solution is computable It is enough to know that a specific result can be found by following a specific algorithm However, we cannot show that a result is not computable We can show the ‘computability’ of a solution by seeing if we can make a Turing Machine for it If one exists, then an algorithm for its solution exists too If not, then no computable solution exists Theory of Computation: Turing Machines

Turing Machines and Computation A program can be represented by a Turing Machine Saying that a solution to a problem is computable only if a Turing Machine exists is correct However, we can reverse that logic We can better say if a Turing Machine exists, there exists a computable solution This means every algorithm we can create/think of can also exist as a Turing Machine This concept is known as the Church-Turing thesis Theory of Computation: Turing Machines

Turing Machines and Computation This ultimately means that anything a computer can compute, a Turing Machine can compute as well ! So, any limitations a Turing Machine has, a computer has as well A Turing Machine is the most basic of operations It cannot be broken down further However, other computers can be reduced Which means no computer can be more powerful than a Turing Machine Theory of Computation: Turing Machines

Turing Machines and Computation We can simulate more complex calculations by connecting together multiple Turing Machines Which use the result as one as the input of another When thinking about the computability of solutions, using larger computers/devices would be bad Take a processor, which changes every few years If we base our idea on computability on one of these processors, we would need to re-evaluate these thoughts for every new processor However, basing our thoughts on a Turing Machine, which doesn’t change, means we don’t need to re-evaluate our ideas of computability Theory of Computation: Turing Machines

Universal Turing Machine The idea of connecting multiple Turing Machines together gave Turing an idea Can a universal machine be created that can ‘simulate’ other machines? This machine is known as a Universal Turing Machine This machine would have three bits of information for the machine it is simulating A basic description of the machine The contents of the machine’s tape The internal state of the machine Theory of Computation: Turing Machines

Universal Turing Machine The universal machine would simulate the machine in question by looking at the input on the tape And the state of the machine It would then control the machine by changing its state based off the input This leads to the idea of a “computer running other computers” Theory of Computation: Turing Machines

Universal Turing Machine This concept of computers running other computers actually gave John von Neumann the idea of the stored program And even gave way to the idea of interpreters As they are programs that run other programs Without this idea of a Universal Turing Machine, modern computers wouldn’t be a thing Or they would be drastically different Theory of Computation: Turing Machines