# Find probability of each student getting a different room from what he previously had

There are 20 students living in a hostel with one room per student. They all decide to change their rooms by lottery method. 20 pieces of paper with room numbers written on them are randomly selected by all of the 20 students. What's the probability that each student has got a room different from what he previously had?

## 1 Answer

Total arrangements possible with $20$ students is

$20!$

To find number of ways in which the favorable outcomes occur, use concepts of Derangements. Number of ways for this is

$20!\left(1-\dfrac{1}{1!}+\dfrac{1}{2!}+\cdots+\dfrac{1}{20!}\right)$

So, probability is

$1-\dfrac{1}{1!}+\dfrac{1}{2!}+\cdots+\dfrac{1}{20!}$