What is the average number of connected components in a Secret Santa graph? $n$ of my friends are involved in a Secret Santa gift exchange -- in order, each person is assigned to give some other random person a gift. Everyone is giving a gift to exactly one other person and receiving a gift from exactly one other person.
The situation can be represented by a directed graph on $n$ nodes, where there is an edge from $a \rightarrow b$ if $a$ is giving a gift to $b$.
A graph constructed this way must be a union of disjoint cycles. This year our graph seems to be one big cycle. I'm wondering: what is the expected number of disjoint cycles in such a graph?
How does it grow with $n$?
The (fascinating) answer to this question gives the number of ways to arrive at our situation (one big cycle) as $(n - 1)!$, and other answers (I think) discuss my question, but they seem conjectural. Is this a solved problem?
 A: Supposing that people do not give presents to themselves we obtain the
species
$$\mathfrak{P}(\mathcal{U}\mathfrak{C}_{=2}(\mathcal{Z})
+ \mathcal{U}\mathfrak{C}_{=3}(\mathcal{Z})
+ \mathcal{U}\mathfrak{C}_{=4}(\mathcal{Z})
+ \cdots)$$
Switching to  generating functions  we find the  generating function
$G(z, u)$ where
$$G(z, u) =
\exp\left(
u\frac{z^2}{2}
+ u\frac{z^3}{3}
+ u\frac{z^4}{4}
+ u\frac{z^5}{5}
+ \cdots
\right).$$
This is
$$G(z, u) = 
\exp
\left(-uz + u\log \frac{1}{1-z}\right).$$
Differentiate and  set $u=1$ for  the average number of  components to
get
$$\left.\frac{\partial}{\partial u} G(z,u)\right|_{u=1}
= \exp\left(-z+\log\frac{1}{1-z}\right)
\left(-z + \log\frac{1}{1-z}\right)
\\ = \frac{\exp(-z)}{1-z} 
\sum_{q\ge 2} \frac{z^q}{q}.$$ 
Extracting coefficients we obtain
$$[z^n] \frac{\exp(-z)}{1-z} 
\sum_{q=2}^n \frac{z^q}{q}.$$ 
The dominant  singularity is  at $z=1$ so  we get for  the coefficient
asymptotics and hence the number of cycles / connected components
$$\exp(-1) (H_n -1)
\sim \frac{1}{e} (\log n + \gamma - 1).$$
These data are from OEIS A162973.
Correction. As pointed out by @MichaelLugo this isn't quite right because I divided by $n!$ while the number of derangements is $n!/e.$
We thus obtain
$$\frac{n! (H_n-1)/e}{n!/e} = H_n-1\sim\log n + \gamma - 1.$$
