How many functions $f : A \rightarrow A$ are there such that $f \circ f(1) = 2$

combinatoricsdiscrete mathematicsfunctions

Given $A = \{1,2,3,4,5\}$, how many functions $f : A \rightarrow A$ are there such that $f \circ f(1) = 2$?

The answer states $4 \times 5^3$, which is close to my answer, but not quite:

You would have $4$ choices for $f(1)$, as $f(1)$ would not be able to equal $1$.

Then you would have $5$ choices for $2, 3, 4, 5$.

So I thought the answer would be $4 \times 5^4$, not $4 \times 5^3$.

Also, given that I cannot answer this first part, I cant answer the next part which is asking for how many onto functions there are s.t. $f \circ f(1) = 2$.

Best Answer

There are $4$ choices for $f(1)$, one choice for $f(f(1))$, and five choices for each of the remaining $3$.

For part two, there are $3!$ choices for the remaining $3$.

Related Question