220 likes | 384 Views
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
E N D
Functions: Compositions, one-to-one, bijections, pigeonhole principle and permutations AutumnVan Gogh Discrete Structures (CS 173) Madhusudan Parthasarathy, University of Illinois
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!)
Administrative • Grading of HW3: • TAs and graders are working to get these graded by Monday. • But look at the solutions posted before that!
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.
Last class: functions • A function must have a type signature and a mapping • A functionmust 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 ontoiffevery output element is assigned at least once. co-domain 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
Composition What is wrong with ”
Proof with composition Claim: For sets , if are onto, then is also onto. Definition: is onto iff
One-to-one is a preimageof if . One-to-one: no two inputs map to the same output (no output has more than one preimage) contrapositive? overhead
Proof of one-to-one Claim: is one-to-one. Definition: is one-to-one iff overhead
Proof that one-to-one is compositional Claim: For any sets and functions , if and are one-to-one, then is also one-to-one. Definition: is one-to-one iff
Bijection and inversion A function is bijectiveif it is onto and one-to-one. Inverse function if , then. is also a bijection. overhead
Pigeonhole principle Pigeonhole 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.
Proof with bijective Claim: If A is finite and is bijective, then Definition: is one-to-oneiff every output is assigned at most once Definition: is ontoiffevery output is assigned at least once
Proof with one-to-one Let A, B be subsets of reals. Claim: Any strictly increasing function from A to B is one-to-one. Definition: is one-to-oneiff Definition: is strictly increasingiff overhead
Permutations Ordered 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 selection Suppose 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?
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”?
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
See you Tuesday • Good luck on exam!