How many fixed points in a permutation

I believe these are called Rencontres Numbers (the number of permutations with exactly $k$ fixed points). These are also called Partial Derangements, I believe.

The wiki page I linked to gives you a recursive/generating function approach I believe (which I suppose could possibly be the conditional probability approach you mention).

Hope that helps.


The paper "Matchings, Derangements, Rencontres," by Hanson, Seyffarth, and Weston, has a nice discussion of the rencontre and related problems, including a generalization of the rencontre problem. They also prove an interesting recursive formula not given in the Wikipedia page linked to in Moron's answer:

$$D_{n,k} = n D_{n-1,k} + (-1)^{n-k} \binom{n}{k}.$$

This, of course, contains the famous derangement recurrence as a special case:

$$D_n = n D_{n-1} + (-1)^n,$$ where $D_n$ is the number of derangements (no fixed points) on $n$ elements.