User:Sandra

How to solve the switching problem
1. First, make sure you have a buddy that you’ve never switched with, and that neither of you have switched with anybody in the group of mess-ups.

2. Make that buddy sit on the sidelines.

3. Start by switching with anyone. (In the example situation given in this episode, switch with Zoidberg into Fry’s body, for example.)

4. Switch with the one who has a mind that matches the body you’re in. Repeat until you reach the end of the closed loop. (After switching with Fry so he gets his body back, you’ll be at the end of that loop since you can’t switch with Zoidberg again.) If that wasn’t the last closed loop (i.e. is there anyone left that you’re allowed to switch with, but who aren’t in their original body?), switch with anyone of those, then repeat this step again. (In this case, there are plenty. Say you’ll switch with the professor. You’ll have Bender’s body, so switch with him. Then you’ll have the Emperor’s body, so switch with Washbucket, and so on.) When you can’t switch no more, you’ll have one closed loop left of N players, in a neat chain. (N is one from each closed loop, plus you. If you picked the same examples as above, you’d have the professor in Zoidberg’s body, you in the professor’s body and Zoidberg in your body.)

5. Bring your buddy in to switch with everyone going through that last chain in the same way you did in step four (starting with anyone). You’ll end up neatly sorted.

The total number of switches needed with this algorithm will be [number of original messed-up people] + [number of closed loops] + 2. That would be thirteen in this case since Fry and Zoidberg were in one closed loop, the others in another, and they were nine people total.

Keeler doesn’t use the sit-on-the-sidelines–idea, he brings in both Bubblegum Tate and Sweet Clyde in parallel, and he also makes it so that they don’t have to switch directly with each other—anyone have his algorithm, or did he use brute force? Here are his results. He also uses thirteen switches total.


 * Fry's body (receiving Sweet Clyde's mind) ↔ Sweet Clyde's body (receiving Dr Zoidberg's mind)
 * Dr Zoidberg's body (receiving Bubblegum Tate's mind) ↔ Bubblegum Tate's body (receiving Fry's mind)
 * Sweet Clyde's body (receiving Bubblegum Tate's mind) ↔ Dr Zoidberg's body (receiving Dr Zoidberg's mind)
 * Bubblegum Tate's body (receiving Sweet Clyde's mind) ↔ Fry's body (receiving Fry's mind)
 * Professor Farnsworth's body (receiving Bubblegum Tate's mind) ↔ Sweet Clyde's body (receiving Leela's mind)
 * Washbucket's body (receiving Sweet Clyde's mind) ↔ Bubblegum Tate's body (receiving The Emperor's mind)
 * Sweet Clyde's body (receiving Hermes's mind) ↔ Leela's body (receiving Leela's mind)
 * Bubblegum Tate's body (receiving Bender's mind) ↔ The Emperor's body (receiving The Emperor's mind)
 * Hermes's body (receiving Hermes's mind) ↔ Sweet Clyde's body (receiving Amy's mind)
 * Bender's body (receiving Bender's mind) ↔ Bubblegum Tate's body (receiving Professor Farnsworth's mind)
 * Sweet Clyde's body (receiving Washbucket's mind) ↔ Amy's body (receiving Amy's mind)
 * Bubblegum Tate's body (receiving Bubblegum Tate's mind) ↔ Professor Farnsworth's body (receiving Professor Farnsworth's mind)
 * Washbucket's body (receiving Washbucket's mind) ↔ Sweet Clyde's body (receiving Sweet Clyde's mind)