A Futurama writer's plot problem led to a new math proof

pseudolus1 pts0 comments

How a Futurama plotline led to a totally new math proof | Scientific American

July 21, 2026<br>5 min read<br>Add Us On GoogleAdd SciAm<br>How a Futurama writer&rsquo;s plot problem led to a totally new math proof

In an episode of the cartoon, a machine lets characters swap bodies, but they can&rsquo;t switch back with the same person. Math helps all the characters return to their original bodies

By Manon Bischoff edited by Daisy Yuhas

In the "Prisoner of Benda" Futurama episode, a machine lets two characters swap bodies with each other.

20th Century Fox Television

Love math? Sign up for our weekly newsletter Proof PositiveEnter your email<br>I agree my information will be processed in accordance with the Scientific American and Springer Nature Limited Privacy Policy. We leverage third party services to both verify and deliver email. By providing your email address, you also consent to having the email address shared with third parties for those purposes.<br>Sign Up

This article is from Proof Positive, our friendly math newsletter that's delivered to your inbox every Tuesday afternoon. Sign up today and read it first.<br>Nerdy jokes are no longer rarities on TV. As I wrote about a few weeks ago, even The Simpsons is rife with mathematical high jinks. But Futurama has taken nerd humor to an extreme. Consider the episode &ldquo;The Prisoner of Benda.&rdquo; Its writer, Ken Keeler, had to formulate an original mathematical proof to solve a significant plot problem.<br>On supporting science journalism<br>If you're enjoying this article, consider supporting our award-winning journalism by subscribing. By purchasing a subscription you are helping to ensure the future of impactful stories about the discoveries and ideas shaping our world today.<br>The episode&rsquo;s story begins innocuously. The ingenious Professor Farnsworth invents a machine that can swap the minds of two people. In a bid to be young again, he swaps bodies with the character Amy, who, for her part, is eager to be in a body in which she can eat as much as she wants without having to watch her figure.<br>After the switch is made, the pair realize that the transformation cannot be easily reversed because the device works only once for each pairing of bodies. And so other characters in the series also get involved: in total, they use the machine seven times. The bodies and minds of nine characters are mixed up so wildly that it becomes hard to keep track of who is who at any given time.<br>Along the way, characters have wild motivations for seeking transformation: the robot Bender wants to pilfer Emperor Nikolai&rsquo;s yacht and takes Amy&rsquo;s form to seduce the guards; Leela slips into the professor&rsquo;s form to find out why Fry loves her; to take revenge, Fry wants to be ugly and swaps his body with the alien lobster Dr. Zoidberg, and so on.<br>In the end, of course, everyone wants to get back to their own bodies. But at this point in the story, Keeler faltered. He needed to untangle the characters without having two of the same people use the machine more than once; the pairs had to always be different. Keeler realized that he would have to introduce new characters into the episode to solve the problem. But how many? Keeler has a Ph.D. in mathematics and realized he faced this question: How many extra people does it take to untangle the body-swapping problem with n figures?<br>He had no clue what a solution might look like. The number of additional people could grow with the size n of the group or be constant. There didn&rsquo;t yet seem to be an answer in the literature, so Keeler set out to solve the problem himself. And after some head-scratching, he finally developed a proof: two more characters would be enough to resolve the messy situation, regardless of how many people swapped bodies.<br>Solution in Sight!<br>In the series, the Globetrotters, talented basketball players with brilliant scientific skills, save the day. Two of the players, &ldquo;Sweet&rdquo; Clyde Dixon and Ethan &ldquo;Bubblegum&rdquo; Tate, solve the problem on a blackboard—by writing out Keeler&rsquo;s proof.<br>But how exactly did Keeler do it? He abstracted the problem by imagining n objects arranged in the wrong order, say (2, 3, 4, 5, ..., i, i + 1, ..., n, 1). The goal is to restore the set (1, 2, 3, ... , n) by swapping the objects pair-wise with two new elements, x and y. You can notate such a swap by (i, x); then i and x change their positions. Thus you have a new set (2, 3, 4, 5, ..., i, i + 1, ..., n, 1, x, y).<br>Keeler found that you must first divide the set into one group that goes from 1 to i and another that goes from i + 1 to n. Then you swap every misplaced element of the first set with x and every one of the second with y. At the very end, you swap out xwith i + 1 and y with 1: (1, x) (2, x) (3, x) ... (i, x) &times; (i + 1, y) (i + 2, y) ... (n, y) &times; (i + 1, x) &times; (1, y). Regardless of how i is chosen, after these permutations, you ultimately end up with an ordered set...

characters problem proof rsquo bodies keeler

Related Articles