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

Post on 23-Feb-2016

39 views 0 download

Tags:

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 of 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

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

Administrative• Grading of HW3:

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

– But look at the solutions posted before that!

3

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

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

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

Composition

What is wrong with ”

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

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

Proof of one-to-one

10

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

overhead

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

12

13

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

Inverse function if , then .

is also a bijection.

14overhead

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

16

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

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

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

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

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

See you Tuesday

• Good luck on exam!

22