Functions
Warm-upHumanLet and . Which of these rules is a function from to ?
Let and . Which of these rules is a function from to ?
How many functions are there from a set with elements to a set with elements?
How many injective functions are there from a 2-element set to a 4-element set?
Which of these functions are surjective? (Choose all that apply.)
A school has 400 students. Why must at least two of them share a birthday (day and month)?
A finite function can be stored as a Python dictionary, e.g. {1: 'a', 2: 'b', 3: 'a'}. Write is_injective(f) returning True exactly when no two keys have the same value.