Download presentation
Presentation is loading. Please wait.
Published byJane Barbara Blair Modified over 9 years ago
1
Computability Universal Turing Machine. Countability. Halting Problem. Homework: Show that the integers have the same cardinality (size) as the natural numbers. Postings.
2
Enumerator definition? Need to describe parts… Transition function Output
3
Universal Turing Machine … is a Turing Machine U in which the input comes in two parts: Description/encoding of a Turing Machine M and Input string w U ( ) is the same as M( ) – Accepts if M accepts w – Rejects if M rejects w – Loops (fails to halt) if M fails to halt
4
Claim We can build such a U. Use 3 tapes. 1.For initial information (definition of M and w) 2.Hold status info for which state of M and position in w 3.Working tape. First step is to set up tape 2 with initial state and starting position and tape 3 with w. Operation: states of U use status to simulate M operating on tape 3.
5
Stored program The notion of a universal [Turing] machine MAY have helped in development of stored programs. Note: calculators do not have stored programs. The notion of a program being treated as data, such as done when compiling or interpreting code, was critical in the development of computers. Topic: research idea.
6
Last class A tm = { |M is a TM and w is a string and M accepts w} is – Turing recognizable because U recognizes it. – May not halt because U [only] simulates M and M may not halt. But maybe another technique could be better than M... This is the halting problem
7
Digression: infinite sets How do we compare infinite sets? Certainly, – the counting numbers (1, 2, 3, …) are contained in – the integers( 0, 1, 2, …, -1, -2, …) are contained in – the rationals (all numbers of the form p/q, where p and q are integers) are contained in – the reals (numbers with decimals, possibly infinite)
8
New concept: cardinality [Note: Sipser uses size.] Georg Cantor (1873) noticed that two finite sets are the same size if the elements in each can be paired. Definition: Two sets A & B have the same cardinality (size?) if there exists a function f: A → B, that is 1 to 1 and onto 1 to 1 means: if f(a) = f(b) then a=b. onto means: if b is in B, then there is an a such that f(a) = b
9
Example The natural numbers N are the same cardinality as the even natural numbers! – Let f(n) = 2* n. This is 1 to 1 and onto!
10
Countable A set is countable if it is finite OR if it has the same cardinality as the natural numbers. My words: a set of countable if you can put all the elements in a list (describe the list in the case of an infinite set).
11
Rationals are countable! Construct a table. Redundant numbers will be removed. Red line represents the list…. 1/1 ½ 1/3 ¼ 1/5 … 2/1 2/2 2/3 2/4 2/5 …. 3/1 3/2 3/3 ¾ 3/5 …
12
Are the reals countable? Proof by contradiction. Suppose there is a list: 1.0000000000… 3.14159…….111222333… …. Let x by a number such with whole number 1 and number at i th position from decimal point is NOT equal to the i th positionof the i th element on the list.Avoid 0 or 9. Then x is NOT on the list!
13
Diagonalization General technique, possible only if there is a list….
14
Halting Problem A tm = { |M is a TM and w is a string and M accepts w} is undecidable. Proof: assume that H is a decider for A tm. Define a new Turing Machine D as follows: D( ) : run H on (M, ). Output reject if H accepts and accept if H rejects. (Like the diagonalization). Claim: if H exists, then we can build D that calls it as a subroutine.
15
Proof, continued Then, what is D( )? Run H(D, ). By definition, this is D running on. If H returns accept (D running on accepts) then H rejects. If it rejects, then accept. Contradiction! Contradiction arises because H could not be built to be used by D.
16
Practical implications Before there were computers, mainly stored program computers, there is a result that there can't be full-proof debuggers/checkers.
17
Homework Produce proof that the integers are countable. Posting on practical implications of Halting problem. Posting on history / origin of stored program concepts.
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.