Fall 2006Costas Busch - RPI1 A Universal Turing Machine
Fall 2006Costas Busch - RPI2 Turing Machines are hardwired they execute only one program A limitation of Turing Machines: Real Computers are re-programmable
Fall 2006Costas Busch - RPI3 Solution: Universal Turing Machine Reprogrammable machine Simulates any other Turing Machine Attributes:
Fall 2006Costas Busch - RPI4 Universal Turing Machine simulates any Turing Machine Input of Universal Turing Machine: Description of transitions of Input string of
Fall 2006Costas Busch - RPI5 Universal Turing Machine Description of Tape Contents of State of Three tapes Tape 2 Tape 3 Tape 1
Fall 2006Costas Busch - RPI6 We describe Turing machine as a string of symbols: We encode as a string of symbols Description of Tape 1
Fall 2006Costas Busch - RPI7 Alphabet Encoding Symbols: Encoding:
Fall 2006Costas Busch - RPI8 State Encoding States: Encoding: Head Move Encoding Move: Encoding:
Fall 2006Costas Busch - RPI9 Transition Encoding Transition: Encoding: separator
Fall 2006Costas Busch - RPI10 Turing Machine Encoding Transitions: Encoding: separator
Fall 2006Costas Busch - RPI11 Tape 1 contents of Universal Turing Machine: binary encoding of the simulated machine Tape 1
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:
Fall 2006Costas Busch - RPI13 Language of Turing Machines L = { , , , …… } (Turing Machine 1) (Turing Machine 2) ……
Fall 2006Costas Busch - RPI14 Countable Sets
Fall 2006Costas Busch - RPI15 Infinite sets are either: Countable or Uncountable
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)
Fall 2006Costas Busch - RPI17 Example: Even integers: (positive) The set of even integers is countable Positive integers: Correspondence: corresponds to
Fall 2006Costas Busch - RPI18 Example:The set of rational numbers is countable Rational numbers:
Fall 2006Costas Busch - RPI19 Naïve Approach Rational numbers: Positive integers: Correspondence: Doesnt work: we will never count numbers with nominator 2: Nominator 1
Fall 2006Costas Busch - RPI20 Better Approach
Fall 2006Costas Busch - RPI21
Fall 2006Costas Busch - RPI22
Fall 2006Costas Busch - RPI23
Fall 2006Costas Busch - RPI24
Fall 2006Costas Busch - RPI25
Fall 2006Costas Busch - RPI26 Rational Numbers: Correspondence: Positive Integers:
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
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
Fall 2006Costas Busch - RPI29 Enumerator Machine for Finite time: strings output (on tape)
Fall 2006Costas Busch - RPI30 Enumerator Machine Configuration Time 0 Time prints
Fall 2006Costas Busch - RPI31 Time prints
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
Fall 2006Costas Busch - RPI33 Example: The set of strings is countable We will describe an enumerator for Approach:
Fall 2006Costas Busch - RPI34 Naive enumerator: Produce the strings in lexicographic order: Doesnt work: strings starting with will never be produced
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 Proper Order (Canonical Order)
Fall 2006Costas Busch - RPI36 Produce strings in Proper Order: length 2 length 3 length 1
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
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
Fall 2006Costas Busch - RPI39 Binary stringsTuring Machines End of Proof
Fall 2006Costas Busch - RPI40 Uncountable Sets
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)
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
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 )
Fall 2006Costas Busch - RPI44 Proof: Since is countable, we can write Elements of
Fall 2006Costas Busch - RPI45 Elements of the powerset have the form: ……
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)
Fall 2006Costas Busch - RPI47 Observation: Every infinite binary string corresponds to an element of the powerset: Example: Corresponds to:
Fall 2006Costas Busch - RPI48 Lets assume (for contradiction) that the powerset is countable Then: we can enumerate the elements of the powerset
Fall 2006Costas Busch - RPI49 Powerset element Binary encoding suppose that this is the respective
Fall 2006Costas Busch - RPI50 Binary string: (birary complement of diagonal) Take the binary string whose bits are the complement of the diagonal
Fall 2006Costas Busch - RPI51 The binary string corresponds to an element of the powerset :
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
Fall 2006Costas Busch - RPI53 Since we have a contradiction: The powerset of is uncountable End of proof
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)
Fall 2006Costas Busch - RPI55 The set of all Strings: infinite and countable Any language is a subset of : Consider Alphabet :
Fall 2006Costas Busch - RPI56 Consider Alphabet : The set of all Strings: infinite and countable The powerset of contains all languages: uncountable
Fall 2006Costas Busch - RPI57 Turing machines: Languages accepted By Turing Machines: accepts Denote: countable Note: countable Consider Alphabet :
Fall 2006Costas Busch - RPI58 countable uncountable Languages accepted by Turing machines: All possible languages: Therefore:
Fall 2006Costas Busch - RPI59 There is a language not accepted by any Turing Machine: (Language cannot be described by any algorithm) Conclusion:
Fall 2006Costas Busch - RPI60 Turing-Acceptable Languages Non Turing-Acceptable Languages
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