Presentation is loading. Please wait.

Presentation is loading. Please wait.

CS 461 – Nov. 2 Sets Prepare for ATM finite vs. infinite Infinite sets

Similar presentations


Presentation on theme: "CS 461 – Nov. 2 Sets Prepare for ATM finite vs. infinite Infinite sets"— Presentation transcript:

1 CS 461 – Nov. 2 Sets Prepare for ATM finite vs. infinite Infinite sets
Countable Uncountable Prepare for ATM Proving undecidable is similar to proving a set uncountable. Please be sure you understand reasoning.

2 Finite/infinite Finite set – means that its elements can be numbered. Formally: its elements can be put into a 1-1 correspondence with the sequence 1, 2, 3, … n, where n is some positive integer. An infinite set is one that’s not finite.  However, there are 2 kinds of infinity!

3 Countable Countable set: An infinite set whose elements can be put into a 1-1 correspondence with the positive integers. Examples we can show are countable: Even numbers, all integers, rational numbers, ordered pairs. Uncountable set = ∞ set that’s not countable.  Examples we can show are uncountable: Real numbers, functions of integers, infinite-length strings

4 Examples The set of even numbers is countable. The set of integers is countable. 2 4 6 8 10 12 1 3 5 1 -1 2 -2 3 -3 4 -4 5 6 7 8 9

5 Ordered pairs j = 1 j = 2 j = 3 j = 4 i = 1 1 2 4 7 … i = 2 3 5 8
6 9 i = 4 10 The number assigned to (i , j) is (i + j – 1)*(i + j – 2)/2 + i

6 Real numbers Real # Value 1 2.71828… 2 3.14159… 3 0.55555… 4 -1.23456…
Suppose real numbers were countable. The numbering might go something like this: The problem is that we can create a value that has no place in the correspondence! Real # Value 1 2 3 4 5 X ?

7 Infinite bit strings # Value 1 00000… 2 100000… 3 011010… 4 0010001… 5
? 11010…

8 Universal TM Let’s design “U” – the Universal TM:
Input consists of <M> and w: <M> is the encoding of some TM w is any (binary) string. Assume: U is a decider (i.e. ATM is decidable.) U No* means “does not accept.” Either enter reject state or loop forever. <M>,w M yes yes w no* no

9 ATM solution Start with U, the Universal Turing Machine
Suppose U decides ATM. Let’s build new TM D. D takes in a Turing machine, and returns opposite of U’s answer. D <M> U no yes <M>,<M> no yes If M accepts its own string rep’n, D rejects <M>. If M doesn’t accept <M>, D accepts <M>. What does D do with <D> as input?

10 For example <M1> <M2> <M3> <M4> … <D> M1
Yes No M2 M3 M4 D Uh-oh Contradiction  The TM D can’t exist  So U is not a decider.

11 In other words Let U = universal TM. Create 2nd TM called D.
Its input is a TM description <M> and a word <w>. Determines if M accepts w. Assume U halts for all inputs. (is a decider) Create 2nd TM called D. Its input is a TM description <M>. Gives <M> to U as the TM to run as well as the input. D returns the opposite of what U returns. What happens when the input to D is <D>? According to U, if D accepts <D>, U accepts, so D must reject! According to U, if D rejects <D>, U rejects, so D must accept! Both cases give a contradiction. Thus, U is not a decider. ATM is undecidable.


Download ppt "CS 461 – Nov. 2 Sets Prepare for ATM finite vs. infinite Infinite sets"

Similar presentations


Ads by Google