Q:

Calculating the number of injective functions

Let $[n] = \{1,2,…,n\}$. Suppose the number of injective functions from  $[5]$ to $[n]$ is $120$. What is  $n$?
My logic:
I thought that $n$ was $5!$ because when we map out the functions we get: $\{(5,1) , (5,2) ... (5,n)\}$. All of these are injective since no two distinct elements in the domain have the same image. Why is it not $5!$ in this case?
The other answer options are:
A) $6$
B) $4$
C) $5$

A:

To construct an injective function $[5]\to[n],$ we must pick $5$ distinct elements of $[n]$ to make up the range--there are $\binom{n}{5}$ ways to do so--and then we must assign each one to one of the $5$ elements of the domain--there are $5!$ ways to do so. Hence, the number of injective functions $[5]\to[n]$ is $$\binom{n}{5}\cdot 5!=\frac{n!}{(n-5)!5!}\cdot 5!=\frac{n!}{(n-5)!}=n(n-1)(n-2)(n-3)(n-4).$$
Thus, we need a way to write $120$ as the product of $5$ consecutive integers. Since $120=5!,$ then $n=5.$

