functions: compositions, one-to-one , b ijections , pigeonhole principle and permutations

22
Functions: Compositions, one-to-one, bijections, pigeonhole principle and permutations Discrete Structures (CS 173) Madhusudan Parthasarathy, University of Illinois Autumn Van Gogh

Upload: heath

Post on 23-Feb-2016

41 views

Category:

Documents


0 download

DESCRIPTION

Functions: Compositions, one-to-one , b ijections , pigeonhole principle and permutations. Autumn Van Gogh. Discrete Structures (CS 173) Madhusudan Parthasarathy, University of Illinois. Administrative. Exam on Tuesday Review materials available online - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Functions:  Compositions, one-to-one ,  b ijections , pigeonhole principle and permutations

Functions: Compositions, one-to-one, bijections, pigeonhole principle and permutations

Discrete Structures (CS 173)Madhusudan Parthasarathy, University of Illinois

AutumnVan Gogh

Page 2: Functions:  Compositions, one-to-one ,  b ijections , pigeonhole principle and permutations

Administrative• Exam on Tuesday

• Review materials available online– Read them and prepare questions for discussion

section tomorrow

• Henry Lin: review session 6-8 pm on Saturday at 2406 Siebel

• See Piazza post about office hours next week (all on Monday!)

2

Page 3: Functions:  Compositions, one-to-one ,  b ijections , pigeonhole principle and permutations

Administrative• Grading of HW3:

– TAs and graders are working to get these graded by Monday.

– But look at the solutions posted before that!

3

Page 4: Functions:  Compositions, one-to-one ,  b ijections , pigeonhole principle and permutations

Feedback from TAs

• READ THE SOLUTIONS!!

• The homework proofs were graded very leniently. But things will get harder soon.

• So please look at the solutions. That’s what we really expect in homeworks and exams.

4

Page 5: Functions:  Compositions, one-to-one ,  b ijections , pigeonhole principle and permutations

Last class: functions• A function must have a type signature and a mapping

• A function must have exactly one output for each input (any number of inputs can be assigned the same output)

• For two functions to be equal, both the type signature and the assignment must be the same

• A function is onto iff every output element is assigned at least once.

5

𝑓 : 𝐴→𝐵 such that 𝑓 (𝑥 )=…domain co-domain

Page 6: Functions:  Compositions, one-to-one ,  b ijections , pigeonhole principle and permutations

Today’s class: more with functions• Composing functions

• When is a function “one-to-one” or “bijective”?

• What is the inverse of a function?

• The Pigeonhole principle

• Permutations and their applications

6

Page 7: Functions:  Compositions, one-to-one ,  b ijections , pigeonhole principle and permutations

Composition

What is wrong with ”

Page 8: Functions:  Compositions, one-to-one ,  b ijections , pigeonhole principle and permutations

Proof with compositionClaim: For sets , if are onto, then is also onto. Definition: is onto iff

Page 9: Functions:  Compositions, one-to-one ,  b ijections , pigeonhole principle and permutations

One-to-one is a preimage of if . One-to-one: no two inputs map to the same output (no output has more than one preimage)

contrapositive?

9overhead

Page 10: Functions:  Compositions, one-to-one ,  b ijections , pigeonhole principle and permutations

Proof of one-to-one

10

Claim: is one-to-one. Definition: is one-to-one iff

overhead

Page 11: Functions:  Compositions, one-to-one ,  b ijections , pigeonhole principle and permutations

Proof that one-to-one is compositional

11

Claim: For any sets and functions , if and are one-to-one, then is also one-to-one.Definition: is one-to-one iff

Page 12: Functions:  Compositions, one-to-one ,  b ijections , pigeonhole principle and permutations

12

Page 13: Functions:  Compositions, one-to-one ,  b ijections , pigeonhole principle and permutations

13

Page 14: Functions:  Compositions, one-to-one ,  b ijections , pigeonhole principle and permutations

Bijection and inversionA function is bijective if it is onto and one-to-one.

Inverse function if , then .

is also a bijection.

14overhead

Page 15: Functions:  Compositions, one-to-one ,  b ijections , pigeonhole principle and permutations

Pigeonhole principlePigeonhole principle: if you put n objects into r holes, and r<n, then at least one hole must contain at least two objects!

This class has ~400 students. Is every day someone’s birthday? Do two students have the same birthday?

Claim: The first 50 powers of 13 include at least two numbers whose difference is a multiple of 47.

Claim: Suppose people are at a party and everyone has at least one admirer. At least two people will have the same number of admirers.

15

Page 16: Functions:  Compositions, one-to-one ,  b ijections , pigeonhole principle and permutations

16

Page 17: Functions:  Compositions, one-to-one ,  b ijections , pigeonhole principle and permutations

Proof with bijective

17

Claim: If A is finite and is bijective, then Definition: is one-to-one iff every output is assigned at most onceDefinition: is onto iff every output is assigned at least once

Page 18: Functions:  Compositions, one-to-one ,  b ijections , pigeonhole principle and permutations

Proof with one-to-one

18

Let A, B be subsets of reals.Claim: Any strictly increasing function from A to B is one-to-one.Definition: is one-to-one iff Definition: is strictly increasing iff

overhead

Page 19: Functions:  Compositions, one-to-one ,  b ijections , pigeonhole principle and permutations

PermutationsOrdered selection Suppose I have 6 gems, and you get to choose 1. How many different combinations of gems can you choose?

Suppose I have gems and want to put them in a row from left to right. How many different ways can I arrange them?

Suppose I have 6 gems and want to put three of them in a row from left to right. How many different ways can I arrange them?

Unordered selectionSuppose I have 6 gems, and you get to choose 2. How many different combinations of gems can you choose?

Suppose I have gems, and you choose . How many combinations?

19

Page 20: Functions:  Compositions, one-to-one ,  b ijections , pigeonhole principle and permutations

Permutations

Suppose with and . How many different one-to-one functions can I create?

How many ways can I rearrange the letters in “nan”?

How many ways can I rearrange the letters in “yellowbelly”?

20

Page 21: Functions:  Compositions, one-to-one ,  b ijections , pigeonhole principle and permutations

Things to remember

• One-to-one: no two inputs are assigned to the same output

• Bijection: one-to-one and onto

• Pigeonhole principle: if you have more objects than labels, some objects must get the same label

21

Page 22: Functions:  Compositions, one-to-one ,  b ijections , pigeonhole principle and permutations

See you Tuesday

• Good luck on exam!

22