cse 20 discrete math prof. shachar lovett clicker frequency: ca

23
CSE 20 DISCRETE MATH Prof. Shachar Lovett http://cseweb.ucsd.edu/classes/wi15/cse20-a/ Clicker frequency: CA

Upload: kiley-shreve

Post on 13-Dec-2015

217 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: CSE 20 DISCRETE MATH Prof. Shachar Lovett  Clicker frequency: CA

CSE 20 DISCRETE MATHProf. Shachar Lovett

http://cseweb.ucsd.edu/classes/wi15/cse20-a/

Clicker frequency: CA

Page 2: CSE 20 DISCRETE MATH Prof. Shachar Lovett  Clicker frequency: CA

Todays topics• Functions• One-to-one, onto, bijective• Sequences• Inverse function

• Section 2.2 in Jenkyns, Stephenson

Page 3: CSE 20 DISCRETE MATH Prof. Shachar Lovett  Clicker frequency: CA

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)

Page 4: CSE 20 DISCRETE MATH Prof. Shachar Lovett  Clicker frequency: CA

What is a function?• Is the following a function from X to Y?

A. Yes

B. No

X Y

Page 5: CSE 20 DISCRETE MATH Prof. Shachar Lovett  Clicker frequency: CA

What is a function?• Is the following a function from X to Y?

A. Yes

B. No

X Y

Page 6: CSE 20 DISCRETE MATH Prof. Shachar Lovett  Clicker frequency: CA

What is a function?• Is the following a function from X to Y?

A. Yes

B. No

X Y

Page 7: CSE 20 DISCRETE MATH Prof. Shachar Lovett  Clicker frequency: CA

What is a function?• Is the following a function from X to Y?

A. Yes

B. No

X

Y

Page 8: CSE 20 DISCRETE MATH Prof. Shachar Lovett  Clicker frequency: CA

What is a function?• Is the following a function from Y to X?

A. Yes

B. No

X

Y

Page 9: CSE 20 DISCRETE MATH Prof. Shachar Lovett  Clicker frequency: CA

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 )

Page 10: CSE 20 DISCRETE MATH Prof. Shachar Lovett  Clicker frequency: CA

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)

Page 11: CSE 20 DISCRETE MATH Prof. Shachar Lovett  Clicker frequency: CA

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

Page 12: CSE 20 DISCRETE MATH Prof. Shachar Lovett  Clicker frequency: CA

One-to-one, onto, bijective…

X Y

• Is the following function

A. One-to-one

B. Onto

C. Both (bijective)

D. None

Page 13: CSE 20 DISCRETE MATH Prof. Shachar Lovett  Clicker frequency: CA

One-to-one, onto, bijective…

X Y

• Is the following function

A. One-to-one

B. Onto

C. Both (bijective)

D. None

Page 14: CSE 20 DISCRETE MATH Prof. Shachar Lovett  Clicker frequency: CA

One-to-one, onto, bijective…

X Y

• Is the following function

A. One-to-one

B. Onto

C. Both (bijective)

D. None

Page 15: CSE 20 DISCRETE MATH Prof. Shachar Lovett  Clicker frequency: CA

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

Page 16: CSE 20 DISCRETE MATH Prof. Shachar Lovett  Clicker frequency: CA

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

Page 17: CSE 20 DISCRETE MATH Prof. Shachar Lovett  Clicker frequency: CA

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

Page 18: CSE 20 DISCRETE MATH Prof. Shachar Lovett  Clicker frequency: CA

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?

Page 19: CSE 20 DISCRETE MATH Prof. Shachar Lovett  Clicker frequency: CA

Inverses• Does the following function have an inverse:

A. Yes

B. No

Page 20: CSE 20 DISCRETE MATH Prof. Shachar Lovett  Clicker frequency: CA

Inverses• Does the following function have an inverse:

A. Yes

B. No

Page 21: CSE 20 DISCRETE MATH Prof. Shachar Lovett  Clicker frequency: CA

Inverses• Does the following function have an inverse:

A. Yes

B. No

Page 22: CSE 20 DISCRETE MATH Prof. Shachar Lovett  Clicker frequency: CA

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.

Page 23: CSE 20 DISCRETE MATH Prof. Shachar Lovett  Clicker frequency: CA

Next class• Proof techniques

• Read section 3.5 in Jenkyns, Stephenson