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 are cleaning up a mind-switching machine that switches the crew members' minds, but everything goes haywire and they can't change back.

Act I: "We're just the people this Mind-Switcher was made for by us!"
Bender is watching the news, and finds out that Emperor Nikolai of the Robo-Hungarian Empire is visiting New New York in his yacht, the RMS Overkill. He plans on stealing the Emperor's crown, but he cannot get his co-workers to help him by doing specific jobs (Amy seducing the guards, Zoidberg cutting the alarm wire, and Fry taking the fall). Meanwhile, Amy and the Professor put the finishing touches on the Mind-Switcher. The Professor reveals that he had always wanted to live life to the extreme while he was young, and Amy reveals that she still has that demonic food lust from way back, despite having obtained an elegant figure since 2997. They decide to switch minds, so that the Professor could use Amy's young body to do extreme sports, and Amy could eat all she wants in the Professor's old body, since he was so thin. However, when they try to switch back into their normal bodies, they find out that the Mind-Switcher only works once with the same pair of people. They try to solve this problem by putting Farnsworth's mind in Bender's body, and Bender's mind in Amy's body. However, the Professor realizes that it wouldn't work, and Bender runs off with Amy's body to pull of the heist. Amy finds out that it is difficult to eat with an elderly digestive system, and she convinces Leela to switch bodies with her, so that Leela could get the Professor's senior discount at the movies. Fry is disgusted that Leela is in the Professor, and she claims that Fry is shallow, and had only loved her for her body. Meanwhile, Bender in Amy's body swims to Nikolai's yacht, where he ties up his guard and cousin Basil. However, he is then caught by Nikolai.

Act II: "A man could give her a toke of her own medicine."
Bender in Amy's body proves that he is a Bending robot to Nikolai and Basil. Nikolai reveals to Bender that he had always wanted to live the life of a normal person, without all the fame and fortune of an Emperor. Bender decides to use this to his advantage, by telling him that he could put his mind into his real Bending Unit body, and in exchange, Bender will live the life of an Emperor in Nikolai's body. The two of them go back to Planet Express where Bender finds out that the Professor, who was in Bender's body, ran off to join Circus Roboticus as a daredevil named "Nonchalanto". Needing a robot body for the Emperor to reside in, Bender switches minds with Wash Bucket, and then switches minds with Emperor Nikolai, so that Nikolai had Wash Bucket's body, and Bender had Nikolai's body. Meanwhile, Fry decides to get revenge on Leela by putting himself in a hideous body and prove that she is shallow too. He switches minds with Zoidberg so that now Fry has Zoidberg's body and Zoidberg has Fry's body. Nikolai in Wash Bucket's body thinks that Zoidberg in Fry's body is his human friend as Bender said, and Zoidberg pretends to be Fry so that he could have a companion. Fry in Zoidberg's body confronts Leela in the Professor's body. In order to prove that neither of them are shallow, they both decide to go on a date at Elzar's Fine Cuisine. Leela finds out that her body is getting ruined by Amy, who is making it obese by eating butter. Hermes Conrad agrees to switch bodies with her, so that Hermes would be in Leela's body. Meanwhile, Bender is enjoying life as an Emperor, but is shocked when Nikolai's fiancée Princess Flavia and Basil pull out guns and swords to assassinate him.

Act III: "This is for Big Bertha."
Fry in Zoidberg, and Leela in the Professor go for a meal at Elzar's, both trying to repulse the other as much as possible with their new bodies. They both try to prove to each other that they are not shallow by making out on the table at the restaurant, as Amy in Hermes' body, and many others, watch. Meanwhile, Fry's real body, occupied by Zoidberg, takes Nikolai in Wash Bucket's body to Fry and Bender's apartment, despite the fact that neither of them had ever been there. Zoidberg pulls out a stove which creates a gas leak. Nikolai asks Zoidberg to light his cigar and they blow up the apartment. As this is happening, Bender in Nikolai's body manages to get back to the mainland of New New York, with Basil and Flavia shooting at him from behind. He is chased into the United Nations building where Nikolai was supposed to give a speech. However, Basil runs in after him with a sword and attacks him on live television. Meanwhile, Wash Bucket in Amy's body finds Scruffy in his quarters and confesses her love to him. She wants the two of them to move to another city and live together, but Scruffy says no, because in the back of their minds they would know that it wouldn't be right. Professor Farnsworth, still in Bender at the Circus Roboticus, watches the fight at the UN on the TV Robot. He wants to help Bender, but cannot get there in time. A howitzer named Big Bertha volunteers to shoot him there, but is badly injured because of the size of Bender's body. The Professor lands on the United Nations building roof. With his own sword, he starts a swordfight with Bassor before he could do any harm to Bender in Nikolai. Meanwhile, the making out of Fry and Leela, in Zoidberg and the Professor, had moved back to Leela's place. After having sex, the two of them are surprised to see Bender's body fighting with Basil on TV. The Professor in Bender's body wins by opening his door and revealing twenty Robot Clowns, all wielding swords of their own, and they kill Basil. Later, at Planet Express, Bubblegum Tate and Sweet Clyde use math to find out a way to get everyone in their original bodies, as shown below. They use it and the episode ends with everyone back to normal and Bender realizing that he forgot the crown in Nikolai's compartment.

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".

The inversion
Keeler uses the method outlined in the proof to restore all minds to their respective bodies. Here are his transpositions. He 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)

However, this is not the least number of switches possible in this scenario. Because Fry and Zoidberg only switched with each other and no one else, and there is an odd number (1) of other switched groups of bodies, they could have been used as the two spare bodies, completing the restoration in only nine switches:


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

Had there been an even number of distinct switched groups, Fry's mind and Zoidberg's mind would have ended up back in the opposite bodies, and having already switched, they could not be switched back without two spare bodies. The solution given in the theorem works for all scenarios.

The proof


First let π be some k-cycle on [n] = {1 ... n} WLOG [without loss of generality] write: π = 1 2  ...  k  k+1  ... n    2  3  ...  1  k+1  ... n

Let  represent the transposition that switches the contents of a and b. By hypothesis π is generated by DISTINCT switches on [n]. Introduce two "new bodies" {x,y} and write π* = 1 2  ...  k  k+1  ... n x  y      2  3  ...  1  k+1  ... n x  y

For any i=1 ... k let σ be the (l-to-r) series of switches σ = (  ... ) (  ... ) () ()

Note each switch exchanges an element of [n] with one of {x,y} so they are all distinct from the switches within [n] that generated π and also from . By routine verification π* σ = 1 2  ... n x  y        1  2  ... n y  x

i. e. σ reverts the k-cycle and leaves x and y switched (without performing ).

NOW let π be an ARBITRARY permutation on [n]. It consists of disjoint (nontrivial) cycles and each can be inverted as above in sequence after which x and y can be switched if necessary via , as was desired.

Solution algorithm in plain English
Step 1: Have everybody who's messed up arrange themselves in circles, each facing the body their mind should land in (e.g., if Fry's mind is in Zoidberg's body, then the Zoidberg body should face the Fry body).

Step 2: Go get two "fresh" (as of yet never mind-swapped) people. Let's call them Helper A and Helper B.

Step 3: Fix the circles one by one as follows:

3.0) Start each time with Helper A and Helper B's minds in either their own or each other's bodies

3.1) Pick any circle of messed-up people you like and unwrap it into a line with whoever you like at the front

3.2) Swap the mind at the front of the line into Helper A's body

3.3) From back to front, have everybody in the line swap minds with Helper B's body in turn. (This moves each mind in the line, apart from the front one, forward into the right body)

3.4) Swap the mind in Helper A's body back where it belongs, into the body at the back of the line. Now the circle/line has been completely fixed. The one side effect is that for each time a circle is fixed, the Helpers' minds will switch places, but that's OK, see below

Step 4: At the very end, after all the circles have been fixed, mind-swap the two Helpers if necessary (i.e., in case there was originally an odd number of messed-up circles)

Note: This is not the exact algorithm used in the show. This algorithm sets i = 1 in the proof provided by the show, whereas you could actually set i to be any number from 1 to k. This algorithm also reverses the order of the final two switches in the provided proof. Explained simply, the provided proof's exact method for fixing any circle is this: Helper A could switch in turn back-to-front starting and stopping at any points in the circle, then Helper B would switch back-to-front through the remainder of the circle, Helper A would then switch with the first member of Helper B's arc, and Helper B would then switch with the first member of Helper A's arc.

Reception
In its original American broadcast, "The Prisoner of Benda" was viewed by an estimated 1.774 million households, down 150,000 viewers since A Clockwork Origin.

Allusions

 * The title of the episode and Bender's plot of posing as an emperor is a reference to the 1894 novel (as well as its numerous adaptions).
 * The title caption refers to, which is a black hole. If nothing can escape from a black hole, then clearly anything that happens in Cygnus X-1 will stay in Cygnus X-1.
 * Leela makes several mentions of movies, possibly the  series.
 * Bender in Amy's body convinces Emperor Nikolai that he is a robot by dancing 's famous.
 * In order to show that he is a robot, Bender, in Amy's body, tells Emperor Nikolai to ask him something only a robot would know. This is referred to as a Reverse Turing Test and is a reference to the, in which person tries to distinguish between a machine and a human by asking questions.
 * Hermes says that Amy (in the body of Leela) "makes look like normal Albert".
 * Big Bertha, a robot with a cannon stomach, is a reference to the German.
 * The idea of one-way-mind-swapping-machine is very similar to the one in the Season Two episode "Holiday". However, in that instance, the limitation related to consciousnesses rather than bodies.
 * The concept of a member of royalty temporarily switching lives with an ordinary person is similar to the story.
 * The UN Conference is portrayed as nightclub act in Vegas with the opening act delivered by "Peaches and Herzegovina" which is a play on both the name of Eastern European nation and American disco/soul duo "".
 * An occurrence of mind switching was seen in the original series in a third season episode called . James T. Kirk's body is forcefully taken by Dr. Janice Lester (a former lover of Kirk's) and Kirk is forced to use Lester's body to convince the crew members of the mind change. Among other issues, Lester's and Kirk's voices remain in their respective bodies, so swaying crew members' beliefs of the switch proves difficult.
 * Leela parodies the lyrics of the spoken intro of Sir Mix-a-Lot's "Baby got back" when she talks about her eye.

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.
 * This is the third animated TV show in which a character voiced by John DiMaggio switches bodies with someone and the voice moves with the character into the new body. The other two were the "Kim Possible" episode "Mind Games", which originally aired in 2002, with DiMaggio voicing Dr. Drakken and the "Penguins Of Madagascar" episode "Roger Doger", aired in 2009, with DiMaggio voicing Rico.
 * When Amy (in the Professor's body) is eating ribs, she says "I have died" in Cantonese.

Continuity

 * This is the third time Leela has shown concern about her eye, the previous being "The Cyber House Rules" and "Bender's Big Score".
 * Yet again Amy's childhood obesity is a theme, previously mentioned in episodes such as "Teenage Mutant Leela's Hurdles" and "Into the Wild Green Yonder".
 * Bender claims he is sixty percent storage space. A recurring joke is that someone claims Bender is a certain percent of something, with the total by now adding up to much more than 100%.
 * Fry seems to be excited by the idea of Leela's mind in Amy's body, a revisiting to the Fry-Amy relationship.
 * The Professor calls Bender's body invincible, though only a few episodes earlier ("Lethal Inspection") we found out that it wasn't.
 * Of course, in comparison to the Professor's old and decrepit body, he may be feeling like he is invincible in Bender's (as it can certainly stand up to much more punishment than his own 170+ -years-old body). It could simply be a matter of perception, not actual "invincibility".
 * If you remember, in "Rebirth", Bender was blown up by one of the Professor's doomsday devices. He also had 2 bombs detonate inside his compartment in "War Is the H-Word." Another display of the bending units durability is in "Bendless Love", Flexo was crushed under an unbendable girder and later stated that if he had remained crushed he would have died in hundreds of years, proving that the bending units are very near invincible. The only known way being via his self-destruct button which is located on his body as revealed in "A Head in the Polls" or the destruct code revealed in "Where No Fan Has Gone Before".
 * The episode brings a big step in the Fry-Leela relationship, as they have sex for the first time known, though it should be noted that neither is in their own body at the time.
 * This is the first time the two have had intercourse in canon, but in "Anthology of Interest I", during the simulation "Dial L For Leela", Leela was forced to keep Fry silent about the recent murders she committed by having sex with Fry, while in their own bodies. However, "Anthology Of Interest I" can't be regarded as canon as it was during a "what-if" scenario.
 * In "Time Keeps on Slippin'" Fry and Leela married and divorced.
 * The Professor is shown using a mind-switching device back in Bender's Game, but since he is seen here as having just completed it, he must have still been testing it (and subsequently killing monkeys) back then.
 * In "Bendless Love" Bender claims to remember his own birth, having been built "four years ago" in 2998. Later in "Lethal Inspection"; a very different construction of Bender is remembered by Hermes, although no year is given Hermes looks like he did at the 2980 Olympics. This episode shows that Hermes, having gained weight and cut his hair, was employed at Planet Express and was employee of the year in 2993, 2994, 2996 and 2998. Bender also confirmed not remembering seeing Hermes as Inspector #5. Therefore we can conclude that the events of "Lethal Inspection" occurred prior to 2993 or early in that year, Bender does not remember his real birth and Bending Units of his model were, for reasons unknown, built in two or more phases with core components, such as the backup unit, being retained during an upgrade to a larger and possibly more specialised body.
 * Amy is shown as Planet Express Employee of The Year in 2992 and 2997, but she has only been the Professor's intern since 2998.
 * Amy could have been working as a different employee for him before becoming his intern.
 * Someone in the crowd shouts, "I LOVE YOU, YOUR MAJESTY!!!" Bender, in the Emperor's body, replies, "Shut up, Madame Ambassador, I know it." This is a callback to a similar gag in "Put Your Head on My Shoulder".
 * Bender says that he has always dreamed of becoming an Emperor. This may explain why he dressed up himself as in "Insane in the Mainframe".

Goofs

 * Fry and Bender's apartment looks much different from earlier appearances (as in "The Late Philip J. Fry"). While previously being a small apartment (Bender's room) with a giant sideroom (Fry's), it now does not have the small apartment and it includes a kitchen. (The kitchen had been seen previously, such as in Bender's Game.)
 * It could have been rebuilt.
 * Zoidberg was in Fry's body at the time he entered the apartment and had no idea where he was going. He could have chosen the wrong one.
 * The room number is 00100100, which means $, the correct room. It's not likely Zoidberg knew this. It could be a joke referring to his poorness.
 * Leela's building had been destroyed by the alien scammers in Bender's Big Score to make room for a Panda preserve.
 * Obviously, it was rebuilt.
 * When Bertha is wheeling away after the first time the Professor, in Bender's body, propositions switching to a younger body, only one of her wheels are actually the turning, the one furthest from the viewer is stationary even while the other is not.
 * It was established in the episode "Why Must I Be a Crustacean in Love" that, once a male Decapodian releases his male jelly, he dies. However, in this episode, Fry, who was in Zoidberg's body, wound up having intercourse with Leela, who was in the Professor's body, and did not die.
 * It could be that, to die, a Decapodian needs to mate with another Decapodian.
 * It could be that, Leela was keen to use her new appendage, therefore it would be Farnsworth's male jelly, not Zoidberg's, that was released.
 * Mating and having sex are not necessarily the same thing for all species. The releasing of male jelly might be voluntary.
 * Zoidberg's male jelly may only be produced during his mating season. Making it so that there was nothing to release. As for the male jelly in "Why Must I Be a Crustacean in Love", his body probably broke it down and reabsorbed it as in nature.
 * After everyone swaps back into their original bodies, Hermes is as fat as usual.
 * Given how abnormally fast he lost the weight originally, he could have gained it back just as fast.

Characters

 * 21st Century Girl
 * Amy
 * Debut: Basil
 * Debut: Big Bertha
 * Debut: Chainsaw-Eating Robot
 * Bender
 * 'Sweet' Clyde Dixon
 * Ethan 'Bubblegum' Tate
 * Fry
 * Hermes
 * "Fishy" Joseph Gilman
 * Debut: Japanese UN Diplomat
 * Leela
 * Linda
 * Morbo
 * Debut: Emperor Nikolai
 * Debut: Flavia
 * Professor Farnsworth
 * Richard Nixon's head
 * Debut: Robot Acrobat
 * Debut: Robot Clowns
 * Scruffy
 * Debut: TV Robot
 * Debut: Wash Bucket
 * Zoidberg