CSE 20: Discrete Mathematics for Computer Science Prof. Shachar Lovett.

Slides:



Advertisements
Similar presentations
Countability. The cardinality of the set A is equal to the cardinality of a set B if there exists a bijection from A to B cardinality? bijection? injection.
Advertisements

CSE 20 DISCRETE MATH Prof. Shachar Lovett Clicker frequency: CA.
CSE 20 DISCRETE MATH Prof. Shachar Lovett Clicker frequency: CA.
1 COMP 382: Reasoning about algorithms Unit 9: Undecidability [Slides adapted from Amos Israeli’s]
1 Diagonalization Fact: Many books exist. Fact: Some books contain the titles of other books within them. Fact: Some books contain their own titles within.
CSE 20 – Discrete Mathematics Dr. Cynthia Bailey Lee Dr. Shachar Lovett Peer Instruction in Discrete Mathematics by Cynthia Leeis licensed under a Creative.
Functions, Pigeonhole Principle Lecture 14: Nov 4 A B f( ) =
Introduction to Computability Theory
Great Theoretical Ideas in Computer Science.
1 Undecidability Andreas Klappenecker [based on slides by Prof. Welch]
CSE115/ENGR160 Discrete Mathematics 02/21/12
Functions f( ) = A B Lecture 15: Nov 4.
Pigeonhole.
1 Introduction to Computability Theory Lecture11: The Halting Problem Prof. Amos Israeli.
Cantor’s Legacy: Infinity And Diagonalization Great Theoretical Ideas In Computer Science Steven RudichCS Spring 2004 Lecture 25Apr 13, 2004Carnegie.
Functions A B f( ) =. This Lecture We will define a function formally, and then in the next lecture we will use this concept in counting. We will also.
Cardinality of Sets Section 2.5.
Set theory Sets: Powerful tool in computer science to solve real world problems. A set is a collection of distinct objects called elements. Traditionally,
CSE 20 – Discrete Mathematics Dr. Cynthia Bailey Lee Dr. Shachar Lovett Peer Instruction in Discrete Mathematics by Cynthia Leeis licensed under a Creative.
CS 173, Lecture B August 27, 2015 Tandy Warnow. Proofs You want to prove that some statement A is true. You can try to prove it directly, or you can prove.
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.
Discrete Mathematics and Its Applications Sixth Edition By Kenneth Rosen Copyright  The McGraw-Hill Companies, Inc. Permission required for reproduction.
1 Melikyan/DM/Fall09 Discrete Mathematics Ch. 7 Functions Instructor: Hayk Melikyan Today we will review sections 7.1 and 7.2.
A Universal Turing Machine
CSE 20: Discrete Mathematics for Computer Science Prof. Shachar Lovett.
COMPSCI 102 Introduction to Discrete Mathematics.
Based on Rosen, Discrete Mathematics & Its Applications, 5e Prepared by (c) Michael P. Frank Modified by (c) Haluk Bingöl 1/18 Module.
CSE 20: Discrete Mathematics for Computer Science Prof. Shachar Lovett.
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.
Fall 2015 COMP 2300 Discrete Structures for Computation Donghyun (David) Kim Department of Mathematics and Physics North Carolina Central University 1.
Basic Structures: Sets, Functions, Sequences, and Sums.
Cardinality with Applications to Computability Lecture 33 Section 7.5 Wed, Apr 12, 2006.
Great Theoretical Ideas in Computer Science.
CSE 20 – Discrete Mathematics Dr. Cynthia Bailey Lee Dr. Shachar Lovett Peer Instruction in Discrete Mathematics by Cynthia Leeis licensed under a Creative.
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
CSE 20: Discrete Mathematics for Computer Science Prof. Shachar Lovett.
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.
CS 173, Lecture B August 27, 2015 Tandy Warnow. Proofs You want to prove that some statement A is true. You can try to prove it directly, or you can prove.
1 Lecture 5 Functions. 2 Functions in real applications Curve of a bridge can be described by a function Converting Celsius to Fahrenheit.
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.
Function Hubert Chan (Chapter 2.1, 2.2) [O1 Abstract Concepts]
Discrete Mathematics CS 2610
CSE 20 – Discrete Mathematics
Function Hubert Chan (Chapter 2.1, 2.2) [O1 Abstract Concepts]
2.4 Sequences and Summations
Cardinality of Sets Section 2.5.
Finite and Infinite Sets
CSE 20: Discrete Mathematics for Computer Science Prof. Shachar Lovett
CSE 20: Discrete Mathematics for Computer Science Prof. Shachar Lovett
Lecture 7 Functions.
Discrete Structures for Computer Science
CSE15 Discrete Mathematics 02/27/17
CSE 20: Discrete Mathematics for Computer Science Prof. Shachar Lovett
Module #4.5, Topic #∞: Cardinality & Infinite Sets
Discrete Mathematics and its Applications
Discrete Math for CS CMPSC 360 LECTURE 43 Last time: Variance
Formal Languages, Automata and Models of Computation
CSE 20: Discrete Mathematics for Computer Science Prof. Shachar Lovett
Module #4.5, Topic #∞: Cardinality & Infinite Sets
Discrete Mathematics CS 2610
Functions Rosen 2.3, 2.5 f( ) = A B Lecture 5: Oct 1, 2.
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.
Presentation transcript:

CSE 20: Discrete Mathematics for Computer Science Prof. Shachar Lovett

Today’s Topics: 1. Functions and set sizes 2. Infinite set sizes 2

1. Functions and set sizes 3

Set sizes  Let X,Y be finite sets, f:X  Y a function  Theorem: If f is injective then |X|  |Y|.  Try and prove yourself first 4

Set sizes  Let X,Y be finite sets, f:X  Y a function  Theorem: If f is injective then |X|  |Y|.  Proof by picture (not really a proof, just for intuition): 5 XY

Set sizes  Let X,Y be finite sets, f:X  Y a function  Theorem: If f is injective then |X|  |Y|.  Actual proof:  Consider the set S={(x,f(x)): x  X}. This is called that “graph of f”.  Since f is a function, each x  X appears exactly once, hence |S|=|X|.  Since f is injective, the values of f(x) are all distinct, i.e. each value y  Y appears in at most one pair. Hence |S|  |Y|.  So, |X|  |Y|.  QED. 6

Set sizes  Let X,Y be finite sets, f:X  Y a function  Theorem: If f is surjective then |X|  |Y|.  Try and prove yourself first 7

Set sizes  Let X,Y be finite sets, f:X  Y a function  Theorem: If f is surjective then |X|  |Y|.  Proof by picture (not really a proof, just for intuition): 8 XY

Set sizes  Let X,Y be finite sets, f:X  Y a function  Theorem: If f is surjective then |X|  |Y|.  Proof:  Consider again the set S={(x,f(x)): x  X}.  Since f is a function, each x  X appears exactly once hence |S|=|X|.  Since f is surjective, all values y  Y appear in at least one pair. So |S|  |Y|.  So, |X|  |Y|.  QED. 9

Set sizes  Let X,Y be finite sets, f:X  Y a function  Theorem: If f is bijective then |X|=|Y|.  Try and prove yourself first 10

Set sizes  Let X,Y be finite sets, f:X  Y a function  Theorem: If f is bijective then |X|=|Y|.  Proof by picture (not really a proof, just for intuition): 11 XY

Set sizes  Let X,Y be finite sets, f:X  Y a function  Theorem: If f is bijective then |X|=|Y|.  Proof: f is bijective so it is both injective (hence |X|  |Y|) and surjective (hence |X|  |Y|). So |X|=|Y|. QED. 12

3. Infinite set sizes 13

Infinite set sizes  Let X,Y be infinite sets (e.g natural numbers, prime numbers, reals)  We want to define a notion of set size (called cardinality) which will make sense  Turns out, it is easier to just define which sets are smaller than other ones 14

Infinite set sizes  Let X,Y be infinite sets (e.g natural numbers, primes numbers, reals)  We define |X|  |Y| if there is an injective function f:X  Y  If Z=integers and E=even integers, is A. |Z|  |E| B. |E|  |Z| C. Both D. Neither 15

Infinite set sizes  |Z|=|E|  How do we prove this?  |E|  |Z| because we can define f:E  Z by f(x)=x. It is injective.  |Z|  |E| because we can define f:Z  E by f(x)=2x. It is injective. 16

Infinite set sizes  Interesting facts: |Z|=|E|=|prime numbers|=|N|  This “size”, or cardinality, is called countable and denoted as  0  It is the smallest infinite size  These are sets which you can list in a sequence  BUT! |reals|>|Z|  There are “really” more reals than integers  We will prove that! 17

Countable sets  Theorem: The rationals are countable, |Q|=  0  Proof: we need to show that we can list the rationals in a sequence  Bad idea: 1,1/2,1/3,1/4,1/5,1/6,…  This way we will never hit, say, 2/3 18

Countable sets  Theorem: The rationals are countable, |Q|=  0  Proof:  It’s enough to the list positive rationals, because if Q + ={x 1,x 2,x 3,…} then we have Q={0,x 1,-x 1,x 2,-x 2,x 3,-x 3,…}  Solution: list x/y by first enumerating s=x+y, then x=1,2,…,s 1/1, 1/2, 2/1, 1/3, 2/2, 3/1, 1/4, 2/3, 3/2, 4/1, … 19 X

Enumerating the rationals x y 2 3 X

Reals are uncountable  Theorem : |R|>  0  Proof: by contradiction  Say we can list all the real numbers in [0,1] in a sequence x 1,x 2,x 3,…  For each number, write its representation in base 10, eg …  Let x i =0.b i,1 b i,2 b i,3 b i,4 … 21

Reals are uncountable  Theorem : |R|>  0  R={x 1,x 2,x 3,…}. Create a table: x 1 =0.b 1,1 b 1,2 b 1,3 b 1,4 … x 2 =0.b 2,1 b 2,2 b 2,3 b 2,4 … x 3 =0.b 3,1 b 3,2 b 3,3 b 1,4 … x 4 =0.b 4,1 b 4,2 b 4,3 b 4,4 … … 22

Reals are uncountable  Theorem : |R|>  0  R={x 1,x 2,x 3,…}. Create a table: x 1 =0.b 1,1 b 1,2 b 1,3 b 1,4 … x 2 =0.b 2,1 b 2,2 b 2,3 b 2,4 … x 3 =0.b 3,1 b 3,2 b 3,3 b 1,4 … x 4 =0.b 4,1 b 4,2 b 4,3 b 4,4 … …  Define a number x=0.c 1 c 2 c 3 c 4 … such that c i  b i,i for all i  c cannot be equal to any x i, since their i-th digits differ  Hence, c is a real number which is not in our list  A contradiction. The reals cannot be listed. 23

Diagonilaztion  This proof technique is called diagonilaztion  It is used to create an object different from all the element in our list  It is very powerful  For example, it can be used to show that it is generally impossible to know whether a computer code is correct, or even simpler questions, like if it loops forever or not 24