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).

Respuesta :

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

[tex]R(n,k) = \dbinom nk \, !(n-k)[/tex]

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

[tex]!n = \left\lfloor \dfrac{n!+1}e \right\rfloor[/tex]

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

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

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

[tex]R(25,23) = \dbinom{25}{23} \, !(25-23) = 300\left\lfloor\dfrac{2!+1}e\right\rfloor = 300[/tex]

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

[tex]\dfrac{300}{25!} \approx \boxed{5.17\times10^{-22}}[/tex]

ACCESS MORE