1
$\begingroup$

There are $n$ balls numbered $1, 2, \dots, n$, and $n$ bins numbered $1, 2, \dots, n$. The balls are placed randomly into the bins such that there is one ball per bin. For $k = 0, 1, 2, \dots, n$, what is the probability that exactly $k$ balls are placed into the bin with the matching number?

  • 2
    The keyword you are looking for is "derangements".2017-01-24

1 Answers 1

1

Number of ways $n$ balls can be placed into the $n$ bins
$=n!$

Number of ways $n$ balls can be placed into the $n$ bins where k balls are placed into the bin with the matching number
$\dbinom{n}{k}(n-k)!\left(1-\dfrac{1}{1!}+\dfrac{1}{2!}-\dfrac{1}{3!}+\cdots+(-1)^n\dfrac{1}{n-k!}\right)$

Probability $=\dfrac{\dbinom{n}{k}(n-k)!\left(1-\dfrac{1}{1!}+\dfrac{1}{2!}-\dfrac{1}{3!}+\cdots+(-1)^n\dfrac{1}{n-k!}\right)}{n!}$