The Prisoner of Benda

"The Prisoner of Benda" is the ninety-eighth episode of Futurama, the tenth of the sixth production season and the seventh broadcast season. The Professor and Amy invents a machine that change the crews minds with eachother, but everything goes haywire and they can't change back.

The story
A revolutionary invention allows the crew members to exchange minds, but it goes haywire and it's up to Farnsworth and the Globetrotters to fix it.

How to solve the switching problem
Here’s an algorithm to sort out any situation.

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 Dr Wong'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) ↔ Dr Wong's body (receiving Dr Wong'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)

Trivia

 * This is the third episode of season 6 to use a cold opening (alongside "Rebirth" and "That Darn Katz!"). Cold openings were previously used most prominently in seasons 1 and 2.

Production
According to David X. Cohen, writer Ken Keeler penned a theorem (and proof thereof) based on group theory, then used it to explain a plot twist in this episode.

Writer Eric Rogers calls The Prisoner of Benda his favorite Futurama episode alongside "Jurassic Bark", "because it may be the epitome of what this series attempts to do every week: the perfect blend of science fiction and bust-a-gut humor".

Characters

 * Debut: Wash Bucket