How many functions under these conditions? So in my new discrete mathematics class, I had the following exercise.
Let $\Bbb{S} = \{1,2,3,4,5,6\}$. How many functions $f : S → S$ can we find such that
a)$  \;\; \forall y \in \Bbb{S}  $  there is $ \;\;\ x \in \Bbb{S} $ such that $f(x)=y$
b)$  \;\; \forall y \in $ {2,4,6}    there are two $ \;\;\ x \in \Bbb{S} $ such that $f(x)=y$
b)$  \;\; \forall y \in $ {3,6}    there are three $ \;\;\ x \in \Bbb{S} $ such that $f(x)=y$
I think the first one is $6!$ since it's asking us for one to one functions, but what are some hints to follow on the next ones?

For the second question, note that if there are two inputs mapping to each of 2, 4 and 6, then there are no inputs that map to 1, 3 or 5. So in other words, how many ways can you allocate two inputs to 2, two inputs to 4 and two inputs to 6? (Alternatively, how can you pick two elements of the set to map to 2, then pick two elements from the remainder to map to 4, and then pick two from the remainder of that to map to 6?)
The third question is the same thing, but with mapping 3 inputs to each of 2 outputs.
