TITLE: Secret Santa (expected no of cycles in a random permutation)
QUESTION [11 upvotes]: In a Secret Santa game, each of $n$ players puts their name into a hat and then each player picks a name from the hat, who they buy a Christmas present for. Obviously, if someone picks their own name then they put it back and draw again (if they're the only person remaining in the hat then everyone heaves an exasperated sigh, and you start again).
My question: how many loops of present-giving do you expect to see? (e.g. A -> B -> C -> A)
More mathematically: what is the expected number of cycles in a random $n$-permutation which contains no fixed points?
The twelve-fold way doesn't appear to answer this question. Some brief Monte Carlo suggests that the limiting answer as $n\to\infty$ is $c\log n$ for some constant $c\approx 0.95$ (see attached graph, where circles are Monte Carlo approximation, straight line is $\log n$) but I'd like to see an analytical argument for this.
alt text http://www.freeimagehosting.net/uploads/330281fbea.png

REPLY [5 votes]: I want to elaborate on and correct a comment that I made.
The two questions are not the same. The Secret-Santa-game method used to choose a derangement is not uniform on derangements. For $n=4$, you get the following:
$P[\text{Restart}] = 5/36$
$P[(12)(34)] = 1/9$
$P[(13)(24)] =1/12$
$P[(14)(23)]=1/12$
$P[(1234)]=1/18$
$P[(1243)]=1/9$
$P[(1324)]=1/12$
$P[(1342)]=1/12$
$P[(1423)]=1/12$
$P[(1432)]=1/6$
If you simulate this, the chance of two transpositions is $36/31(1/9+1/12+1/12)= 10/31$ rather than $1/3$, and the average number of cycles should be about $41/31$ instead of $4/3$. I suspect that this makes no difference to the asymptotics, and that no one will care about the nonuniform method's exact answer.