The other day I asked:
Eight people are seated at a circular table. Each person gets up and sits down again_either in the same chair or in the chair immediately to the left or right of the one they were in. How many different ways can the eight people be reseated?
So ... I know you've all been working on the problem ... want to know the answer? No, it's not 42, it's ... 49! Is that what you got?
Here's how I got it. Basically each person can either stay where they are or swap with the person next to them. If they don't stay where they are and don't swap, then you end up with an unused chair and someone who has no chair, and that's not allowed.
Let's first consider a table which is NOT round. Let's call N(x) the number of ways people can be reseated at such a table, where x is the total number of people and seats.
The first person can either stay where they are, or they can swap with their only neighbor. If they stay where they are, there are N(x1) remaining possibilities. If they swap, there are N(x2) remaining possibilities. That means N(x) = N(x1) + N(x2). This happens to be the Fibonacci sequence. Who knew Fibonacci was a waiter?
Next lets consider a table which IS round. Let's call R(x) the number of ways people can be reseated at such a table, where x is the total number of people and seats.
The first person either stays where they are, or they can swap with their left neighbor, or swap with their right neighbor. If they stay where they are, there are N(x1) remaining possibilities. (See what I did there?*) If they swap, there are N(x2) remaining possibilities*. They have two neighbors with whom they can swap. So R(x) = N(x1) + 2N(x2). Except ... with a round table there are two other possibilities, everyone can swap right, and everyone can swap left. So R(x) = N(x1) + 2N(x2) + 2.
Okay... now we can solve the problem:
N(1) = 1
N(2) = 2
N(3) = 1+2 = 3
N(4) = 2+3 = 5
N(5) = 3+5 = 8
N(6) = 5+8 = 13
N(7) = 8+13 = 21
R(8) = N(7) + 2N(6) + 2 = 21 + 2(13) + 2 = 49
Bon appetit!
* after the first person decides, the rest of the round table becomes "straight"
