99.7k views
6 votes
In a class of 25 students, we want to distribute their exam paper results.

What is the probability that only 2 students DO NOT get their exam paper. (23 get theirs and 2 are swapped).


1 Answer

11 votes

See the link in comments (or if it gets deleted, look up "partial derangement"). The number of ways in which exactly
k items from a pool of
n items can be rearranged such that only these
k items are in their original positions is


R(n,k) = \dbinom nk \, !(n-k)

where
!(n-k) is the so-called sub-factorial that satisfies the relation


!n = \left\lfloor \frac{n!+1}e \right\rfloor

and
\lfloor x \rfloor denotes the floor or greatest integer function of
x, i.e. the greatest integer smaller than or equal to
x.

There are 25! ways of handing back exams with no extra constraint.

There are
R(25,23) ways of handing back 23 exams to their original owners and 2 exams otherwise, and


R(25,23) = \dbinom{25}{23} \, !(25-23) = 300\left\lfloor\frac{2!+1}e\right\rfloor = 300

Then the probability of returning 23 exams correctly and 2 exams swapped is


(300)/(25!) \approx \boxed{5.17*10^(-22)}

User Bhuvesh
by
3.6k points