# costas busch - lsu1 a universal turing machine. costas busch - lsu2 turing machines are...

Post on 04-Jan-2016

213 views

Embed Size (px)

TRANSCRIPT

Costas Busch - LSU*A Universal Turing Machine

Costas Busch - LSU

Costas Busch - LSU*Turing Machines are hardwiredthey executeonly one programA limitation of Turing Machines:Real Computers are re-programmable

Costas Busch - LSU

Costas Busch - LSU*Solution:Universal Turing Machine Reprogrammable machine

Simulates any other Turing MachineAttributes:

Costas Busch - LSU

Costas Busch - LSU*Universal Turing Machine simulates any Turing MachineInput of Universal Turing Machine:Description of transitions ofInput string of

Costas Busch - LSU

Costas Busch - LSU*Universal Turing MachineDescription of Tape Contents of State of Three tapesTape 2Tape 3Tape 1

Costas Busch - LSU

Costas Busch - LSU*We describe Turing machine as a string of symbols:

We encode as a string of symbolsDescription of Tape 1

Costas Busch - LSU

Costas Busch - LSU*Alphabet EncodingSymbols:Encoding:

Costas Busch - LSU

Costas Busch - LSU*State EncodingStates:Encoding:Head Move EncodingMove:Encoding:

Costas Busch - LSU

Costas Busch - LSU*Transition EncodingTransition:Encoding:separator

Costas Busch - LSU

Costas Busch - LSU*Turing Machine EncodingTransitions:Encoding:separator

Costas Busch - LSU

Costas Busch - LSU*Tape 1 contents of Universal Turing Machine:

binary encoding of the simulated machineTape 1

Costas Busch - LSU

Costas Busch - LSU*A Turing Machine is described with a binary string of 0s and 1sThe set of Turing machines forms a language:each string of this language isthe binary encoding of a Turing MachineTherefore:

Costas Busch - LSU

Costas Busch - LSU*Language of Turing MachinesL = { 010100101,

00100100101111,

111010011110010101, }(Turing Machine 1)(Turing Machine 2)

Costas Busch - LSU

Costas Busch - LSU*Countable Sets

Costas Busch - LSU

Costas Busch - LSU*Infinite sets are either: Countable

or

Uncountable

Costas Busch - LSU

Costas Busch - LSU*Countable set:There is a one to one correspondence (injection)ofelements of the setto Positive integers (1,2,3,)Every element of the set is mapped to a positive number such that no two elements are mapped to same number

Costas Busch - LSU

Costas Busch - LSU*Example:Even integers:(positive)The set of even integers is countablePositive integers:Correspondence:corresponds to

Costas Busch - LSU

Costas Busch - LSU*Example:The set of rational numbersis countableRational numbers:

Costas Busch - LSU

Costas Busch - LSU*Nave ApproachRational numbers:Positive integers:Correspondence:Nominator 1

Costas Busch - LSU

Costas Busch - LSU*Better Approach

Costas Busch - LSU

Costas Busch - LSU*

Costas Busch - LSU

Costas Busch - LSU*

Costas Busch - LSU

Costas Busch - LSU*

Costas Busch - LSU

Costas Busch - LSU*

Costas Busch - LSU

Costas Busch - LSU*

Costas Busch - LSU

Costas Busch - LSU*Rational Numbers:Correspondence:Positive Integers:

Costas Busch - LSU

Costas Busch - LSU*We proved:

the set of rational numbers is countable by describing an enumeration procedure (enumerator) for the correspondence to natural numbers

Costas Busch - LSU

Costas Busch - LSU*DefinitionAn enumerator for is a Turing Machinethat generates (prints on tape)all the strings of one by oneLet be a set of strings (Language) andeach string is generated in finite time

Costas Busch - LSU

Costas Busch - LSU*EnumeratorMachine for Finite time:stringsoutput(on tape)

Costas Busch - LSU

Costas Busch - LSU*Enumerator MachineConfigurationTime 0Timeprints

Costas Busch - LSU

Costas Busch - LSU*TimeTimeprintsprints

Costas Busch - LSU

Costas Busch - LSU*If for a set there is an enumerator, then the set is countableObservation:The enumerator describes the correspondence of to natural numbers

Costas Busch - LSU

Costas Busch - LSU*Example:The set of stringsis countable We will describe an enumerator forApproach:

Costas Busch - LSU

Costas Busch - LSU*Naive enumerator:Produce the strings in lexicographic order:Doesnt work: strings starting with will never be produced

Costas Busch - LSU

Costas Busch - LSU*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)

Costas Busch - LSU

Costas Busch - LSU*Produce strings in Proper Order:length 2length 3length 1

Costas Busch - LSU

Costas Busch - LSU*Theorem:The set of all Turing Machinesis countable

Costas Busch - LSU

Costas Busch - LSU*1. Generate the next binary string of 0s and 1s in proper order

2. Check if the string describes a Turing Machine if YES: print string on output tape if NO: ignore stringEnumerator:Repeat

Costas Busch - LSU

Costas Busch - LSU*Binary stringsTuring MachinesEnd of Proof

Costas Busch - LSU

Costas Busch - LSU*Uncountable Sets

Costas Busch - LSU

Costas Busch - LSU*We will prove that there is a languagewhich is not accepted by any Turing machineTechnique:Turing machines are countable

Languages are uncountable(there are more languages than Turing Machines)

Costas Busch - LSU

Costas Busch - LSU*Theorem:If is an infinite countable set, then

the powerset of is uncountable. The powerset is the set whose elementsare all possible sets made from the elements of Example:

Costas Busch - LSU

Costas Busch - LSU*Proof:Since is countable, we can write Element of

Costas Busch - LSU

Costas Busch - LSU*Elements of the powerset have the form:

Costas Busch - LSU

Costas Busch - LSU*We encode each element of the powersetwith a binary string of 0s and 1sPowersetelementBinary encoding(in arbitrary order)

Costas Busch - LSU

Costas Busch - LSU*Observation:Every infinite binary string correspondsto an element of the powerset:Example:Corresponds to:

Costas Busch - LSU

Costas Busch - LSU*Lets assume (for contradiction) that the powerset is countableThen: we can enumerate the elements of the powerset

Costas Busch - LSU

Costas Busch - LSU*Powerset elementBinary encodingsuppose that this is the respective

Costas Busch - LSU

Costas Busch - LSU*Binary string:(birary complement of diagonal)Take the binary string whose bits are the complement of the diagonal

Costas Busch - LSU

Costas Busch - LSU*The binary stringcorrespondsto an element of the powerset :

Costas Busch - LSU

Costas Busch - LSU*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

Costas Busch - LSU

Costas Busch - LSU*Since we have a contradiction:The powerset of is uncountable End of proof

Costas Busch - LSU

Costas Busch - LSU*An Application: LanguagesThe set of all strings:infinite and countableConsider Alphabet :because we can enumerate the strings in proper order

Costas Busch - LSU

Costas Busch - LSU*The set of all strings:infinite and countableAny language is a subset of :Consider Alphabet :

Costas Busch - LSU

Costas Busch - LSU*Consider Alphabet :The set of all Strings:infinite and countableThe powerset of contains all languages:uncountable

Costas Busch - LSU

Costas Busch - LSU*Turing machines: Languages acceptedBy Turing Machines: acceptsDenote:countableNote:countablecountableConsider Alphabet :

Costas Busch - LSU

Costas Busch - LSU*countableuncountableLanguages acceptedby Turing machines:All possible languages:Therefore:

Costas Busch - LSU

Costas Busch - LSU*There is a language not acceptedby any Turing Machine:(Language cannot be described by any algorithm)Conclusion:

Costas Busch - LSU

Costas Busch - LSU*Turing-Acceptable LanguagesNon Turing-Acceptable Languages

Costas Busch - LSU

Costas Busch - LSU*Note that:is a multi-set (elements may repeat)since a language may be accepted by more than one Turing machineHowever, if we remove the repeated elements, the resulting set is again countable since every element still corresponds to a positive integer

Costas Busch - LSU

*