1 / 14

Introduction to CS Theory

Introduction to CS Theory. Lecture 15 – Turing Machines Piotr Faliszewski pf@cs.rit.edu. Models of computation Finite automata Pushdown automata Restrictions FA Finite memory Left-to-right access to input PDA Infinite memory… … but accessible only in a stack form

Download Presentation

Introduction to CS Theory

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Introduction to CS Theory Lecture 15 – Turing Machines Piotr Faliszewski pf@cs.rit.edu

  2. Models of computation Finite automata Pushdown automata Restrictions FA Finite memory Left-to-right access to input PDA Infinite memory… … but accessible only in a stack form Left-to-right access to input Unrestricted model of computation? Turing machine Our Models of Computation So Far δ, q 0 0 1 1 0 0 0 …

  3. Church-Turing Thesis A language can be solved by an algorithm if and only if it can be accepted by a Turing machine that terminates on every output. How to validate Church-Turing Thesis? Many models of algorithms Unrestricted grammars Lambda calculus RAM machines … all equivalent to Turing machines Can Church-Turgin thesis be proven? Church-Turing Thesis Turing machines were, at the time, the most convincing model

  4. Turing machine M is a quintuple M = (Q, Σ, Γ, q0, δ) where: Q – finite set of states, assumed not to contain the two halting states, ha and hr. Σ is the input alphabet and Γ is the tape alphabet. ΣΓ. Γ does not contain the special blank symbol Δ q0 – the initial state δ – the transition function δ: Q  (Γ  {Δ})  (Q  {ha, hr})  (Γ  {Δ})  {R, L, S} δ is a total funciton (i.e., your machine should not get stuck in a non-halting state without knowing what to do) Definition

  5. δ(q, X) = (p, Y, D) means: If the machine is in state q, scanning symbol X, then: Change state to p Replace symbol X with symbol Y Move the tape according to the direction D (L – left, R – right, S – stay) Questions What happens if the machine “falls off” the left side of the tape? Do we really need the “S” move? Example Strings of length 2n Turing machine for the palindromes language Transition of a TM

  6. Configuration of a Turing machine Contents of the tape Position of the head Current state Notation (q, xay) means that Machine in state q The head is at the last symbol of the string xa The head is followed by string y, followed by an infinte number of blank symbols Initial configuration (q0, Δx) x – machines’s input string Given a Turing machine T, we define relation (q,xay) (p,zbw) If the latter can be obtained in one step from the former Configurations

  7. Definition. Let M = (Q, Σ, Γ, q0, δ) and let x  Σ* x is accepted by M if (q0, Δx) * (ha, yaz) for some y,a, z A string can be rejected if: M ends up in state hr, or M runs forever on x Notation L(M) – language accepted by a Turing machine M If a language is accepted by a Turing machine then we say that it is recursively enumerable The set of all languages accetped by Turing machines is called RE If a language is accepted by a Turing machine that halts on all inputs then we say that it is recursive Languages Accepted by TMs

  8. Examples • Give a Turing machine for the following language • { aibici | i ≥ 0 }

  9. Computing a Function on a TM • Definition • Let M = (Q, Σ, Γ, q0, δ) be a TM • Let f: Σ* Γ* be a total function • We say that M computes f if for each x in Σ* it holds that (q0, Δx) * (ha,Δf(x)) • Example • Give a TM that computes f(1n) = 12n

  10. We can add extra features to a Turing machine 2-way infinite tape More than one tape Random access to the memory Nondeterminisms 2-dimensional tape Example: Try to simulate these features (or prove that simulation is possible) Power of Turing Machines None of the extra features strengthens the model!

  11. Decision problem Name Input the mathematical entities about whose properties we ask Question A well-defined yes/no question Language A set of strings Languages encode decision problems Example Name: Connectivity Input: Graph G, vertices s and t Question: Are vertices s and t connected in G Languages and Decision Problems

  12. Our two fundamental questions What decision problems can and cannot be solved? What decision problem can and cannot be solved efficiently We focus on languages Chomsky Hierarchy Models of computation Regular languages / finite automata Context-free languages / push-down automata Turing machines Languages and Decision Problems

  13. Hierarchy of Languages All languages Recursive languages Finite languages Context-freelanguages

  14. Can everything be solved on a computer? Recursive languages Recursively enumerable languages  do they really exist? Two proofs… Counting… And an example of a language Undecidable Languages

More Related