$\color{red}{Attempt} $
We start with $k=1$, $P(X=1)$ is the probability that one letter have been put in the correct envelope. Our sample space size is $n$ and since there is only one way that one letter must have been put into the correct envelope and the rest $n-1$ incorrectly and so we see that $P(X=1)= \dfrac{(n-1)!}{n}$, now for $P(X=2)$ it becomes more complicated, so far I know that ${n \choose 2}$ is the size of the sample space and now we want to count the number of ways in which 2 letters must have been put in the correct envelope. First, of all, the $n-2$ letters that have been put incorrectly we have to count them and we have $(n-2)!$ and then the 2 letters that are put correctly this is done in one way thus
$$ P(X=2) = \frac{(n-2)!}{{n \choose 2} }$$
so, in general, we have
$$ P(X=k) = \frac{(n-k)!}{n \choose k } $$
is this correct?