fall 2006costas busch - rpi1 a universal turing machine

Download Fall 2006Costas Busch - RPI1 A Universal Turing Machine

Post on 29-Mar-2015




0 download

Embed Size (px)


  • Slide 1

Fall 2006Costas Busch - RPI1 A Universal Turing Machine Slide 2 Fall 2006Costas Busch - RPI2 Turing Machines are hardwired they execute only one program A limitation of Turing Machines: Real Computers are re-programmable Slide 3 Fall 2006Costas Busch - RPI3 Solution: Universal Turing Machine Reprogrammable machine Simulates any other Turing Machine Attributes: Slide 4 Fall 2006Costas Busch - RPI4 Universal Turing Machine simulates any Turing Machine Input of Universal Turing Machine: Description of transitions of Input string of Slide 5 Fall 2006Costas Busch - RPI5 Universal Turing Machine Description of Tape Contents of State of Three tapes Tape 2 Tape 3 Tape 1 Slide 6 Fall 2006Costas Busch - RPI6 We describe Turing machine as a string of symbols: We encode as a string of symbols Description of Tape 1 Slide 7 Fall 2006Costas Busch - RPI7 Alphabet Encoding Symbols: Encoding: Slide 8 Fall 2006Costas Busch - RPI8 State Encoding States: Encoding: Head Move Encoding Move: Encoding: Slide 9 Fall 2006Costas Busch - RPI9 Transition Encoding Transition: Encoding: separator Slide 10 Fall 2006Costas Busch - RPI10 Turing Machine Encoding Transitions: Encoding: separator Slide 11 Fall 2006Costas Busch - RPI11 Tape 1 contents of Universal Turing Machine: binary encoding of the simulated machine Tape 1 Slide 12 Fall 2006Costas Busch - RPI12 A Turing Machine is described with a binary string of 0s and 1s The set of Turing machines forms a language: each string of this language is the binary encoding of a Turing Machine Therefore: Slide 13 Fall 2006Costas Busch - RPI13 Language of Turing Machines L = { 010100101, 00100100101111, 111010011110010101, } (Turing Machine 1) (Turing Machine 2) Slide 14 Fall 2006Costas Busch - RPI14 Countable Sets Slide 15 Fall 2006Costas Busch - RPI15 Infinite sets are either: Countable or Uncountable Slide 16 Fall 2006Costas Busch - RPI16 Countable set: There is a one to one correspondence of elements of the set to Natural numbers (Positive Integers) (every element of the set is mapped to a number such that no two elements are mapped to same number) Slide 17 Fall 2006Costas Busch - RPI17 Example: Even integers: (positive) The set of even integers is countable Positive integers: Correspondence: corresponds to Slide 18 Fall 2006Costas Busch - RPI18 Example:The set of rational numbers is countable Rational numbers: Slide 19 Fall 2006Costas Busch - RPI19 Nave Approach Rational numbers: Positive integers: Correspondence: Doesnt work: we will never count numbers with nominator 2: Nominator 1 Slide 20 Fall 2006Costas Busch - RPI20 Better Approach Slide 21 Fall 2006Costas Busch - RPI21 Slide 22 Fall 2006Costas Busch - RPI22 Slide 23 Fall 2006Costas Busch - RPI23 Slide 24 Fall 2006Costas Busch - RPI24 Slide 25 Fall 2006Costas Busch - RPI25 Slide 26 Fall 2006Costas Busch - RPI26 Rational Numbers: Correspondence: Positive Integers: Slide 27 Fall 2006Costas Busch - RPI27 We proved: the set of rational numbers is countable by describing an enumeration procedure (enumerator) for the correspondence to natural numbers Slide 28 Fall 2006Costas Busch - RPI28 Definition An enumerator for is a Turing Machine that generates (prints on tape) all the strings of one by one Let be a set of strings (Language) and each string is generated in finite time Slide 29 Fall 2006Costas Busch - RPI29 Enumerator Machine for Finite time: strings output (on tape) Slide 30 Fall 2006Costas Busch - RPI30 Enumerator Machine Configuration Time 0 Time prints Slide 31 Fall 2006Costas Busch - RPI31 Time prints Slide 32 Fall 2006Costas Busch - RPI32 If for a set there is an enumerator, then the set is countable Observation: The enumerator describes the correspondence of to natural numbers Slide 33 Fall 2006Costas Busch - RPI33 Example: The set of strings is countable We will describe an enumerator for Approach: Slide 34 Fall 2006Costas Busch - RPI34 Naive enumerator: Produce the strings in lexicographic order: Doesnt work: strings starting with will never be produced Slide 35 Fall 2006Costas Busch - RPI35 Better procedure: 1. Produce all strings of length 1 2. Produce all strings of length 2 3. Produce all strings of length 3 4. Produce all strings of length 4.......... Proper Order (Canonical Order) Slide 36 Fall 2006Costas Busch - RPI36 Produce strings in Proper Order: length 2 length 3 length 1 Slide 37 Fall 2006Costas Busch - RPI37 Theorem: The set of all Turing Machines is countable Proof: Find an enumeration procedure for the set of Turing Machine strings Any Turing Machine can be encoded with a binary string of 0s and 1s Slide 38 Fall 2006Costas Busch - RPI38 1. Generate the next binary string of 0s and 1s in proper order 2. Check if the string describes a Turing Machine YES: if YES: print string on output tape NO: if NO: ignore string Enumerator: Repeat Slide 39 Fall 2006Costas Busch - RPI39 Binary stringsTuring Machines End of Proof Slide 40 Fall 2006Costas Busch - RPI40 Uncountable Sets Slide 41 Fall 2006Costas Busch - RPI41 We will prove that there is a language which is not accepted by any Turing machine Technique: Turing machines are countable Languages are uncountable (there are more languages than Turing Machines) Slide 42 Fall 2006Costas Busch - RPI42 A set is uncountable if it is not countable Definition: We will prove that there is a language which is not accepted by any Turing machine Slide 43 Fall 2006Costas Busch - RPI43 Theorem: If is an infinite countable set, then the powerset of is uncountable. (the powerset is the set whose elements are all possible sets made from the elements of ) Slide 44 Fall 2006Costas Busch - RPI44 Proof: Since is countable, we can write Elements of Slide 45 Fall 2006Costas Busch - RPI45 Elements of the powerset have the form: Slide 46 Fall 2006Costas Busch - RPI46 We encode each element of the powerset with a binary string of 0s and 1s Powerset element Binary encoding (in arbitrary order) Slide 47 Fall 2006Costas Busch - RPI47 Observation: Every infinite binary string corresponds to an element of the powerset: Example: Corresponds to: Slide 48 Fall 2006Costas Busch - RPI48 Lets assume (for contradiction) that the powerset is countable Then: we can enumerate the elements of the powerset Slide 49 Fall 2006Costas Busch - RPI49 Powerset element Binary encoding suppose that this is the respective Slide 50 Fall 2006Costas Busch - RPI50 Binary string: (birary complement of diagonal) Take the binary string whose bits are the complement of the diagonal Slide 51 Fall 2006Costas Busch - RPI51 The binary string corresponds to an element of the powerset : Slide 52 Fall 2006Costas Busch - RPI52 Thus, must be equal to some However, the i-th bit in the encoding of is the complement of the bit of, thus: Contradiction!!! i-th Slide 53 Fall 2006Costas Busch - RPI53 Since we have a contradiction: The powerset of is uncountable End of proof Slide 54 Fall 2006Costas Busch - RPI54 An Application: Languages The set of all Strings: infinite and countable Consider Alphabet : (we can enumerate the strings in proper order) Slide 55 Fall 2006Costas Busch - RPI55 The set of all Strings: infinite and countable Any language is a subset of : Consider Alphabet : Slide 56 Fall 2006Costas Busch - RPI56 Consider Alphabet : The set of all Strings: infinite and countable The powerset of contains all languages: uncountable Slide 57 Fall 2006Costas Busch - RPI57 Turing machines: Languages accepted By Turing Machines: accepts Denote: countable Note: countable Consider Alphabet : Slide 58 Fall 2006Costas Busch - RPI58 countable uncountable Languages accepted by Turing machines: All possible languages: Therefore: Slide 59 Fall 2006Costas Busch - RPI59 There is a language not accepted by any Turing Machine: (Language cannot be described by any algorithm) Conclusion: Slide 60 Fall 2006Costas Busch - RPI60 Turing-Acceptable Languages Non Turing-Acceptable Languages Slide 61 Fall 2006Costas Busch - RPI61 Note that: is a multi-set (elements may repeat) since a language may be accepted by more than one Turing machine However, if we remove the repeated elements, the resulting set is again countable since every element still corresponds to a positive integer


View more >