How many fixed points in a permutation
Suppose we have a collection of n objects, numbered from 1 to n. These objects are placed in a random order.
What is the probability that p of the objects are in the position in the order corresponding to their order.
For n=3, 1-2-3 has all objects in the correct position, p = 3, and has probability P(p=3) = 1/3! = 1/6.
However P(p=2) = 0
P(p=1) = 3/3! = 1/2. (1-3-2, 3-2-1, 2-1-3)
P(p=0) = 2/3!. (2-3-1, 3-1-2)