# Probability - Randomizing seats

Really basic probability question that I want answered,

There is a class room with 3 students and 3 seats. Each student selects a seat and sits on it. The next day, the instructor randomly picks a seat for each student. What is the probability that each student is assigned a different seat from the one they sat on yesterday? (i.e: Everyone is in a different seat).

The way I approached the problem was to find the probability of the students sitting in the same seat. If there are 3 students, A, B, C, and the instructor is assigning them to the seats one by one, then

P(A is assigned a different seat than yesterday) = 2/3

P(B is assigned a different seat than yesterday) = 1/2

P(C is assigned a different seat than yesterday) = 1

P(Everyone is assigned a different seat) = 2/3 * 1/2 * 1 = 1/3

Is this the correct way of doing this?

You have to be careful, because the parts aren't independent - certainly the probability that A gets a different seat is $\frac{1}{3}$. But there are two possibilities - either he gets B's seat (in which case B has a 100% chance of getting a different seat, and C has a 50% chance) or he get's C's seat (in which case B has a 50% chance of getting a different seat, while C has a 100% chance).

Now in this situation it still works, because you can choose to look at the person whose seat A didn't get, and you get the answer you've found. But for larger groups, this won't work - for example, with 4 people you can have it so that there's a loop of people sitting in each other's seats (e.g. A sits in B's seat, B sits in C's, C sits in D's and D sits in A's), or you can have it so that two pairs of people each swap seats (so A and B swap, and C and D swap), and a simple approach to the probability won't work.

In fact, there's a bit of a trick to calculating it, and the details are explained in the Wikipedia article on Derangement, which is what this is usually referred to as.

Your method fortuitously gives the correct value, but is not actually correct.   Student $A$ can be in the wrong seat by being in either seat B or C.   If A is in seat B then B may equally likely be in seat A or C, otherwise if A is in seat C then B may equally likely be in seat A or B.

\begin{align}\mathsf P(A\in\{B_0, C_0\}) &= 2/3\\ \mathsf P(B\in\{A_0,C_0\}\mid A\in\{B_0, C_0\}) &= {\mathsf P(B\in\{A_0,C_0\}\mid A\in\{B_0\})\mathsf P(A\in\{B_0\}\mid A\in\{B_0,C_0\}) \\ + \mathsf P(B\in\{A_0,C_0\}\mid A\in\{C_0\})\mathsf P(A\in\{C_0\}\mid A\in\{B_0,C_0\}) } \\ & = 1\cdot \tfrac 12+\tfrac 12\cdot \tfrac 12\\ & = \tfrac 34 \end{align}

And so on.

A simpler method:

There are several equally likely ways to arrange three students, of which, only some have no student in their original position.   Let us have a look.

$$\left\{\rm \underset\checkmark A\underset\checkmark B\underset\checkmark C, \underset\checkmark A\underset\times C\underset\times B, \underset\times B\underset\times A\underset\checkmark C, \underset\times B\underset\times C\underset\times A, \underset\times C\underset\times A\underset\times B, \underset\times C\underset\checkmark B\underset\times A\right\}$$