TITLE: What's the probability that a given permutation has exactly $k$ fixed points.
QUESTION [16 upvotes]: Given a random permutation $\sigma \in S_n$ from $[n] \to [n]$ in a uniform probability space, what is the probability that $\sigma $ has exactly $k$ fixed points for a given $k$ between $1$ and $n$?
In other words: what is the probability that $\exists x_1 ,...,x_k \in [n] : \sigma (x_i) = x_i  $ for $\ i\in \{1,...,k\}$ and for every $y \notin \{x_1 , ... , x_k\}$ we get $\sigma(y) \neq y$.
I saw that $\lim_{n \to \infty } prob(A_0) = e^{-1}$ using Inclusion–exclusion principle and i belive that for a given k : $\lim_{n \to \infty} prob(A_k) = \frac{e^{-1}}{k!}$ but I am not sure how to show it.
*$A_k$ stands for the event "k".

REPLY [6 votes]: By  way  of   enrichment  here  is  an   alternate  formulation  using
combinatorial classes.   The class  of permutations with  fixed points
marked is
$$\def\textsc#1{\dosc#1\csod}
\def\dosc#1#2\csod{{\rm #1{\small #2}}}
\textsc{SET}(\mathcal{U} \times
\textsc{CYC}_{=1}(\mathcal{Z}) +
\textsc{CYC}_{=2}(\mathcal{Z}) +
\textsc{CYC}_{=3}(\mathcal{Z}) +
\cdots).$$
This gives the generating function
$$G(z, u) =
\exp\left(uz + \frac{z^2}{2} +
\frac{z^3}{3} +
\frac{z^4}{4} +
\frac{z^5}{5} + \cdots\right)$$
which is
$$G(z, u) =
\exp\left(uz-z+\log\frac{1}{1-z}\right)
= \frac{\exp(uz-z)}{1-z}.$$
Now for $k$ fixed points we get
$$[u^k] \frac{\exp(uz-z)}{1-z}
= [u^k] \frac{\exp(uz)\exp(-z)}{1-z}
= \frac{z^k}{k!} \frac{\exp(-z)}{1-z}.$$
This is the  EGF of permutations having $k$ fixed  points.  We extract
the count by computing (the factor $n!$ is canceled because we require
the average)
$$[z^n] \frac{z^k}{k!} \frac{\exp(-z)}{1-z}
= \frac{1}{k!} [z^{n-k}] \frac{\exp(-z)}{1-z}.$$
We find
$$\bbox[5px,border:2px solid #00A000]{
\frac{1}{k!} \sum_{q=0}^{n-k} \frac{(-1)^q}{q!}.}$$
We can identify this as choosing the $k$ fixed points and combining
them with a derangement of the rest:
$$\frac{1}{n!} {n\choose k} (n-k)!
\sum_{q=0}^{n-k} \frac{(-1)^q}{q!}$$
which is the combinatorial class
$$\textsc{SET}_{=k}(\mathcal{Z}) \times
\textsc{SET}(\textsc{CYC}_{\ge 2}(\mathcal{Z})).$$