Some. AWESOME Great Theoretical Ideas in Computer Science about Generating Functions Probability

Similar documents
ADVANCED CALCULUS - MTH433 LECTURE 4 - FINITE AND INFINITE SETS

Discrete Mathematics for CS Spring 2007 Luca Trevisan Lecture 27

One-to-one functions and onto functions

Math 3361-Modern Algebra Lecture 08 9/26/ Cardinality

Mathematics 220 Workshop Cardinality. Some harder problems on cardinality.

CITS2211 Discrete Structures (2017) Cardinality and Countability


CSE 20 DISCRETE MATH. Fall

MATH 3300 Test 1. Name: Student Id:

INFINITY: CARDINAL NUMBERS

SETS AND FUNCTIONS JOSHUA BALLEW

Definition: Let S and T be sets. A binary relation on SxT is any subset of SxT. A binary relation on S is any subset of SxS.

ECS 120 Lesson 18 Decidable Problems, the Halting Problem

CSE 311: Foundations of Computing. Lecture 26: Cardinality

A Readable Introduction to Real Mathematics

Chapter 20. Countability The rationals and the reals. This chapter covers infinite sets and countability.

MATH 13 FINAL EXAM SOLUTIONS

Finite and Infinite Sets

A Short Review of Cardinality

Math 300: Final Exam Practice Solutions

Notes for Math 290 using Introduction to Mathematical Proofs by Charles E. Roberts, Jr.

Functions. Definition 1 Let A and B be sets. A relation between A and B is any subset of A B.

Great Theoretical Ideas in Computer Science. Lecture 5: Cantor s Legacy

Discrete Mathematics and Probability Theory Spring 2014 Anant Sahai Note 20. To Infinity And Beyond: Countability and Computability

CSE 4111/5111/6111 Computability Jeff Edmonds Assignment 3: Diagonalization & Halting Problem Due: One week after shown in slides

MATH 220 (all sections) Homework #12 not to be turned in posted Friday, November 24, 2017

CSCI3390-Lecture 6: An Undecidable Problem

Discrete Mathematics 2007: Lecture 5 Infinite sets

POL502: Foundations. Kosuke Imai Department of Politics, Princeton University. October 10, 2005

Solutions to Tutorial 8 (Week 9)

Countability. 1 Motivation. 2 Counting

Section Summary. Sequences. Recurrence Relations. Summations. Examples: Geometric Progression, Arithmetic Progression. Example: Fibonacci Sequence

MATH 521, WEEK 2: Rational and Real Numbers, Ordered Sets, Countable Sets

Section 7.5: Cardinality

Sets are one of the basic building blocks for the types of objects considered in discrete mathematics.

CSE 311: Foundations of Computing. Lecture 26: More on Limits of FSMs, Cardinality

The Two Faces of Infinity Dr. Bob Gardner Great Ideas in Science (BIOL 3018)

1.4 Cardinality. Tom Lewis. Fall Term Tom Lewis () 1.4 Cardinality Fall Term / 9

Chapter 1 : The language of mathematics.

University of Toronto Faculty of Arts and Science Solutions to Final Examination, April 2017 MAT246H1S - Concepts in Abstract Mathematics

What is proof? Lesson 1

MATH 201 Solutions: TEST 3-A (in class)

Algorithms: Lecture 2

Today. Wrapup of Polynomials...and modular arithmetic. Coutability and Uncountability.

CSE 322, Fall 2010 Nonregular Languages

Discrete Structures for Computer Science

Turing Machines, diagonalization, the halting problem, reducibility

Functions and cardinality (solutions) sections A and F TA: Clive Newstead 6 th May 2014

Lecture Notes 1 Basic Concepts of Mathematics MATH 352

Exercises for Unit VI (Infinite constructions in set theory)

Math 4603: Advanced Calculus I, Summer 2016 University of Minnesota Notes on Cardinality of Sets

Date: October 24, 2008, Friday Time: 10:40-12:30. Math 123 Abstract Mathematics I Midterm Exam I Solutions TOTAL

Economics 204 Fall 2011 Problem Set 1 Suggested Solutions

A Universal Turing Machine

LECTURE 22: COUNTABLE AND UNCOUNTABLE SETS

S15 MA 274: Exam 3 Study Questions

Notes on counting. James Aspnes. December 13, 2010

5 Set Operations, Functions, and Counting

MATH FINAL EXAM REVIEW HINTS

Undecidability. Andreas Klappenecker. [based on slides by Prof. Welch]

Copyright c 2007 Jason Underdown Some rights reserved. statement. sentential connectives. negation. conjunction. disjunction

1 Take-home exam and final exam study guide

The Different Sizes of Infinity

We are going to discuss what it means for a sequence to converge in three stages: First, we define what it means for a sequence to converge to zero

In N we can do addition, but in order to do subtraction we need to extend N to the integers

Reed-Solomon code. P(n + 2k)

CS 121, Section 2. Week of September 16, 2013

Part IA Numbers and Sets

Harvard CS 121 and CSCI E-207 Lecture 6: Regular Languages and Countability

Solutions to Tutorial for Week 4

Introduction to Proofs in Analysis. updated December 5, By Edoh Y. Amiran Following the outline of notes by Donald Chalice INTRODUCTION

Discrete Mathematics: Lectures 6 and 7 Sets, Relations, Functions and Counting Instructor: Arijit Bishnu Date: August 4 and 6, 2009

Name: Student ID: Instructions:

MAT 570 REAL ANALYSIS LECTURE NOTES. Contents. 1. Sets Functions Countability Axiom of choice Equivalence relations 9

Seminaar Abstrakte Wiskunde Seminar in Abstract Mathematics Lecture notes in progress (27 March 2010)

Lecture 3: Sizes of Infinity

Mid Term-1 : Practice problems

Announcements. CS243: Discrete Structures. Sequences, Summations, and Cardinality of Infinite Sets. More on Midterm. Midterm.

Computational Models Lecture 8 1

Final Exam Review. 2. Let A = {, { }}. What is the cardinality of A? Is

Topology Math Conrad Plaut

Computational Theory

Computational Models Lecture 8 1

Discrete Mathematics. Benny George K. September 22, 2011

Name (please print) Mathematics Final Examination December 14, 2005 I. (4)

DO FIVE OUT OF SIX ON EACH SET PROBLEM SET

Solution. 1 Solutions of Homework 1. 2 Homework 2. Sangchul Lee. February 19, Problem 1.2

In N we can do addition, but in order to do subtraction we need to extend N to the integers

Topology. Xiaolong Han. Department of Mathematics, California State University, Northridge, CA 91330, USA address:

Cardinality and ordinal numbers

Extended Essay - Mathematics

Computational Models Lecture 8 1

CSE 311: Foundations of Computing. Lecture 26: Cardinality, Uncomputability

Basic set-theoretic techniques in logic Part II, Counting beyond infinity: Ordinal numbers

Sequences are ordered lists of elements

Thus, X is connected by Problem 4. Case 3: X = (a, b]. This case is analogous to Case 2. Case 4: X = (a, b). Choose ε < b a

Countable and uncountable sets. Matrices.

Chapter One. The Real Number System

MAT115A-21 COMPLETE LECTURE NOTES

Selected problems from past exams

Transcription:

15-251 Some AWESOME Great Theoretical Ideas in Computer Science about Generating Functions Probability

15-251 Some AWESOME Great Theoretical Ideas in Computer Science about Generating Functions Infinity Probability

15-251 What Little Susie Should ve Said to Little Johnny

Ideas from the course Induction Numbers Finite Counting and Probability A hint of the infinite Infinite row of dominoes Infinite sums (Generating functions!!) Infinite choice trees, and infinite probability Infinite tapes

The Ideal 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.

Infinite RAM Model Platonic Version: One memory location for each natural number 0, 1, 2, Aristotelian Version: Whenever you run out of memory, the computer contacts the factory. A maintenance person is flown by helicopter and attaches 1000 Gig of RAM and all programs resume their computations, as if they had never been interrupted.

Here s a program System.out.print( 0. ); for(int i=0;true;i++) { System.out.print( getdigit(i) ); }

Here s a program int getdigit(int i) { return 3; }

Here s a program int getdigit(int i) { return i%10; }

Here s a program Can we do: Pi? e? Any real?

Chudnovsky brothers

An Ideal Computer It can be programmed to print out: 2: 2.0000000000000000000000 1/3: 0.3333333333333333333333 φ: 1.6180339887498948482045 e: 2.7182818284590452353602 π: 3.14159265358979323846264

Printing Out An Infinite Sequence.. A program P prints out the infinite sequence s 0, s 1, s 2,, s k, if when P is executed on an ideal computer, it outputs a sequence of symbols such that -The k th symbol that it outputs is s k -For every k, P eventually outputs the k th 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 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?

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. Are all real numbers describable?

Is every computable real number, also a describable real number? And what about the other way? Computable R: some program outputs R Describable R: some sentence denotes R

Computable describable Theorem: Every computable real is also describable

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: The real number output by the following program: P

MORAL: A computer program can be viewed as a description of its output. Syntax: The text of the program Semantics: The real number output by P

Are all reals describable? Are all reals computable? We saw that computable describable, but do we also have describable computable? Questions we will answer in this (and next) lecture

Little Susie

Little Johnny

Little Susie and Little Johnny Little Susie: I hate you Little Johnny: I hate you more Little Susie: I hate you times a zillion Little Johnny: I hate you times infinity Little Susie: I hate you times infinity Plus one!

Susie s mistake Infinity: N. Infinity plus one : N U {cupcake} Can we establish a bijection between N and N U {cupcake}?

Susie s mistake Sure! f : N -> N U {cupcake} f(x) = cupcake if x=0 f(x) = x-1 if x>0 0 1 0 2 1 3 2 4 3 5 4

Correspondence Principle If two finite sets can be placed into 1-1 onto correspondence, then they have the same size. That is, if there exists a bijection between them.

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 1-1 onto correspondence.

Georg Cantor (1845-1918)

Cantor s Definition (1874) Two sets are defined to have the same size if and only if they can be placed into 1-1 onto correspondence.

Cantor s Definition (1874) Two sets are defined to have the same cardinality if and only if they can be placed into 1-1 onto correspondence. Therefore, N and N U {cupcake} have the same cardinality.

Do N and E have the same cardinality? N = { 0, 1, 2, 3, 4, 5, 6, 7, } E = { 0, 2, 4, 6, 8, 10, 12, } The even, natural numbers.

E and N do not have the same cardinality! E is a proper subset of N with not one element left over, but an INFINITE amount!

E and N do have the same cardinality! N = 0, 1, 2, 3, 4, 5, E = 0, 2, 4, 6, 8,10, f(x) = 2x is 1-1 onto.

Lesson: Cantor s definition only requires that some 1-1 correspondence between the two sets is onto, not that all 1-1 correspondences are onto. This distinction never arises when the sets are finite.

Cantor s Definition (1874) Two sets are defined to have the same size if and only if they can be placed into 1-1 onto correspondence.

You just have to get used to this slight subtlety in order to argue about infinite sets!

Do N and Z have the same cardinality? N = { 0, 1, 2, 3, 4, 5, 6, 7, } Z = {, -2, -1, 0, 1, 2, 3, }

No way! Z is infinite in two ways: from 0 to positive infinity and from 0 to negative infinity. Therefore, there are far more integers than naturals. Actually, no!

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

Transitivity Lemma Do E and Z have the same cardinality?

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

Do N and Q have the same cardinality? N = { 0, 1, 2, 3, 4, 5, 6, 7,. } Q = The Rational Numbers

No way! 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.

Don t jump to conclusions! There is a clever way to list the rationals, one at a time, without missing a single one!

First, let s warm up with another interesting example: N can be paired with NxN

Theorem: N and NxN have the same cardinality

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

Theorem: N and NxN have the same cardinality 4 3 2 1 3 1 6 4 7 8 The point (x,y) represents the ordered pair (x,y) 0 0 5 2 9 0 1 2 3 4

Defining 1-1 onto f: N -> NxN int sum; for (sum = 0;true;sum++) { //generate all pairs with this sum for (x = 0;x<=sum;x++) { y = sum-x; System.out.println(x+ + y); } }

Onto the Rationals!

The point at x,y represents x/y

The point at x,y represents x/y

Hold it! You ve included both 1,1 and 2,2 They correspond to the same rational. Also, 0/0, 1/0, 2/0, are not rational!

Hold it! 0 0/0 1 0/1 2 1/1 3 1/0 4 1/-1 5 0/-1 6-1/-1 7-1/0 8-1/1 9-1/2 10 0/2 11 1/2 12 2/2 13 2/1 14 2/0 15 2/-1 16 2/-2 17 1/-2 18 0/-2 19-1/-2 20-2/-2

Hold it! 0 0/0 1 0/1 2 1/1 3 1/0 4 1/-1 5 0/-1 6-1/-1 7-1/0 8-1/1 9-1/2 10 0/2 11 1/2 12 2/2 13 2/1 14 2/0 15 2/-1 16 2/-2 17 1/-2 18 0/-2 19-1/-2 20-2/-2

Hold it! 0 1 0/1 2 1/1 3 4 1/-1 5 6 7 8 9-1/2 10 11 1/2 12 13 2/1 14 15 2/-1 16 17 18 19 20

Hold it! 0 0/1 1 1/1 2 1/-1 3-1/2 4 1/2 5 2/1 6 2/-1

Hold it! It s okay. We can just skip those. So instead of assigning 0 to 0/0 we will assign it to 0/1, and so on. This way, we ll use all the naturals and we ll hit all the rationals without duplication.

Cantor-Bernstein-Schroeder If there exists an injection from A to B and an injection from B to A, then there exists a bijection between B and A. Easy to prove for finite sets, trickier for infinite sets.

Cantor-Bernstein-Schroeder Injection from N to Q f(x) = x Injection from Q to N

The point at x,y represents x/y

Injection from Q to N 0 1 0/1 2 1/1 3 4 1/-1 5 6 7 8 9-1/2 10 11 1/2 12 13 2/1 14 15 2/-1 16 17 18 19 20

Injection from Q to N 0 1 0/1 2 1/1 3 4 1/-1 5 6 7 8 9-1/2 10 11 1/2 12 13 2/1 14 15 2/-1 16 17 18 19 20

Cantor-Bernstein-Schroeder Injection from Q to N Just eliminate the invalid matchings. We match all the valid rationals and never duplicate a natural. While this misses some naturals, it s still an injection.

Countable Sets We call a set countable if it can be placed into 1-1 onto correspondence with the natural numbers N. Hence N, E, Q, and Z are all countable

Do N and R have the same cardinality? N = { 0, 1, 2, 3, 4, 5, 6, 7, } R = The Real Numbers

No way! You will run out of natural numbers long before you match up every real.

Now hang on a minute! You can t be sure that there isn t some clever correspondence that you haven t thought of yet.

I am sure! Cantor proved it. To do this, he invented a very important technique called Diagonalization

Theorem: The set of reals between 0 and 1 is not countable. Proof: (by contradiction) Suppose R [0,1] is countable. Let f be a 1-1 onto function 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)

Theorem: The set of reals between 0 and 1 is not countable. Proof: (by contradiction) Suppose R [0,1] is countable. Let f be a 1-1 onto function from N to R [0,1]. Make a list L as follows: 0: 0.33333333333333333 1: 0.314159265657839593 k: 0.235094385543905834

Position after decimal point L 0 1 2 3 4 0 Index 1 2 3

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

digits along the diagonal L 0 1 2 3 4 0 d 0 1 d 1 2 d 2 3 d 3

L 0 1 2 3 4 0 d 0 1 d 1 2 d 2 3 d 3 Define the following real number Confuse L =. C 0 C 1 C 2 C 3 C 4 C 5

L 0 1 2 3 4 0 d 0 1 d 1 2 d 2 3 d 3 Define the following real number Confuse L =. C 0 C 1 C 2 C 3 C 4 C 5 C k = 5, if d k =6 6, otherwise

L 0 1 2 3 4 0 C k = C 0 d 0 C 1 C 2 C 3 C 4 5, if d k =6 6, otherwise 1 d 1 2 d 2 3 d 3

L 0 1 2 3 4 0 d 0 C k = 5, if d k =6 6, otherwise 1 C 0 C 1 d 1 C 2 C 3 C 4 2 d 2 3 d 3

L 0 1 2 3 4 0 d 0 C k = 5, if d k =6 6, otherwise 1 d 1 2 C 0 C 1 C 2 d 2 C 3 C 4 3 d 3

Diagonalized! By design, Confuse L can t be on the list L! Confuse L differs from the k th element on the list L in the k th 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.) An aside: you can set up a correspondence between R and R [0,1].

Hold it! Why can t the same argument be used to show that the set of rationals Q is uncountable?

The argument is the same for Q until the punchline. However, since CONFUSE L is not necessarily rational, there is no contradiction from the fact that it is missing from the list L.

Back to the questions we were asking earlier

Are all reals describable? Are all reals computable? We saw that computable describable, but do we also have describable computable?

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

Theorem: Every infinite subset S of Σ * 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.

Stringing Symbols Together Σ = The symbols on a standard keyboard For example: The set of all possible Java programs is a subset of Σ The set of all possible finite pieces of English text is a subset of Σ

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

There are countably many Java program and uncountably many reals. Hence, Most reals are not computable!

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

Are all reals describable? Are all reals computable? NO NO We saw that computable describable, but do we also have describable computable?

Is there a real number that can be described, but not computed? Wait till the next lecture!

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

Theorem: S can t be put into bijection with P(S)

Theorem: S can t be put into bijection with P(S) S P(S) B A C {C} {A} {B,C} {B} {A,B} {A,C} {A,B,C} Suppose f:s P(S) is a bijection. Let CONFUSE f contain all and only those elements that are not in the sets they map to Since f is onto, exists y S such that f(y) = CONFUSE f. Is y in CONFUSE f? YES: Definition of CONFUSE f implies no NO: Definition of CONFUSE f implies yes

This proves that there are at least a countable number of infinities. The first infinity is called: ℵ 0

N, P(N), P(P(N)), Are there any more infinities?

N, P(N), P(P(N)), Let S be the union of all of them! Then S cannot be bijected to any of them!

In fact, the same argument can be used to show that no single infinity is big enough to count the number of infinities!

Cantor wanted to show that there was no infinity between N and P(N)

Cantor called his conjecture the Continuum Hypothesis. However, he was unable to prove it. This helped fuel his depression.

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

Little Susie and Little Johnny What Little Susie should ve said to Little Johnny: Little Johnny: I hate you times infinity Little Susie: I hate you times 2 to the infinity! Little Johnny: I hate you times 2 to the 2 to the infinity!

Cantor s Definition: Two sets have the same cardinality if there exists a bijection between them. E = N = Z = Q (and proofs), Cantor-Bernstein-Schroeder Proof that there is no bijection between N and R Here s What You Need to Know Countable versus Uncountable Power sets and their properties