Presentation is loading. Please wait.

Presentation is loading. Please wait.

Courtesy Costas Busch - RPI1 A Universal Turing Machine.

Similar presentations


Presentation on theme: "Courtesy Costas Busch - RPI1 A Universal Turing Machine."— Presentation transcript:

1 Courtesy Costas Busch - RPI1 A Universal Turing Machine

2 Courtesy Costas Busch - RPI2 Turing Machines are “hardwired” they execute only one program A limitation of Turing Machines: Real Computers are re-programmable

3 Courtesy Costas Busch - RPI3 Solution: Universal Turing Machine Reprogrammable machine Simulates any other Turing Machine Attributes:

4 Courtesy Costas Busch - RPI4 Universal Turing Machine simulates any other Turing Machine Input of Universal Turing Machine: Description of transitions of Initial tape contents of

5 Courtesy Costas Busch - RPI5 Universal Turing Machine Description of Tape Contents of State of Three tapes Tape 2 Tape 3 Tape 1

6 Courtesy Costas Busch - RPI6 We describe Turing machine as a string of symbols: We encode as a string of symbols Description of Tape 1

7 Courtesy Costas Busch - RPI7 Alphabet Encoding Symbols: Encoding:

8 Courtesy Costas Busch - RPI8 State Encoding States: Encoding: Head Move Encoding Move: Encoding:

9 Courtesy Costas Busch - RPI9 Transition Encoding Transition: Encoding: separator

10 Courtesy Costas Busch - RPI10 Machine Encoding Transitions: Encoding: separator

11 Courtesy Costas Busch - RPI11 Tape 1 contents of Universal Turing Machine: encoding of the simulated machine as a binary string of 0’s and 1’s

12 Courtesy Costas Busch - RPI12 A Turing Machine is described with a binary string of 0’s and 1’s The set of Turing machines forms a language: each string of the language is the binary encoding of a Turing Machine Therefore:

13 Courtesy Costas Busch - RPI13 Language of Turing Machines L = { 010100101, 00100100101111, 111010011110010101, …… } (Turing Machine 1) (Turing Machine 2) ……

14 Courtesy Costas Busch - RPI14 Countable Sets

15 Courtesy Costas Busch - RPI15 Infinite sets are either: Countable or Uncountable

16 Courtesy Costas Busch - RPI16 Countable set: There is a one to one correspondence between elements of the set and Natural numbers Any finite set Any Countably infinite set: or

17 Courtesy Costas Busch - RPI17 Example: Even integers: The set of even integers is countable Positive integers: Correspondence: corresponds to

18 Courtesy Costas Busch - RPI18 Example:The set of rational numbers is countable Rational numbers:

19 Courtesy Costas Busch - RPI19 Naïve Proof Rational numbers: Positive integers: Correspondence: Doesn’t work: we will never count numbers with nominator 2:

20 Courtesy Costas Busch - RPI20 Better Approach

21 Courtesy Costas Busch - RPI21

22 Courtesy Costas Busch - RPI22

23 Courtesy Costas Busch - RPI23

24 Courtesy Costas Busch - RPI24

25 Courtesy Costas Busch - RPI25

26 Courtesy Costas Busch - RPI26 Rational Numbers: Correspondence: Positive Integers:

27 Courtesy Costas Busch - RPI27 We proved: the set of rational numbers is countable by describing an enumeration procedure

28 Courtesy Costas Busch - RPI28 Definition An enumeration procedure for is a Turing Machine that generates all strings of one by one Let be a set of strings and Each string is generated in finite time

29 Courtesy Costas Busch - RPI29 Enumeration Machine for Finite time: strings output (on tape)

30 Courtesy Costas Busch - RPI30 Enumeration Machine Configuration Time 0 Time

31 Courtesy Costas Busch - RPI31 Time

32 Courtesy Costas Busch - RPI32 If for a set there is an enumeration procedure, then the set is countable Observation:

33 Courtesy Costas Busch - RPI33 Example: The set of all strings is countable We will describe an enumeration procedure Proof:

34 Courtesy Costas Busch - RPI34 Naive procedure: Produce the strings in lexicographic order: Doesn’t work: strings starting with will never be produced

35 Courtesy Costas 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

36 Courtesy Costas Busch - RPI36 Produce strings in Proper Order: length 2 length 3 length 1

37 Courtesy Costas 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 0’s and 1’s

38 Courtesy Costas Busch - RPI38 1. Generate the next binary string of 0’s and 1’s 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 Enumeration Procedure: Repeat

39 Courtesy Costas Busch - RPI39 Uncountable Sets

40 Courtesy Costas Busch - RPI40 A set is uncountable if it is not countable Definition:

41 Courtesy Costas Busch - RPI41 Theorem: Let be an infinite countable set The powerset of is uncountable

42 Courtesy Costas Busch - RPI42 Proof: Since is countable, we can write Elements of

43 Courtesy Costas Busch - RPI43 Elements of the powerset have the form: ……

44 Courtesy Costas Busch - RPI44 We encode each element of the power set with a binary string of 0’s and 1’s Powerset element Encoding

45 Courtesy Costas Busch - RPI45 Let’s assume (for contradiction) that the powerset is countable. Then: we can enumerate the elements of the powerset

46 Courtesy Costas Busch - RPI46 Powerset element Encoding

47 Courtesy Costas Busch - RPI47 Take the powerset element whose bits are the complements in the diagonal

48 Courtesy Costas Busch - RPI48 New element: (birary complement of diagonal)

49 Courtesy Costas Busch - RPI49 The new element must be some of the powerset However, that’s impossible: the i-th bit of must be the complement of itself from definition of Contradiction!!!

50 Courtesy Costas Busch - RPI50 Since we have a contradiction: The powerset of is uncountable

51 Courtesy Costas Busch - RPI51 An Application: Languages Example Alphabet : The set of all Strings: infinite and countable

52 Courtesy Costas Busch - RPI52 Example Alphabet : The set of all Strings: infinite and countable A language is a subset of :

53 Courtesy Costas Busch - RPI53 Example Alphabet : The set of all Strings: infinite and countable The powerset of contains all languages: uncountable

54 Courtesy Costas Busch - RPI54 Languages: uncountable Turing machines: countable There are more languages than Turing Machines

55 Courtesy Costas Busch - RPI55 There are some languages not accepted by Turing Machines (These languages cannot be described by algorithms) Conclusion:

56 Courtesy Costas Busch - RPI56 Languages Accepted by Turing Machines Languages not accepted by Turing Machines


Download ppt "Courtesy Costas Busch - RPI1 A Universal Turing Machine."

Similar presentations


Ads by Google