Great Theoretical Ideas in Computer Science

Slides:



Advertisements
Similar presentations
Introduction to Computability Theory
Advertisements

Courtesy Costas Busch - RPI1 A Universal Turing Machine.
Great Theoretical Ideas in Computer Science.
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.
1 Undecidability Andreas Klappenecker [based on slides by Prof. Welch]
Fall 2004COMP 3351 A Universal Turing Machine. Fall 2004COMP 3352 Turing Machines are “hardwired” they execute only one program A limitation of Turing.
1 Introduction to Computability Theory Lecture11: The Halting Problem Prof. Amos Israeli.
Cardinality of a Set “The number of elements in a set.” Let A be a set. a.If A =  (the empty set), then the cardinality of A is 0. b. If A has exactly.
2012: J Paul GibsonTSP: Mathematical FoundationsMAT7003/L5- CountingAndEnumeration.1 MAT 7003 : Mathematical Foundations (for Software Engineering) J Paul.
Great Theoretical Ideas in Computer Science.
Cantor’s Legacy: Infinity And Diagonalization Great Theoretical Ideas In Computer Science Steven RudichCS Spring 2004 Lecture 25Apr 13, 2004Carnegie.
Cardinality of Sets Section 2.5.
1 Lecture 3 (part 3) Functions – Cardinality Reading: Epp Chp 7.6.
CSE 20: Discrete Mathematics for Computer Science Prof. Shachar Lovett.
1 1 CDT314 FABER Formal Languages, Automata and Models of Computation Lecture 15-1 Mälardalen University 2012.
Great Theoretical Ideas in Computer Science for Some.
Copyright © Cengage Learning. All rights reserved. CHAPTER 7 FUNCTIONS.
A Universal Turing Machine
Functions Section 2.3. Section Summary Definition of a Function. – Domain, Cdomain – Image, Preimage Injection, Surjection, Bijection Inverse Function.
COMPSCI 102 Introduction to Discrete Mathematics.
Aim: How can the word ‘infinite’ define a collection of elements?
INFIINITE SETS CSC 172 SPRING 2002 LECTURE 23. Cardinality and Counting The cardinality of a set is the number of elements in the set Two sets are equipotent.
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.
Sets Definition: A set is an unordered collection of objects, called elements or members of the set. A set is said to contain its elements. We write a.
Great Theoretical Ideas in Computer Science.
CompSci 102 Discrete Math for Computer Science February 7, 2012 Prof. Rodger Slides modified from Rosen.
Lecture 4 Infinite Cardinals. Some Philosophy: What is “2”? Definition 1: 2 = 1+1. This actually needs the definition of “1” and the definition of the.
1 Melikyan/DM/Fall09 Discrete Mathematics Ch. 7 Functions Instructor: Hayk Melikyan Today we will review sections 7.3, 7.4 and 7.5.
Section 3.2: Sequences and Summations. Def: A sequence is a function from a subset of the set of integers (usually the set of natural numbers) to a set.
CS 285- Discrete Mathematics
Great Theoretical Ideas in Computer Science about AWESOME Some Generating Functions Probability.
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.
Section 2.5. Cardinality Definition: A set that is either finite or has the same cardinality as the set of positive integers (Z + ) is called countable.
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 2013 Lecture 27: Turing machines and decidability CSE 311: Foundations of Computing.
Sequences Lecture 11. L62 Sequences Sequences are a way of ordering lists of objects. Java arrays are a type of sequence of finite size. Usually, mathematical.
One of Cantor's basic concepts was the notion of the size or cardinality of a set M, denoted by |M|  M - finite sets M is an n-set or has size n, if.
1-1 Copyright © 2013, 2005, 2001 Pearson Education, Inc. Section 2.4, Slide 1 Chapter 2 Sets and Functions.
Great Theoretical Ideas In Computer Science
Cardinality with Applications to Computability
Cantor’s Legacy: Infinity And Diagonalization
Function Hubert Chan (Chapter 2.1, 2.2) [O1 Abstract Concepts]
Raymond Flood Gresham Professor of Geometry
The Acceptance Problem for TMs
Discrete Mathematics CS 2610
A Universal Turing Machine
Relations, Functions, and Matrices
Induction and recursion
Function Hubert Chan (Chapter 2.1, 2.2) [O1 Abstract Concepts]
2.4 Sequences and Summations
Counting Sets.
Cardinality of Sets Section 2.5.
Great Theoretical Ideas in Computer Science
Countable or Uncountable…That is the question!
Lecture 7 Functions.
Discrete Structures for Computer Science
Andreas Klappenecker [based on slides by Prof. Welch]
Great Theoretical Ideas in Computer Science
Module #4.5, Topic #∞: Cardinality & Infinite Sets
Discrete Mathematics and its Applications
Cantor’s Legacy: Infinity And Diagonalization
Discrete Math for CS CMPSC 360 LECTURE 43 Last time: Variance
Formal Languages, Automata and Models of Computation
Cantor’s Legacy: Infinity And Diagonalization
Module #4.5, Topic #∞: Cardinality & Infinite Sets
Functions Rosen 2.3, 2.5 f( ) = A B Lecture 5: Oct 1, 2.
Introduction to Discrete Mathematics
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.
Cantor’s Legacy: Infinity And Diagonalization
Presentation transcript:

Great Theoretical Ideas in Computer Science 15-251 Great Theoretical Ideas in Computer Science

Cantor’s Legacy: Infinity And Diagonalization  Lecture 24 (April 10, 2008)

The Theoretical Computer: no bound on amount of memory no bound on amount of time Ideal Computer is defined as a computer with infinite RAM You can run a Java program and never have any overflow, or out of memory errors We will be talking about ideal computers. Ideal computers differ from real computers in that they have no bound on the amount of memory they can use. If the notion of a computer with an infinite amount of memory seems unsatisfactory, think of it this way: Your programs ask for as much memory as they wish. Whenever your computer runs out of memory, the computer automatically contacts the manufacturer, and a technician arrives with additional ram chips for your computer. Your computations continue where they left off, as if nothing had happened.

An Ideal Computer It can be programmed to print out: 2: 2.0000000000000000000000… 1/3: 0.33333333333333333333… : 1.6180339887498948482045… e: 2.7182818284559045235336… : 3.14159265358979323846264… What can these ideal computers do that real computers can’t? Well, real computers have a finite amount of memory. Add up all the memory they have – hard disk space, RAM, registers, etc. , and they still have only k bits of storage. This means, a real computer can be in only 2^k different states. Suppose you want to compute the ith digit of pi, for any I. On a real computer, as your computation, runs the computer changes from state to state. Eventually, it will run out of new states and must return to a state indistinguishable from a previous one. Thus, a deterministic program on a real computer can output only repeating decimals. So, real computers can output some digits of pi, but there will always be some ith digit which cannot be computed. Because ideal computers have an unlimited amount of memory, they can be in an unlimited number of different states. Thus, we can write a program on an ideal computer that can print the ith digit of pi, for any I. Any digit of pi which interests us will eventually appear in the output.

Printing Out An Infinite Sequence A program P prints out the infinite sequence s0, s1, s2, …, sk, … if when P is executed on an ideal computer, it outputs a sequence of symbols such that: The kth symbol that it outputs is sk For every k, P eventually outputs the kth symbol. I.e., the delay between symbol k and symbol k+1 is not infinite

Computable Real Numbers A real number r is computable if there is a (finite) program that prints out the decimal representation of r from left to right. Thus, each digit of r will eventually be output. Are all real numbers computable? Pi is “computable,” because we can program an ideal computer to output the ith digit for any I. In general, any real number r is computable, if we can program an ideal computer to print it digit by digit, such that any digit we are interested in will eventually be printed. For example, to find the 2^50th digit of r, we start the program and count the output digits. Eventually, we’ll the 2^50th digit will appear. The real numbers we’re familiar with -- pi, e, phi, and the square root of two– are all computable. But in general, are all real numbers computable?

List of questions Are all real numbers computable? ??

Are all real numbers describable? Describable Numbers A real number r is describable if it can be denoted unambiguously by a finite piece of English text 2: “Two.” : “The area of a circle of radius one.” <think of good segue> When a finite piece of English text unambigously describes a real number r, we call that number describable. By unambigous, we mean that the text must describe one number and only one number. For example, we can describe pi as “The area of a circle of radius one.” This description applies to pi and only to pi – there is no other number that is the area of a circle of radius one. Our descriptions o f numbers, such as pi, do not necessarily tell us how to compute them. So, it Is not obvious that all describable numbers are computable. Are all real numbers describable?

List of questions Are all real numbers computable? ?? Are all real numbers describable?

Computable r: some program outputs r Describable r: some sentence denotes r Is every computable real number, also a describable real number? And what about the other way? The moral here is that computer programs can be viewed as descriptions of their output. A program that computes pi, for example, can be taken as an unambiguous description of the number pi.

List of questions Are all real numbers computable? ?? Are all real numbers describable? Is every computable number describable? Is every describable number computable?

Computable  Describable Theorem: Every computable real is also describable Proof: Let r be a computable real that is output by a program P. The following is an unambiguous description of r: However, it is true that every computable number is describable. Let r be a computable real number. Therefore, there is some program P which outputs r. Therefore, we can describe r by saying “The real number output by P.” That is, since the program outputs exactly r, it can be taken as an unambiguous description of r. “The real number output by the following program:” P

List of questions Are all real numbers computable? ?? Are all real numbers describable? Is every computable number describable? Yes Is every describable number computable?

Correspondence Principle If two finite sets can be placed into bijection, then they have the same size Recall the correspondence principle. Two sets, A and B. Put them into one-to-one, onto correspondence: they have the exact same size.

Correspondence Definition In fact, we can use the correspondence as the definition: Two finite sets are defined to have the same size if and only if they can be placed into bijection In fact, we will define two sets to have the same size if and only if they can be placed into one-to-one, onto correspondence. In the case of finite sets, this definition of size matches our intuitive understanding of size.

Georg Cantor (1845-1918) Georg Cantor was one of the greatest 19th-century mathematical geniuses. While his work was in pure mathematics, the theorems Cantor proved and the techniques he developed have, as we’ll see today, profound implications for computer science. In addition to being a seminal character in mathematics, Cantor was also a very interesting person. Cantor suffered from bouts of severe depression which lasted for weeks. His work in mathematics was not well appreciated during his life, a fact which further fueled his depression. When Cantor was too depressed to pursue math, he pursued his interests in philosophy in literature. Cantor’s pet project in literature, unfortunately, was as controversial as his mathematics. He published several papers attempting to prove his pet theory that Shakespeare’s plays were written not by Shakespeare but by Francis Bacon.

Cantor’s Definition (1874) Two sets are defined to have the same size if and only if they can be placed into bijection Two sets are defined to have the same cardinality if and only if they can be placed into bijection. One of Cantor’s most important contributions to mathematics was his generalization of the correspondence principle. Two sets, infinite or finite, have the same size if and only if they can be placed into one-to-one, onto correspondence. This notion gives us a well-defined understanding of “size” of infinite sets, which is compatible with our intuition for finite sets.

Do N and E have the same cardinality? The even, natural numbers. Let’s take a look at two infinite sets, N, the natural numbers, and E the even naturals. Do N and E have the same size? Most students will say they clearly don’t have the same size.

The attempted correspondence f(x) = x does not take E onto N. How can E and N have the same cardinality? E is a proper subset of N with plenty left over. The attempted correspondence f(x) = x does not take E onto N. Bonzo has a very natural view on the question. We can take the set of natural numbers, cross off all the naturals, and still be left with an infinite number of odd numbers. So, this means that there are many more natural numbers than even numbers. In other words, the correspondence which maps the even number x to the natural number x, is one-to-one: all the even naturals get mapped to distinct natural numbers. But the correspondence is not onto: all the odd naturals are left over.

f(x) = 2x is a bijection E and N do have the same cardinality! Bonzo’s intuitive argument is very natural, but it’s not a proof. Odette has a better idea. In fact, the evens and the naturals DO have the same cardinality, and there is a one-to-one onto correspondence from the naturals to the even naturals which proves it. We map 0 to 0, 1 to 2, 2 to 4 and so forth, mapping the natural number x to the even natural 2*x. It’s easy to see that this correspondence is one-to-one – every natural gets mapped to a distinct even, and onto—every even is mapped from some natural.

Lesson: Cantor’s definition only requires that some injective correspondence between the two sets is a bijection, not that all injective correspondences are bijections! There’s an important lesson to learn here. In the case of finite sets, a one to one correspondence between two sets implies that all one-to-one correspondences are onto. That is, no matter how I try to match my fingers up, there are never any left over. But this is not the case for infinite sets. For two infinite sets A and B, there may many one-to-one correspondences, only some of which are onto. Fortunately, Cantor’s definition of cardinality requires only that there be some one-to-one correspondence which is onto. So, showing a one-to-one correspondence which isn’t onto proves nothing about the cardinality of two infinite sets. This distinction never arises when the sets are finite

Do N and Z have the same cardinality? Let’s take a look at two more infinite sets: N, the natural numbers, and Z, the integers.

f(x) = x/2 if x is odd -x/2 if x is even N and Z do have the same cardinality! N = 0, 1, 2, 3, 4, 5, 6 … Z = 0, 1, -1, 2, -2, 3, -3, …. f(x) = x/2 if x is odd -x/2 if x is even

A Useful Transitivity Lemma Lemma: If f: AB is a bijection, and g: BC is a bijection. Then h(x) = g(f(x)) defines a function h: AC that is a bijection Hence, N, E, and Z all have the same cardinality.

Onto the Rationals!

Do N and Q have the same cardinality? Q = The Rational Numbers

How could it be???? The rationals are dense: between any two there is a third. You can’t list them one by one without leaving out an infinite number of them.

Theorem: N and N×N have the same cardinality … 4 3 2 1 The point (x,y) represents the ordered pair (x,y) 1 2 3 4 …

The point at x,y represents x/y

The point at x,y represents x/y 3 1 2 The point at x,y represents x/y

Cantor’s 1877 letter to Dedekind: “I see it, but I don't believe it! ” Georg Cantor was one of the greatest 19th-century mathematical geniuses. While his work was in pure mathematics, the theorems Cantor proved and the techniques he developed have, as we’ll see today, profound implications for computer science. In addition to being a seminal character in mathematics, Cantor was also a very interesting person. Cantor suffered from bouts of severe depression which lasted for weeks. His work in mathematics was not well appreciated during his life, a fact which further fueled his depression. When Cantor was too depressed to pursue math, he pursued his interests in philosophy in literature. Cantor’s pet project in literature, unfortunately, was as controversial as his mathematics. He published several papers attempting to prove his pet theory that Shakespeare’s plays were written not by Shakespeare but by Francis Bacon.

Countable Sets We call a set countable if it can be placed into a bijection with the natural numbers N Hence N, E, Z, Q are all countable

Do N and R have the same cardinality? I.e., is R countable? R = The real numbers

Theorem: The set R[0,1] of reals between 0 and 1 is not countable Proof: (by contradiction) Suppose R[0,1] is countable Let f be a bijection from N to R[0,1] Make a list L as follows: 0: decimal expansion of f(0) 1: decimal expansion of f(1) … k: decimal expansion of f(k)

Position after decimal point 1 2 3 4 … Index

Position after decimal point 1 2 3 4 … 5 9 8 6 Index

L 1 2 3 4 … d0 d1 d2 d3 d4

Define the following real number ConfuseL = 0.C0C1C2C3C4C5 … 1 2 3 4 d0 d1 d2 d3 … Define the following real number ConfuseL = 0.C0C1C2C3C4C5 … 5, if dk=6 6, otherwise Ck=

By design, ConfuseL can’t be on the list L! Diagonalized! By design, ConfuseL can’t be on the list L! Indeed, note that ConfuseL differs from the kth element on the list L in the kth position. This contradicts the assumption that the list L is complete; i.e., that the map f: N to R[0,1] is onto.

The set of reals is uncountable! (Even the reals between 0 and 1)

Sanity Check Why can’t the same argument be used to show that the set of rationals Q is uncountable? Note that CONFUSEL is not necessarily rational. And so there is no contradiction from the fact that it is missing from the list L

Back to the questions we were asking earlier

List of questions Are all real numbers computable? ?? Are all real numbers describable? Is every computable number describable? Yes Is every describable number computable?

Standard Notation S = Any finite alphabet Example: {a,b,c,d,e,…,z} S* = All finite strings of symbols from S including the empty string e

Theorem: Every infinite subset S of S* is countable Proof: Sort S by first by length and then alphabetically Map the first word to 0, the second to 1, and so on…

Some infinite subsets of S* S = The symbols on a standard keyboard For example: The set of all possible Java programs is a subset of S* The set of all possible finite pieces of English text is a subset of S*

Thus: The set of all possible Java programs is countable. The set of all possible finite length pieces of English text is countable.

But look: There are countably many Java programs and uncountably many reals. Hence, most reals are not computable!

There are countably many descriptions and uncountably many reals. Hence: Most real numbers are not describable!

List of questions Next lecture… Are all real numbers computable? No Are all real numbers describable? Is every computable number describable? Yes Is every describable number computable? ?? Next lecture…

To end, here’s an important digression about infinity…

We know there are at least 2 infinities We know there are at least 2 infinities. (The number of naturals, the number of reals.) Are there more?

Definition: Power Set The power set of S is the set of all subsets of S. The power set is denoted as P(S) Proposition: If S is finite, the power set of S has cardinality 2|S| How do sizes of S and P(S) relate if S is infinite?

Theorem: S can’t be put into bijection with P(S)  {A} {B} B {C} {A,B} C {B,C} {A,C} {A,B,C} Suppose f:S → P(S) is a bijection. Let CONFUSEf = { x | x  S, x  f(x) } Since f is onto, exists y  S such that f(y) = CONFUSEf. Is y in CONFUSEf? YES: Definition of CONFUSEf implies no NO: Definition of CONFUSEf implies yes

For any set S (finite or infinite), the cardinality of P(S) is strictly greater than the cardinality of S.

This proves that there are at least a countable number of infinities. Indeed, take any infinite set S. Then P(S) is also infinite, and its cardinality is a larger infinity than the cardinality of S.

This proves that there are at least a countable number of infinities. The first infinity is the size of all the countable sets. It is called: 0

Cantor wanted to show that the number of reals was 1 0,1,2,… Cantor wanted to show that the number of reals was 1

However, he was unable to prove it. This helped fuel his depression. Cantor called his conjecture that 1 was the number of reals the “Continuum Hypothesis.” However, he was unable to prove it. This helped fuel his depression. The problem of the continuum was the source of great vexation for Cantor. Once, he thought he had proved it false, only to uncover his error the following day. And later, Cantor believed he had proved the hypothesis true, but again he quickly discovered a bug in his proof.

The Continuum Hypothesis can’t be proved or disproved from the standard axioms of set theory! This has been proved!

Here’s What You Need to Know… Cantor’s Definition: Two sets have the same cardinality if there exists a bijection between them. E, N, Z and Q all have the same cardinality Proof that there is no bijection between N and R Definition of Countable versus Uncountable Here’s What You Need to Know…