This article is from Positive proofour friendly math newsletter that’s delivered to your inbox every Tuesday afternoon. Register today and read it first.
Corny jokes are no longer rare on television. As I wrote a few weeks ago, even The Simpsons full of math problems. But Futurama took nerd humor to the extreme. Consider the episode “The Prisoner of Benda.” Its author, Ken Keeler, had to formulate an original mathematical proof to solve an important plot problem.
On supporting science journalism
If you enjoy this article, please consider supporting our award-winning journalism by subscribe. By purchasing a subscription, you are helping to ensure the future of impactful stories about the discoveries and ideas shaping our world today.
The episode’s story begins harmlessly. The ingenious Professor Farnsworth invents a machine capable of swapping the minds of two people. To become young again, he swaps bodies with the character Amy, who, for her part, is looking forward to being in a body in which she can eat as much as she wants without having to watch her figure.
Once the change is made, the two realize that the transformation cannot be easily reversed because the device only works once for each pair of bodies. Other characters from the series get involved: in total, they use the machine seven times. The bodies and minds of nine characters are so mixed that it becomes difficult to know who is who at any given moment.
Along the way, the characters have crazy motivations to seek to transform: the robot Bender wants to pilfer Emperor Nicholas’ yacht and takes the form of Amy to seduce the guards; Leela slips into the Professor’s form to find out why Fry loves her; in revenge, Fry wants to be ugly and swaps his body with the alien lobster Dr. Zoidberg, and so on.
Ultimately, of course, everyone wants their body back. But at this point in the story, Keeler hesitated. He needed to unravel the characters without two identical people using the machine more than once; the pairs always had to be different. Keeler realized he would have to introduce new characters into the episode to solve the problem. But how much? Keeler holds a Ph.D. in mathematics and realized that he was faced with this question: how many more people does it take to solve the body swap problem with n numbers?
He had no idea what a solution might look like. The number of additional people could increase with the size n of the group or be constant. There didn’t seem to be an answer in the literature yet, so Keeler set out to solve the problem himself. And after some thought, he finally developed a proof: two more characters would be enough to resolve the complicated situation, no matter how many people their bodies swapped.
Solution in sight!
In the series, the Globetrotters, talented basketball players with brilliant scientific skills, save the day. Two of the players, “Sweet” Clyde Dixon and Ethan “Bubblegum” Tate, solve the problem on a blackboard by writing Keeler’s proof.
But how exactly did Keeler do it? He summarized the problem by imagining n objects arranged in the wrong order, say (2, 3, 4, 5, …, I, I + 1, …, n1). The goal is to reconstitute the whole (1, 2, 3, …, n) by exchanging the objects in pairs with two new elements, x And Yes. You can note such an exchange by (I, x); SO I And x change position. You thus have a new set (2, 3, 4, 5, …, I, I + 1, …, n1, x, Yes).
Keeler discovered that we must first divide the whole into a single group ranging from 1 to I and another which goes from I + 1 to n. Then you swap each misplaced element from the first set with x and each of the seconds with Yes. At the very end you exchange xwith I + 1 and Yes with 1: (1, x) (2, x) (3, x) … (I, x) × (I +1, Yes) (I + 2, Yes) … (n, Yes) × (I +1, x) × (1, Yes). No matter how I is chosen, after these permutations you finally end up with an ordered set (ignoring x And Yes): (1, 2, 3, … , I, I + 1, …, n). In fact, it doesn’t matter how the items were originally ordered. The method still works.
To see Keeler’s proof in action, you can create a table plotting the initial body-swap pairs. Drawing simplified stick figures in which a person’s mind is one color and their body a different color helps with this step. Once you have drawn and colored each of the characters, you will notice that Fry and Zoidberg can be distinguished from the other characters because they only interacted with each other.
Now, with the help of Sweet Clyde and Bubblegum Tate, you can try to reunite their respective minds with their bodies. Zoidberg and Fry require four steps. By abstractly expressing their false composition by (2, 1), we obtain the following set with Clyde (x) and Tate (Yes): (2, 1, x, Yes). Because there are only two objects, I = 1 must exist. Thus, according to Keeler’s approach, the following permutations are necessary: (1, x), (2, Yes), (2, x) and (1, Yes). By executing them one after the other, the whole changes as follows: (2, x1, Yes), (Yes, x1, 2), (Yes2, 1, x), (1, 2, Yes, x).

Eve Lu
Of course, Sweet Clyde and Bubblegum Tate are now reversed. Theoretically, they could enter the machine and trade, but instead they should help the other seven characters, which they do. The characters solve the problem in 13 steps total using this method (although the smallest number needed is actually nine). In the end, everyone’s spirit is restored along with their body.
Keeler was satisfied with his result but did not consider it significant enough to be published. Mathematicians Ron Evans, Lihua Huang and Tuan Nguyen did it for him: in 2014, they published a nine-page improved version of his proof in the American Mathematical Monthly. Keeler should be proud that Futurama manages to present and prove an unsolved mathematical problem, without losing any entertainment value.
This article was originally published in spectrum of science and has been reproduced with permission. It was translated from the original German version with the help of artificial intelligence and reviewed by our editors..

































