CSE 20 – Discrete Mathematics
description
Transcript of CSE 20 – Discrete Mathematics
![Page 1: CSE 20 – Discrete Mathematics](https://reader036.fdocuments.net/reader036/viewer/2022062323/568161d3550346895dd1cfbf/html5/thumbnails/1.jpg)
CSE 20 – Discrete MathematicsDr. Cynthia Bailey LeeDr. Shachar Lovett
Peer Instruction in Discrete Mathematics by Cynthia Leeis licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.Based on a work at http://peerinstruction4cs.org.Permissions beyond the scope of this license may be available at http://peerinstruction4cs.org.
![Page 2: CSE 20 – Discrete Mathematics](https://reader036.fdocuments.net/reader036/viewer/2022062323/568161d3550346895dd1cfbf/html5/thumbnails/2.jpg)
2
Today’s Topics:0. Finish Friday’s Set Theory1. Functions2. Set sizes3. Infinite set sizes (if time permits)
![Page 3: CSE 20 – Discrete Mathematics](https://reader036.fdocuments.net/reader036/viewer/2022062323/568161d3550346895dd1cfbf/html5/thumbnails/3.jpg)
3
(From Friday)Rapid-fire set-theory practiceClickers ready!
![Page 4: CSE 20 – Discrete Mathematics](https://reader036.fdocuments.net/reader036/viewer/2022062323/568161d3550346895dd1cfbf/html5/thumbnails/4.jpg)
4
Set Theory rapid-fire practice (A and B are sets)
A. TRUEB. FALSE
In your discussion: If true, prove it! (quickly sketch out what the argument would be) If false, what are the counterexample A and B?
![Page 5: CSE 20 – Discrete Mathematics](https://reader036.fdocuments.net/reader036/viewer/2022062323/568161d3550346895dd1cfbf/html5/thumbnails/5.jpg)
5
Set Theory rapid-fire practice (A and B are sets)
A. TRUEB. FALSE
In your discussion: If true, prove it! (quickly sketch out what the argument would be) If false, what are the counterexample A and B?
![Page 6: CSE 20 – Discrete Mathematics](https://reader036.fdocuments.net/reader036/viewer/2022062323/568161d3550346895dd1cfbf/html5/thumbnails/6.jpg)
6
Set Theory rapid-fire practice (A is a set)
A. TRUEB. FALSE
In your discussion: If true, prove it! (quickly sketch out what the argument would be) If false, what are the counterexample A and B?
![Page 7: CSE 20 – Discrete Mathematics](https://reader036.fdocuments.net/reader036/viewer/2022062323/568161d3550346895dd1cfbf/html5/thumbnails/7.jpg)
7
1. Functions
![Page 8: CSE 20 – Discrete Mathematics](https://reader036.fdocuments.net/reader036/viewer/2022062323/568161d3550346895dd1cfbf/html5/thumbnails/8.jpg)
8
What is a function? Is the following a function from X to Y?
A. YesB. No
X Y
![Page 9: CSE 20 – Discrete Mathematics](https://reader036.fdocuments.net/reader036/viewer/2022062323/568161d3550346895dd1cfbf/html5/thumbnails/9.jpg)
9
What is a function? Is the following a function from X to Y?
A. YesB. No
X Y
![Page 10: CSE 20 – Discrete Mathematics](https://reader036.fdocuments.net/reader036/viewer/2022062323/568161d3550346895dd1cfbf/html5/thumbnails/10.jpg)
10
What is a function? Is the following a function from X to Y?
A. YesB. No
X Y
![Page 11: CSE 20 – Discrete Mathematics](https://reader036.fdocuments.net/reader036/viewer/2022062323/568161d3550346895dd1cfbf/html5/thumbnails/11.jpg)
11
What is a function? Is the following a function from X to Y?
A. YesB. No
X
Y
![Page 12: CSE 20 – Discrete Mathematics](https://reader036.fdocuments.net/reader036/viewer/2022062323/568161d3550346895dd1cfbf/html5/thumbnails/12.jpg)
12
What is a function? Is the following a function from Y to X?
A. YesB. No
X
Y
![Page 13: CSE 20 – Discrete Mathematics](https://reader036.fdocuments.net/reader036/viewer/2022062323/568161d3550346895dd1cfbf/html5/thumbnails/13.jpg)
13
What is a function A function f:XY maps any element of X
to an element of Y
Every element of X is mapped – f(x) is always defined
Every element of X is mapped to just one value in Y
![Page 14: CSE 20 – Discrete Mathematics](https://reader036.fdocuments.net/reader036/viewer/2022062323/568161d3550346895dd1cfbf/html5/thumbnails/14.jpg)
14
Injective, Surjective, Bijective… Is the following function
A. InjectiveB. SurjectiveC. BijectiveD. None
X Y
![Page 15: CSE 20 – Discrete Mathematics](https://reader036.fdocuments.net/reader036/viewer/2022062323/568161d3550346895dd1cfbf/html5/thumbnails/15.jpg)
15
Injective, Surjective, Bijective… Is the following function
A. InjectiveB. SurjectiveC. BijectiveD. None
X Y
![Page 16: CSE 20 – Discrete Mathematics](https://reader036.fdocuments.net/reader036/viewer/2022062323/568161d3550346895dd1cfbf/html5/thumbnails/16.jpg)
16
Injective, Surjective, Bijective… Is the following function
A. InjectiveB. SurjectiveC. BijectiveD. None
X Y
![Page 17: CSE 20 – Discrete Mathematics](https://reader036.fdocuments.net/reader036/viewer/2022062323/568161d3550346895dd1cfbf/html5/thumbnails/17.jpg)
17
Injective, Surjective, Bijective… Function f:X Y f is injective if: f(x)=f(y) x=y
That is, no two elements in X are mapped to the same value
f is surjective if: yY xX s.t. f(x)=y There is always an “inverse” Could be more than one x!
f is bijective if it is both injective and surjective
![Page 18: CSE 20 – Discrete Mathematics](https://reader036.fdocuments.net/reader036/viewer/2022062323/568161d3550346895dd1cfbf/html5/thumbnails/18.jpg)
18
2. Set sizes
![Page 19: CSE 20 – Discrete Mathematics](https://reader036.fdocuments.net/reader036/viewer/2022062323/568161d3550346895dd1cfbf/html5/thumbnails/19.jpg)
19
Set sizes Let X,Y be finite sets, f:XY a function
Theorem: If f is injective then |X| |Y|.
Try and prove yourself first
![Page 20: CSE 20 – Discrete Mathematics](https://reader036.fdocuments.net/reader036/viewer/2022062323/568161d3550346895dd1cfbf/html5/thumbnails/20.jpg)
20
Set sizes Let X,Y be finite sets, f:XY a function Theorem: If f is injective then |X| |Y|.
Proof by picture (not really a proof, just for intuition):
X Y
![Page 21: CSE 20 – Discrete Mathematics](https://reader036.fdocuments.net/reader036/viewer/2022062323/568161d3550346895dd1cfbf/html5/thumbnails/21.jpg)
21
Set sizes Let X,Y be finite sets, f:XY a function Theorem: If f is injective then |X||Y|.
Proof: Consider the set S={(x,f(x)): xX}.Since f is a function, each xX appears exactly once hence |S|=|X|.Since f is injective, the values of f(x) are all distinct, i.e. each value yY appears in at most one pair. Hence |S||Y|.So, |X||Y|. QED.
![Page 22: CSE 20 – Discrete Mathematics](https://reader036.fdocuments.net/reader036/viewer/2022062323/568161d3550346895dd1cfbf/html5/thumbnails/22.jpg)
22
Set sizes Let X,Y be finite sets, f:XY a function
Theorem: If f is surjective then |X| |Y|.
Try and prove yourself first
![Page 23: CSE 20 – Discrete Mathematics](https://reader036.fdocuments.net/reader036/viewer/2022062323/568161d3550346895dd1cfbf/html5/thumbnails/23.jpg)
23
Set sizes Let X,Y be finite sets, f:XY a function Theorem: If f is surjective then |X| |Y|.
Proof by picture (not really a proof, just for intuition):
X Y
![Page 24: CSE 20 – Discrete Mathematics](https://reader036.fdocuments.net/reader036/viewer/2022062323/568161d3550346895dd1cfbf/html5/thumbnails/24.jpg)
24
Set sizes Let X,Y be finite sets, f:XY a function Theorem: If f is surjective then |X||Y|.
Proof: Consider the set S={(x,f(x)): xX}.Since f is a function, each xX appears exactly once hence |S|=|X|.Since f is surjective, all values yY appear in at least one pair. So |S||Y|.So, |X||Y|. QED.
![Page 25: CSE 20 – Discrete Mathematics](https://reader036.fdocuments.net/reader036/viewer/2022062323/568161d3550346895dd1cfbf/html5/thumbnails/25.jpg)
25
Set sizes Let X,Y be finite sets, f:XY a function
Theorem: If f is bijective then |X|=|Y|.
Try and prove yourself first
![Page 26: CSE 20 – Discrete Mathematics](https://reader036.fdocuments.net/reader036/viewer/2022062323/568161d3550346895dd1cfbf/html5/thumbnails/26.jpg)
26
Set sizes Let X,Y be finite sets, f:XY a function Theorem: If f is bijective then |X|=|Y|.
Proof by picture (not really a proof, just for intuition):
X Y
![Page 27: CSE 20 – Discrete Mathematics](https://reader036.fdocuments.net/reader036/viewer/2022062323/568161d3550346895dd1cfbf/html5/thumbnails/27.jpg)
27
Set sizes Let X,Y be finite sets, f:XY 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.
![Page 28: CSE 20 – Discrete Mathematics](https://reader036.fdocuments.net/reader036/viewer/2022062323/568161d3550346895dd1cfbf/html5/thumbnails/28.jpg)
28
3. Infinite set sizes
![Page 29: CSE 20 – Discrete Mathematics](https://reader036.fdocuments.net/reader036/viewer/2022062323/568161d3550346895dd1cfbf/html5/thumbnails/29.jpg)
29
Infinite set sizes Let X,Y be infinite sets (e.g natural numbers,
primes numers, reals)
We define |X||Y| if there is an injective function f:X Y
If Z=integers and E=even integers, isA. |Z||E|B. |E||Z|C. BothD. Neither
![Page 30: CSE 20 – Discrete Mathematics](https://reader036.fdocuments.net/reader036/viewer/2022062323/568161d3550346895dd1cfbf/html5/thumbnails/30.jpg)
30
Infinite set sizes |Z|=|E| How do we prove this?
|E| |Z| because we can define f:EZ by f(x)=x. It is injective.
|Z| |E| because we can define f:ZE by f(x)=2x. It is injective.
![Page 31: CSE 20 – Discrete Mathematics](https://reader036.fdocuments.net/reader036/viewer/2022062323/568161d3550346895dd1cfbf/html5/thumbnails/31.jpg)
31
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
BUT! |reals|>|Z| There are “really” more reals than integers We will prove this (maybe) later in the course