Comparing Sets Size without Counting 2 sets A and B have the same size if there is a function f: A  B such that: For every x  A there is one and only.

Slides:



Advertisements
Similar presentations
Variants of Turing machines
Advertisements

The Recursion Theorem Sipser – pages Self replication Living things are machines Living things can self-reproduce Machines cannot self reproduce.
1 COMP 382: Reasoning about algorithms Unit 9: Undecidability [Slides adapted from Amos Israeli’s]
More Turing Machines Sipser 3.2 (pages ). CS 311 Fall Multitape Turing Machines Formally, we need only change the transition function to.
More Turing Machines Sipser 3.2 (pages ).
Prof. Busch - LSU1 Decidable Languages. Prof. Busch - LSU2 Recall that: A language is Turing-Acceptable if there is a Turing machine that accepts Also.
Courtesy Costas Busch - RPI1 A Universal Turing Machine.
1 Linear Bounded Automata LBAs. 2 Linear Bounded Automata are like Turing Machines with a restriction: The working space of the tape is the space of the.
Fall 2004COMP 3351 Recursively Enumerable and Recursive Languages.
1 Undecidability Andreas Klappenecker [based on slides by Prof. Welch]
Recursively Enumerable and Recursive Languages
Module 5 Topics Proof of the existence of unsolvable problems
1 Uncountable Sets continued Theorem: Let be an infinite countable set. The powerset of is uncountable.
CHAPTER 4 Decidability Contents Decidable Languages
Fall 2005Costas Busch - RPI1 Recursively Enumerable and Recursive Languages.
Fall 2004COMP 3351 A Universal Turing Machine. Fall 2004COMP 3352 Turing Machines are “hardwired” they execute only one program A limitation of Turing.
1 Reducibility. 2 Problem is reduced to problem If we can solve problem then we can solve problem.
Cardinality of Sets Section 2.5.
MA/CSSE 474 Theory of Computation The Halting Problem.
MA/CSSE 474 Theory of Computation More Reduction Examples Non-SD Reductions.
1 Undecidability Reading: Chapter 8 & 9. 2 Decidability vs. Undecidability There are two types of TMs (based on halting): (Recursive) TMs that always.
Undecidable Languages (Chapter 4.2) Héctor Muñoz-Avila.
1 1 CDT314 FABER Formal Languages, Automata and Models of Computation Lecture 15-1 Mälardalen University 2012.
1 The Halting Problem and Decidability How powerful is a TM? Any program in a high level language can be simulated by a TM. Any algorithmic procedure carried.
MA/CSSE 474 Theory of Computation Enumerability Reduction.
A Universal Turing Machine
COMPSCI 102 Introduction to Discrete Mathematics.
Remaining Discussions from Previous Class Please be precise in your writing –Specially because some of the proofs are written in plain English Queue automata.
1 Linear Bounded Automata LBAs. 2 Linear Bounded Automata (LBAs) are the same as Turing Machines with one difference: The input string tape space is the.
Cardinality with Applications to Computability Lecture 33 Section 7.5 Wed, Apr 12, 2006.
1 Turing’s Thesis. 2 Turing’s thesis: Any computation carried out by mechanical means can be performed by a Turing Machine (1930)
Computability Universal Turing Machine. Countability. Halting Problem. Homework: Show that the integers have the same cardinality (size) as the natural.
Great Theoretical Ideas in Computer Science.
Recursively Enumerable and Recursive Languages
Donghyun (David) Kim Department of Mathematics and Computer Science North Carolina Central University 1 Chapter 4 Decidability Some slides are in courtesy.
THE CONVENTIONS 2 simple rules: Rule # 1: Rule # 2: RR “move to the right until you find  “ Note: first check. Then move (think of a “while”) “Never.
To Infinity And Beyond! CS Lecture 11 The Ideal Computer: no bound on amount of memory Whenever you run out of memory, the computer contacts the.
Unrestricted Grammars
Summary of Previous Class There are languages that are not decidable –(we have not proved this yet) Why not extend Turing machines just as we did with.
Turing Machines Sections 17.6 – The Universal Turing Machine Problem: All our machines so far are hardwired. ENIAC
Undecidability and The Halting Problem
FORMAL LANGUAGES, AUTOMATA, AND COMPUTABILITY * Read chapter 4 of the book for next time * Lecture9x.ppt.
Universal Turing Machine
1 Recursively Enumerable and Recursive Languages.
Recursively Enumerable and Recursive Languages. Definition: A language is recursively enumerable if some Turing machine accepts it.
1 A Universal Turing Machine. 2 Turing Machines are “hardwired” they execute only one program A limitation of Turing Machines: Real Computers are re-programmable.
Fall 2006Costas Busch - RPI1 RE languages and Enumerators.
Decidability and Undecidability Proofs
The Acceptance Problem for TMs
A Universal Turing Machine
CS 461 – Nov. 2 Sets Prepare for ATM finite vs. infinite Infinite sets
Lecture12 The Halting Problem
2.4 Sequences and Summations
Computing with Turing Machines
Cardinality of Sets Section 2.5.
Turing Machines Acceptors; Enumerators
Homework: Friday Read Section 4.1. In particular, you must understand the proofs of Theorems 4.1, 4.2, 4.3, and 4.4, so you can do this homework. Exercises.
Decidability and Enumerability
Turing acceptable languages and Enumerators
Turing-Enumerable (Part II)
Decidable Languages Costas Busch - LSU.
Decidability and Undecidability
Turing acceptable languages and Enumerators
MA/CSSE 474 Theory of Computation
Formal Languages, Automata and Models of Computation
Intro to Theory of Computation
Cardinality Definition: The cardinality of a set A is equal to the cardinality of a set B, denoted |A| = |B|, if and only if there is a one-to-one correspondence.
Variants of Turing machines
MA/CSSE 474 Theory of Computation
Intro to Theory of Computation
Presentation transcript:

Comparing Sets Size without Counting 2 sets A and B have the same size if there is a function f: A  B such that: For every x  A there is one and only y  B such that f(x) = y Every y  B has one x  A such that f(x) = y In such situations f is said to be a bijective

Example: abcdefabcdef A B

Example (2) E = {n : n is an even natural number} N = {n : n is a natural number} Does E and N have the same size? Yes: f(x) = x/2 is a bijective from E to N N = {f(2), f(4), f(6),…}

Example (3) R 1 = {r : r is a real positive number greater than 1} (0,1] = {r : r is a real number between 0 and 1} Does R1 and (0,1] have the same size? Yes: f(x) = 1/x is a bijective from R 1 to (0,1] 1 1 same size!

Example (4) How about: R + = {r : r is a real non-negative number} N = {n : n is a natural number} Every attempt fails: f(x) = x(leaves numbers like 0.5 out) f(x) = floor(x) (assigns the same value for numbers like 1.2 and 1.3) How can we know for sure that there is no bijective function from R + to N?

Enumerability We know that there is an enumeration for all the natural numbers: 1, 2, 3, 4, … The point is that for any natural, say , it will eventually be listed!, , … There is no such enumeration of all the real numbers between 0 and 1 (i.e., 0, 0.01, , 3/  ) Thus there can’t be any bijective function f: N  [0,1], otherwise: {f(0), f(1), f(2), …} would be an enumeration for [0,1] Surprisingly there is a enumeration for the rational numbers (the irrational numbers the ones that are non enumerable!)

Enumerability (2) The set of all rational numbers: {p/q : p, q are natural numbers} is enumerable: … q … 1 1/1 1/2 1/3 1/4 1/5 … 1/q … 2 2/1 2/2 2/3 2/4 2/5 … 2/q … 3 3/1 … 4 4/1 … 5 5/1 … 5/q … … p p/1 … p/q … … Enumeration: 1/1, 1/2, 2/1, 1/3, 2/2, 3/1, 1/4, …, p/q, … Note: you could easily write a program in C++ that outputs this enumeration (and runs forever)

[0,1) Is Not Enumerable By contradiction: suppose that there is an enumeration for all the real numbers between 0 and 1: # 1: # 2: # 3: … … #23: …6… …

[0,1) Is Not Enumerable (II) #1: #2: #3: … … #23: …6… … We construct a number  as follows: for each number n in the enumeration, we look at the n-th digit in n: The 23-rd digit  = 0.005…6… Obviously  is a real number between 0 and 1

[0,1) Is Not Enumerable(III) #1: #2: #3: … … #23: …6… … We construct a number  as follows: we change each digit in  for a different digit:  = 0.005…6…  = 0.120…7… Question: is  = #1? or  = #2? or … or  = #23? or … Obviously  is a real number between 0 and 1    …  … Thus, it is not possible to enumerate all the real numbers between 0 and 1!

Consequences This means that even though the natural and the real numbers are both infinite, the size of the set of the real numbers is “bigger” than the size of the set of the natural numbers. This has been known for mathematicians for quite a long time Astonishingly, this result is relevant for Turing Machines!

Enumerability and Turing Machines Theorem 1. If a language is decidable then the language is Turing-enumerable Theorem 2. A language is semi-decidable if and only if the language is Turing-enumerable Definition: A language L is Turing-enumerable is there is a Turing machine that enumerates all words in L in its tape (may run forever):  w 1 w 2 w 3 …

Optional Homework (Wednesday) Explain why C++ programs can be simulated with Turing machines Enumerate the ways to proof that a language is:  decidable  semi-decidable  Enumerable 4.20 c) 4.24 a)

 * is Turing-Enumerable As an example consider  = {a, b} We can define a < b and then induce a lexicographical order: abbbabbbabbabbb> We can can list all elements: e, a, b, aa, ab, bb, aaa, … We can construct a 3-Tape Turing machine with a counter i = 0, 1, 2, … on the second tape, and in each loop construct all combinations of words of length i in tape 3. Once done, copy those words to the end (i.e., ) of the first tape (cumbersome but doable!) A similar construction can be made for any  (finite)

Decidable Implies Enumerable Let L be a language over the alphabet  If L is decidable there is a Turing Machine that decides M Let M* be the Turing machine that enumerates  * Construct a 3-tape Turing machine that enumerates L as follows:  M* will output words on the 2 nd tape  Every time M* outputs a word w, it is copied in the 3 rd tape, where M checks if w is in L  If w is in L it is appended to the end of the 1 st tape

Enumerable Implies Semi-decidable Let L be a Turing-enumerable language Thus, there is a Turing machine M that enumerates words in L We can construct a Turing machine ML that semi-decides if a word w is in L as follows: Run M and wait to see if w is put on the tape. If w is printed on the tape, ML halts. If not, it continues waiting to see if w is printed on the tape.

Backup Slides Please Ignore

 * is Enumerable Theorem. If  is finite then  * is enumerable If  = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9},  * = {0, 1, …, 12, 13, …, 654, …} If  = {a, b, c, d, e, f, g, h, i, j}  * = {a, b, …, bc, cd, …, gfe, …} If  consist of 500 symbols, we map them to the first 500 numbers ** The Turing machine that enumerates all strings in 

Decidable Implies Enumerable Suppose that L is decidable. By definition, it means that there is a Turing machine M L that decides L For example if L = {a n b n : n = 0, 1, 2, …} and  = {a, b, c } then  * = {a, b, c, aa, ab, ac, ba, bb, …} Tape2:  abaabb… ** MLML If word is in L it copies into the second tape and adds an space An enumeration of L!