Relations Between Sets... Injective Functionf domain codomain “at most one arrow in”... Surjective Functionf domain codomain “at least one arrow in” ∀b∈B∃≥1a∈A fa=b... Bijection = Total
Trang 1Relations Between Sets
Trang 2Sam
EC 10 Students Courses
The “is-taking” relation
A relation is a set of ordered pairs:
{(Sam,Ec10), (Sam, CS20), (Mary, CS20)}
Trang 3Function: A → B
Each element of A is associated with at most one element of B a ⟼ b f(a) = b
f
AT MOST ONE ARROW OUT OF EACH ELEMENT OF A
Trang 4Total Function: A → B
Each element of A is associated with ONE AND ONLY one element of B a ⟼ b f(a) = b
f
EXACTLY ONE ARROW OUT OF EACH ELEMENT OF A
Trang 5A Function that is “Partial,”
Not Total
f: R ×R → R
f(x,y) = x/y
Defined for all pairs (x,y) except when y=0!
f
Trang 6A Function that is “Partial,”
Not Total
f: R ×R → R
f(x,y) = x/y
Defined for all pairs (x,y) except when y=0!
Or: f is a total function: R×(R-{0})→R
f
Trang 7Injective Function
f
domain
codomain
“at most one arrow in”
Trang 8Surjective Function
f
domain
codomain
“at least one arrow in”
(∀b∈B)(∃≥1a∈A) f(a)=b
Trang 9Bijection = Total + Injective + Surjective
f
“exactly one arrow out of each element of A
and exactly one arrow in to each element of B”
Trang 10Cardinality or “Size”
f
For finite sets, a bijection exists iff A and B have the same number of
elements
Trang 11Cardinality or “Size”
Use the same as a definition of “same size” for infinite sets:
Sets A and B have the same size iff there is a bijection between A and B
Theorem: The set of even integers has the same size as the set of all
integers [f(2n) = n]
…, -4, -3, -2, -1, 0, 1, 2, 3, 4 …
Trang 12Cardinality or “Size”
There are as many natural numbers as integers
0 1 2 3 4 5 6 7 8 …
0, -1, 1, -2, 2, -3, 3, -4, 4 …
f(n) = n/2 if n is even, -(n+1)/2 if n is odd
Defn: A set is countably infinite if it has the same size as the set of
natural numbers
Trang 13An Infinite Set May Have the Same Size as a
Proper Subset!
0
1
2
3
4
5
0 1 2 3 4 5
Every room of both hotels is full!
Suppose the Sheraton has to be evacuated
Trang 14An Infinite Set May Have the Same Size as a
Proper Subset!
0
1
2
3
4
5
0 1 2 3 4 5
Step 1: Tell the resident of room n in the Hilton to go to room 2n
This leaves all the odd-numbered rooms of the Hilton unoccupied
Trang 15An Infinite Set May Have the Same Size as a
Proper Subset!
0
1
2
3
4
5
0 1 2 3 4 5
Step 2: Tell the resident of room n in the Sheraton to go to room 2n+1 of the Hilton.
Everyone gets a room!