functions and onto
DESCRIPTION
Functions and Onto. Boats with Sand Van Gogh. Discrete Structures (CS 173) Madhusudan Parthasarathy , University of Illinois. Administrative. Midter m-1 Exam next Tuesday in class Materials to help you prepare: Skills list: detailed list of things you could be tested on - PowerPoint PPT PresentationTRANSCRIPT
![Page 1: Functions and Onto](https://reader035.vdocument.in/reader035/viewer/2022062323/56816267550346895dd2d2b7/html5/thumbnails/1.jpg)
Functions and Onto
Discrete Structures (CS 173)Madhusudan Parthasarathy, University of Illinois
Boats with SandVan Gogh
1
![Page 2: Functions and Onto](https://reader035.vdocument.in/reader035/viewer/2022062323/56816267550346895dd2d2b7/html5/thumbnails/2.jpg)
Administrative
• Midterm-1 Exam next Tuesday in class
• Materials to help you prepare:– Skills list: detailed list of things you could be tested on– Mock midterm exam with solutions– Review notes
(concise notes of things you have learnt so far)
• Honors homework available online
• Some office hours next week will be moved from Tues/Wed to Sun/Mon– will post times on piazza
![Page 3: Functions and Onto](https://reader035.vdocument.in/reader035/viewer/2022062323/56816267550346895dd2d2b7/html5/thumbnails/3.jpg)
Last class: relations
Reflexive
Symmetric
Transitive
Irreflexive, Antisymmetric
Not Transitive
Vacuous truth
![Page 4: Functions and Onto](https://reader035.vdocument.in/reader035/viewer/2022062323/56816267550346895dd2d2b7/html5/thumbnails/4.jpg)
Today’s class: functions
• What is a function, and what is not?
• Identify which functions are “onto”
• Nested quantifiers– Mixing “for all” and “there exists”
• Composing functions
4
![Page 5: Functions and Onto](https://reader035.vdocument.in/reader035/viewer/2022062323/56816267550346895dd2d2b7/html5/thumbnails/5.jpg)
What is a function?
Function: maps each input element to exactly one output element
Every function has1) a type signature that defines what inputs and outputs
are possible2) an assignment or mapping that specifies which output
goes with each input
𝑓 : 𝐴→𝐵 such that 𝑓 (𝑥 )=…domain co-domain
![Page 6: Functions and Onto](https://reader035.vdocument.in/reader035/viewer/2022062323/56816267550346895dd2d2b7/html5/thumbnails/6.jpg)
Examples of functionsConcepts: type signature, mapping; bubbles, plotsFunctions: age, t-shirt color,
![Page 7: Functions and Onto](https://reader035.vdocument.in/reader035/viewer/2022062323/56816267550346895dd2d2b7/html5/thumbnails/7.jpg)
What is not a function?Not a valid function if1. No type signature2. Some input is not mapped to an output3. Some input is mapped to two outputs
![Page 8: Functions and Onto](https://reader035.vdocument.in/reader035/viewer/2022062323/56816267550346895dd2d2b7/html5/thumbnails/8.jpg)
When are functions equal?Functions are equal if 1. They have the same type signature2. The mapping is the same
Equal functions may not necessarily have the same description/closed form!
![Page 9: Functions and Onto](https://reader035.vdocument.in/reader035/viewer/2022062323/56816267550346895dd2d2b7/html5/thumbnails/9.jpg)
Ontoimage: set of values produced when a function is applied to all inputs
onto: the image is the co-domain (every possible output is assigned to at least one input)
𝑓 : 𝐴→𝐵 ,∀ 𝑦∈𝐵 ,∃𝑥∈𝐴 , such that 𝑓 (𝑥 )=𝑦
![Page 10: Functions and Onto](https://reader035.vdocument.in/reader035/viewer/2022062323/56816267550346895dd2d2b7/html5/thumbnails/10.jpg)
Proof of ontoClaim: is onto. Definition: is onto iff
![Page 11: Functions and Onto](https://reader035.vdocument.in/reader035/viewer/2022062323/56816267550346895dd2d2b7/html5/thumbnails/11.jpg)
Proof of ontoClaim: is onto. Definition: is onto iff
![Page 12: Functions and Onto](https://reader035.vdocument.in/reader035/viewer/2022062323/56816267550346895dd2d2b7/html5/thumbnails/12.jpg)
Onto functions to a finite set• Let f: A -> B and B have n elements.• How many elements can A have?
- Less than n?- Equal to n?
- Greater than n but finite? - Infinite?
![Page 13: Functions and Onto](https://reader035.vdocument.in/reader035/viewer/2022062323/56816267550346895dd2d2b7/html5/thumbnails/13.jpg)
Can there be an onto function from to ?!
if x is odd
0 -> 0 1->-1 2->1 3-> -2 4-> 2 …
![Page 14: Functions and Onto](https://reader035.vdocument.in/reader035/viewer/2022062323/56816267550346895dd2d2b7/html5/thumbnails/14.jpg)
Nested quantifiersThere is a pencil for every student.
Every student is using the same pencil.
For a function , every output element is assigned to at least one input element.
For a function , there is one output that is assigned to every input.
![Page 15: Functions and Onto](https://reader035.vdocument.in/reader035/viewer/2022062323/56816267550346895dd2d2b7/html5/thumbnails/15.jpg)
Nested quantifiersThere exists an such that for every ,
There exists an such that for every ,
For every there exists a , such that
For every there exists a , such that
![Page 16: Functions and Onto](https://reader035.vdocument.in/reader035/viewer/2022062323/56816267550346895dd2d2b7/html5/thumbnails/16.jpg)
Negation with nested quantifiersIt’s not true that there is a pencil for every student.
No student has any pencil.
There is one pencil that no student has.
onto:
not onto:
![Page 17: Functions and Onto](https://reader035.vdocument.in/reader035/viewer/2022062323/56816267550346895dd2d2b7/html5/thumbnails/17.jpg)
Disproof of ontoDisprove: is onto. Definition: is onto iff
![Page 18: Functions and Onto](https://reader035.vdocument.in/reader035/viewer/2022062323/56816267550346895dd2d2b7/html5/thumbnails/18.jpg)
Composition
What is wrong with ”
![Page 19: Functions and Onto](https://reader035.vdocument.in/reader035/viewer/2022062323/56816267550346895dd2d2b7/html5/thumbnails/19.jpg)
Proof with compositionClaim: For sets , if are onto, then is also onto. Definition: is onto iff
![Page 20: Functions and Onto](https://reader035.vdocument.in/reader035/viewer/2022062323/56816267550346895dd2d2b7/html5/thumbnails/20.jpg)
Things to remember
• A function must have a type signature and a mapping
• A valid function must have exactly one output for each input (two 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.
• With proofs remember: First, take time to understand the hypothesis and conclusionThen, translate into a clear mathematical expression.Then, work backwards and forwards to make hypothesis reach conclusion.Finally, write it all out in logical order from hypothesis to conclusion.
![Page 21: Functions and Onto](https://reader035.vdocument.in/reader035/viewer/2022062323/56816267550346895dd2d2b7/html5/thumbnails/21.jpg)
See you Thursday!
• One-to-one functions, bijection, permutation