Download presentation

Presentation is loading. Please wait.

1
Fall 2004COMP 3351 A Universal Turing Machine

2
Fall 2004COMP 3352 Turing Machines are “hardwired” they execute only one program A limitation of Turing Machines: Real Computers are re-programmable

3
Fall 2004COMP 3353 Solution: Universal Turing Machine Reprogrammable machine Simulates any other Turing Machine Attributes:

4
Fall 2004COMP 3354 Universal Turing Machine simulates any other Turing Machine Input of Universal Turing Machine: Description of transitions of Initial tape contents of

5
Fall 2004COMP 3355 Universal Turing Machine Description of Tape Contents of State of Three tapes Tape 2 Tape 3 Tape 1

6
Fall 2004COMP 3356 We describe Turing machine as a string of symbols: We encode as a string of symbols Description of Tape 1

7
Fall 2004COMP 3357 Alphabet Encoding Symbols: Encoding:

8
Fall 2004COMP 3358 State Encoding States: Encoding: Head Move Encoding Move: Encoding:

9
Fall 2004COMP 3359 Transition Encoding Transition: Encoding: separator

10
Fall 2004COMP 33510 Machine Encoding Transitions: Encoding: separator

11
Fall 2004COMP 33511 Tape 1 contents of Universal Turing Machine: encoding of the simulated machine as a binary string of 0’s and 1’s

12
Fall 2004COMP 33512 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
Fall 2004COMP 33513 Language of Turing Machines L = { 010100101, 00100100101111, 111010011110010101, …… } (Turing Machine 1) (Turing Machine 2) ……

14
Fall 2004COMP 33514 Countable Sets

15
Fall 2004COMP 33515 Infinite sets are either: Countable or Uncountable

16
Fall 2004COMP 33516 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
Fall 2004COMP 33517 Example: Even integers: The set of even integers is countable Positive integers: Correspondence: corresponds to

18
Fall 2004COMP 33518 Example:The set of rational numbers is countable Rational numbers:

19
Fall 2004COMP 33519 Naïve Proof Rational numbers: Positive integers: Correspondence: Doesn’t work: we will never count numbers with nominator 2:

20
Fall 2004COMP 33520 Better Approach

21
Fall 2004COMP 33521

22
Fall 2004COMP 33522

23
Fall 2004COMP 33523

24
Fall 2004COMP 33524

25
Fall 2004COMP 33525

26
Fall 2004COMP 33526 Rational Numbers: Correspondence: Positive Integers:

27
Fall 2004COMP 33527 We proved: the set of rational numbers is countable by describing an enumeration procedure

28
Fall 2004COMP 33528 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
Fall 2004COMP 33529 Enumeration Machine for Finite time: strings output (on tape)

30
Fall 2004COMP 33530 Enumeration Machine Configuration Time 0 Time

31
Fall 2004COMP 33531 Time

32
Fall 2004COMP 33532 If for a set there is an enumeration procedure, then the set is countable Observation:

33
Fall 2004COMP 33533 Example: The set of all strings is countable We will describe an enumeration procedure Proof:

34
Fall 2004COMP 33534 Naive procedure: Produce the strings in lexicographic order: Doesn’t work: strings starting with will never be produced

35
Fall 2004COMP 33535 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
Fall 2004COMP 33536 Produce strings in Proper Order: length 2 length 3 length 1

37
Fall 2004COMP 33537 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
Fall 2004COMP 33538 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
Fall 2004COMP 33539 Uncountable Sets

40
Fall 2004COMP 33540 A set is uncountable if it is not countable Definition:

41
Fall 2004COMP 33541 Theorem: Let be an infinite countable set The powerset of is uncountable

42
Fall 2004COMP 33542 Proof: Since is countable, we can write Elements of

43
Fall 2004COMP 33543 Elements of the powerset have the form: ……

44
Fall 2004COMP 33544 We encode each element of the power set with a binary string of 0’s and 1’s Powerset element Encoding

45
Fall 2004COMP 33545 Let’s assume (for contradiction) that the powerset is countable. Then: we can enumerate the elements of the powerset

46
Fall 2004COMP 33546 Powerset element Encoding

47
Fall 2004COMP 33547 Take the powerset element whose bits are the complements in the diagonal

48
Fall 2004COMP 33548 New element: (birary complement of diagonal)

49
Fall 2004COMP 33549 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
Fall 2004COMP 33550 Since we have a contradiction: The powerset of is uncountable

51
Fall 2004COMP 33551 An Application: Languages Example Alphabet : The set of all Strings: infinite and countable

52
Fall 2004COMP 33552 Example Alphabet : The set of all Strings: infinite and countable A language is a subset of :

53
Fall 2004COMP 33553 Example Alphabet : The set of all Strings: infinite and countable The powerset of contains all languages: uncountable

54
Fall 2004COMP 33554 Languages: uncountable Turing machines: countable There are more languages than Turing Machines

55
Fall 2004COMP 33555 There are some languages not accepted by Turing Machines (These languages cannot be described by algorithms) Conclusion:

56
Fall 2004COMP 33556 Languages Accepted by Turing Machines Languages not accepted by Turing Machines

Similar presentations

© 2020 SlidePlayer.com Inc.

All rights reserved.

To make this website work, we log user data and share it with processors. To use this website, you must agree to our Privacy Policy, including cookie policy.

Ads by Google