Date post: | 13-Dec-2015 |
Category: |
Documents |
Upload: | kiley-shreve |
View: | 215 times |
Download: | 0 times |
CSE 20 DISCRETE MATHProf. Shachar Lovett
http://cseweb.ucsd.edu/classes/wi15/cse20-a/
Clicker frequency: CA
Todays topics• Functions• One-to-one, onto, bijective• Sequences• Inverse function
• Section 2.2 in Jenkyns, Stephenson
What is a function?• X,Y are sets• A function is a mapping from X to Y• Every element is mapped to
• Equivalently, can be viewed as a set
• Note: every element x is mapped to exactly one element in Y, i.e f(x)
What is a function?• Is the following a function from X to Y?
A. Yes
B. No
X Y
What is a function?• Is the following a function from X to Y?
A. Yes
B. No
X Y
What is a function?• Is the following a function from X to Y?
A. Yes
B. No
X Y
What is a function?• Is the following a function from X to Y?
A. Yes
B. No
X
Y
What is a function?• Is the following a function from Y to X?
A. Yes
B. No
X
Y
Properties of functions• Function
• f is one-to-one (also called injective) if different values in X are mapped to different values in Y
• Equivalently:
(recall: is equivalent to )
Properties of functions• Function
• f is one-to-one (also called injective) if different values in X are mapped to different values in Y
• Equivalently:
(recall: is equivalent to )
• f is onto (also called surjective) if every element of y is mapped to by some x (possibly more than one)
Properties of functions• Function
• f is one-to-one (also called injective) if different values in X are mapped to different values in Y
• Equivalently:
(recall: is equivalent to )
• f is onto (also called surjective) if every element of y is mapped to by some x (possibly more than one)
• f is bijective if it is both one-to-one and onto
One-to-one, onto, bijective…
X Y
• Is the following function
A. One-to-one
B. Onto
C. Both (bijective)
D. None
One-to-one, onto, bijective…
X Y
• Is the following function
A. One-to-one
B. Onto
C. Both (bijective)
D. None
One-to-one, onto, bijective…
X Y
• Is the following function
A. One-to-one
B. Onto
C. Both (bijective)
D. None
One-to-one, onto, bijective…• Which of the following functions f:NN is not injective
A. f(x)=x
B. f(x)=x2
C. f(x)=x+1
D. f(x)=2x
E. None/other/more than one
One-to-one, onto, bijective…• Which of the following functions f:NN is not surjective
A. f(x)=x
B. f(x)=x2
C. f(x)=x+1
D. f(x)=2x
E. None/other/more than one
Sequences
• A finite sequence is a1,a2,…,an
• Example: 1,2,3,5,1,2
• If elements are in some set X, it can be equivalently described by
• An infinite sequence is a1,a2,…,an,…• Example: 1,2,4,8,16,… That is,
• It can be equivalently described by
Inverses• Function
• A function is an inverse of f if
• Questions:• Does any function have an inverse? • If not, which properties of f are required for it to have an inverse?• Is the inverse unique?
Inverses• Does the following function have an inverse:
A. Yes
B. No
Inverses• Does the following function have an inverse:
A. Yes
B. No
Inverses• Does the following function have an inverse:
A. Yes
B. No
Inverses• Theorem: a function has an inverse if and only if it is bijective
(eg both one-to-one and onto)
• We will see the proof for finite sets X,Y once we learn some proof techniques
• The proof extends to infinite sets
• We will use this to define a notion of “size” for infinite sets (called “cardinality”).
• We will prove that not all infinite sets have the same cardinality, so this definition makes sense.
Next class• Proof techniques
• Read section 3.5 in Jenkyns, Stephenson