[Math] Probability of 2 students sitting next to each other

probability

I got this problem on my recent quiz that I couldn't for the life of me figure out how to solve.

There is a classroom with 5 rows and 7 seats per row. The class has 31 students, and exactly 2 of the students have the same birthday. If the students are assigned seats randomly, what is the probability that the students who share a birthday will sit next to each other in the same row?


I got $0.0645$ but the answer supposed to come out to be $0.05042$, according to my professor. Any help would be appreciated!

Best Answer

We can solve this using the law of total probability. The first student of the pair sits at one of the seats at the end of the rows with probability $2/7$. In this case, there is only one valid sit exists for the second student, resulting in probability $1/(35-1)$. The first student sits at an inner seat with probability $5/7$. In this case there are 2 valid options for the second student, which has probability $2/(35-1)$. So in total, the probability is $$ \frac 27\cdot\frac1{34}+\frac 57\cdot\frac2{34}=\frac{6}{119}=0.0504202. $$

Note that the number of students (so long as it is $\ge2$ and $\le35$) does not matter.

Related Question