The identity swapping starts when Professor Farnsworth uses his Mind-switcher to switch minds with Amy, so that he can experience the joy of being young again from within Amy’s body. Amy is also eager to switch, because she can now gorge herself with food, knowing that the Professor’s skinny body can easily afford to gain some weight.

  The plot becomes more complicated when Bender and Amy switch minds. Of course, prior to this switch, Amy’s body has the Professor’s mind, so the result of the switch is that Bender’s body contains the Professor’s mind and Amy’s body contains Bender’s mind. This enables Bender to commit a robbery by seducing the guards, with the bonus that he cannot be correctly identified. Meanwhile, the Professor runs off to join the Circus Roboticus. The situation gets even messier after an orgy of further mind-switching. Here is a complete sequence of switches that occur during the episode. Each pair of names refers to the bodies involved in the mind-switch, not necessarily the minds inside those particular bodies at the time of the switch.

  1

  Professor Farnsworth

  ↔

  Amy

  2

  Amy

  ↔

  Bender

  3

  Professor Farnsworth

  ↔

  Leela

  4

  Amy

  ↔

  Wash Bucket25

  5

  Fry

  ↔

  Zoidberg

  6

  Leela

  ↔

  Hermes

  7

  Wash Bucket

  ↔

  Emperor Nikolai26

  Although there are only seven switches in total, the consequences of this mental juggling are very confusing. One way to keep track of what is happening is by drawing a Seeley diagram, invented by Dr. Alex Seeley, a Futurama fan living in London. A quick glance at this diagram reveals that the seven mind-switches eventually result in the Professor’s body containing Leela’s mind, Leela’s body containing Hermes’s mind, and so on.

  As the episode draws to a close, everyone grows bored with the novelty and wants to return to his, her, or its original body. Alas, there is a major problem caused by a glitch in the Mind-switcher: Once two bodies have swapped minds, the Mind-switcher cannot perform a second swap between this pair of bodies. Hence, it is not at all clear that the various minds can return to their own bodies.

  This Seeley diagram tracks the various mind-switches. Circles represent minds, squares represent bodies, and the letters inside them represent the various individuals. Initially, the nine mind-body pairings match, because every body begins with the correct mind. The minds then move to different bodies after each switch. For example, after the first switch, the Professor’s body is matched with Amy’s mind , and vice versa. The bodies always remain on the same horizontal line, while the minds move up and down as they are switched.

  This Mind-switcher glitch was introduced by the writers to make the plot more interesting. However, someone then had to find a way to overcome this barrier to reach a happy ending, and the responsibility fell to Ken Keeler, the lead writer for this episode. He realized that one way to break the deadlock would be to introduce fresh people into the scenario, characters who could provide indirect paths by which the minds of the Professor and everyone else could return to their correct bodies. However, rather than tackling the particular scenario from “The Prisoner of Benda,” Keeler tried to address the more general problem: How many fresh people need to be introduced into a group of any size to unravel any conceivable mind-switching muddle?

  When he began to explore the problem, Keeler had no real hunch as to what the answer might be. Would the number of fresh people depend on the size of the group being untangled? If so, perhaps the number of fresh people would be directly proportional to the size of the group, or perhaps the number of fresh people would grow exponentially in relation to the group size. Or maybe there was a magic number of fresh people that could fix any muddled group?

  Finding the answer turned out to be a significant challenge, even for someone with a PhD in applied mathematics. It reminded Keeler of some of the tougher problems that he had encountered at university. After an extended period of concentration and head-scratching, Keeler completed a cast-iron proof that delivered an undeniable result. The answer turned out to be surprisingly neat. Keeler concluded that introducing just two fresh people would be enough to untangle mind-switching chaos of any magnitude, as long as those two people were deployed in the correct manner. Keeler’s proof, which is somewhat technical, has come to be known as the Futurama theorem or Keeler’s theorem.

  This proof is presented in “The Prisoner of Benda” by “Sweet” Clyde Dixon and Ethan “Bubblegum” Tate, two basketball players from the Globetrotter Homeworld, who are also famous for their mathematical and scientific talents. Indeed, Bubblegum Tate is Senior Lecturer in Physics at Globetrotter University and the Downtown Professor of Applied Physics at Mars University. These characters appear in several episodes of Futurama, and they regularly demonstrate their mathematical knowledge. For instance, in “Bender’s Big Score,” Bubblegum Tate gives Sweet Clyde some advice about solving a time-travel equation: “Use variation of parameter and expand the Wronskian.”27

  This grainy picture was taken by Patric Verrone on December 9, 2009, on the day of the table-read for “The Prisoner of Benda.” Ken Keeler is sketching out his proof of the Futurama theorem while standing on a couch in the Futurama office.

  As “The Prisoner of Benda” reaches its climax, Sweet Clyde declares: “Q to the E to the D! . . . Basically, no matter how permuted-up your minds are, they can be restored using, at most, two extra players.” Sweet Clyde scribbles down an outline of the proof on a fluorescent green chalkboard.

  The best way to understand the proof, which is couched in technical notation, is to focus on how it is applied in order to help the characters in “The Prisoner of Benda” sort out their predicament. The proof essentially describes a clever unmuddling strategy, which begins with the realization that individuals with switched minds can be placed into well-defined sets; in the case of “The Prisoner of Benda,” there are two sets. Careful examination of the mind-switching Seeley diagram here reveals that the first set consists of Fry and Zoidberg. This is apparent from the lowest two lines of the diagram, which reveal that Fry’s mind ends up in Zoidberg’s body, while Zoidberg’s mind ends up in Fry’s body. This is considered a set because we can see that there is a mind for every body, and the only problem is that the minds and bodies are jumbled.

  The Futurama theorem, as written down by Sweet Clyde at the conclusion of “The Prisoner of Benda.” Bubblegum Tate looks at the details of the proof, while Bender (containing the Professor’s mind) watches in admiration. A transcription of the proof as it appears on the board is available in appendix 5.

  The other set consists of all the other characters. The Seeley diagram shows that the Professor’s mind is in Bender’s body, Bender’s mind is in the Emperor’s body, the Emperor’s mind is in Wash Bucket’s body, Wash Bucket’s mind is in Amy’s body, Amy’s mind is in Hermes’s body, Hermes’s mind is in Leela’s body, and, finally, Leela’s mind is in the Professor’s body, which closes the set. Again, this is considered a set because there is a mind for every body, but the minds and bodies are jumbled.

  Having identified the sets, Keeler added two fresh people to the mix, Bubblegum Tate and Sweet Clyde, who then unmuddle the two sets one at a time. To see this in action, let us start with the smaller set and unmuddle it.

  The Seeley diagram below tracks exactly what happens in the episode. We can see that the unmuddling phase begins with Sweet Clyde mind-switching with Fry (who has Zoidberg’s mind), then Bubblegum Tate mind-switches with Zoidberg (who has Fry’s mind). With two more mind-switches, Fry’s mind is returned to his own body and Zoidberg’s mind is returned to his own body.

  Sweet Clyde and Bubblegum Tate are still mixed up, and the obvious next
step would be to put their minds back in their correct bodies by performing one more mind-switch—this would be allowed, because they have not yet switched with each other. However, that would be a premature switch. The mathketball geniuses were introduced as fresh people to unmuddle sets, and their work is not yet complete. So they must remain mixed up until they have dealt with the second set.

  The Seeley diagram below tracks the nine mind-switches that occur as the second set is unmuddled. There is no need to go through the Seeley diagram switch by switch, but the overall pattern shows how the addition of Sweet Clyde and Bubblegum Tate creates the wiggle room required to resolve the situation. They are involved in every single mind-switch, which explains why the lowest quarter of the diagram looks so much busier than the region above it. Sweet Clyde and Bubblegum Tate act as temporary vessels for minds looking for the right home. As soon as they receive a mind, they switch it so that the mind ends up in the appropriate body. Whichever mind they then receive, they immediately pass it on to the appropriate body in the next switch, and so on.

  Although Keeler did an excellent job of solving the mind-switching riddle and developing the Futurama theorem, it is important to point out that he either missed a trick, or ignored it in order to make the finale of “The Prisoner of Benda” more interesting. The trick in question is a potential shortcut. Remember, to unmuddle any situation, it is necessary to introduce two new characters. However, in the scenario that we have been examining, one of the sets being unmuddled consists of just two characters (Fry’s mind in Zoidberg’s body and Zoidberg’s mind in Fry’s body). Hence, they could have acted as two fresh people in relation to the larger set. This is possible because Fry and Zoidberg had not previously switched with anyone in the larger set.

  The two-stage unmuddling process that appeared in the episode required four switches followed by nine switches, giving thirteen switches in total. By contrast, if the shortcut had been used, then every mind could have been returned to every body in a total of only nine switches.

  The use of an existing set to provide the two fresh people required to unmuddle another set was first explored by James Grime, a mathematician based in Cambridge, England. Hence, some people refer to this trick as Grime’s corollary, a mathematical statement that emerges from the Futurama theorem.

  Keeler’s work has also inspired a research paper on the topic of mind-switching to be published in the American Mathematical Monthly. Authored by Ron Evans, Lihua Huang, and Tuan Nguyen from the University of California, San Diego, the paper is titled “Keeler’s Theorem and Products of Distinct Transpositions,” and looks at how to unmuddle any mind-switching situation in the most efficient manner.

  By contrast, Keeler has decided not to publish his own research on mind-switching. He modestly describes it as a fairly standard piece of mathematics, and is generally reluctant to discuss the proof. He told me that his most detailed description of the Futurama theorem appeared in a fake script that he distributed to his colleagues: “When a writer hands in his draft of a script, the first step of the rewrite process is that the writers get copies and take a half hour or so to read it. As a practical joke, I started the script with a wholly facetious three-page scene of Sweet Clyde explaining his theorem to the Professor in technical detail. Several of the writers waded through the whole thing, eyes doubtless glazing, before discovering the real script started on page four.”

  Keeler’s mischievous hoax script reinforces the point that the actual script for “The Prisoner of Benda” is based on some genuinely interesting and innovative mathematics. In many ways, this episode is the pinnacle of all the mathematical references that have ever appeared in both The Simpsons and Futurama. Mike Reiss and Al Jean began by introducing mathematical freeze-frame gags into the first season of The Simpsons, and two decades later Ken Keeler created an entirely new theorem in order to help the Planet Express crew. Indeed, Keeler can claim the honor of being the first writer in the history of television to have created a new mathematical theorem purely for the benefit of a sitcom.

  EXAMINATION V

  PHD

  Joke 1

  Q: What’s purple and commutes?

  1 point

  A: An abelian grape.

  Joke 2

  Q: What’s lavender and commutes?

  1 point

  A: An abelian semigrape.

  Joke 3

  Q: What’s nutritious and commutes?

  1 point

  A: An abelian soup.

  Joke 4

  Q: What’s purple, commutes, and is worshipped by a limited number of people?

  1 point

  A: A finitely venerated abelian grape.

  Joke 5

  Q: What’s purple, dangerous, and commutes?

  1 point

  A: An abelian grape with a machine gun.

  Joke 6

  Q: What’s big, grey, and proves the uncountability of the decimal numbers?

  2 points

  A: Cantor’s diagonal elephant.

  Joke 7

  Q: What’s the world’s longest song?

  2 points

  A: “0 Bottles of Beer on the Wall.”

  Joke 8

  Q: What does the “B.” in Benoit B. Mandelbrot stand for?

  4 points

  A: Benoit B. Mandelbrot.

  Joke 9

  Q: What do you call a young eigensheep?

  1 point

  A: A lamb, duh!

  Joke 10

  One day, ye director of ye royal chain mail factory was asked to submit a sample in order to try to win a very large order for chain mail tunics and leggings.

  Though the tunic sample was accepted, he was told that the leggings were too long. He submitted a new sample, and this time the leggings were better, but too short. He submitted yet another sample, and this time the leggings were better still, but too long again.

  4 points

  Ye director called ye mathematician and asked for her advice. He tailored another pair of chain mail leggings according to her instructions, and this time the samples were deemed to be perfect.

  Ye director asked ye mathematician how she calculated the measurements, and she replied: “I just used the wire-trousers hem test of uniform convergence.”

  Joke 11

  An infinite number of mathematicians walk into a bar. The bartender says, “What can I get you?” The first mathematician says, “I’ll have one-half of a beer.” The second mathematician says, “I’ll have one-quarter of a beer.” The third mathematician says, “I’ll have one eighth of a beer.” The fourth mathematician says, “I’ll have one-sixteenth . . .” The bartender interrupts them, pours out a single beer and replies, “Know your limits.”

  2 points

  TOTAL – 20 POINTS

  Eπlogue

  Futurama has garnered many honors over the years, including six Emmy Awards. That partly explains why the Guinness Book of World Records has recognized it as the Current Most Critically Acclaimed Animated Series.

  Similarly, The Simpsons is the winner of more than two dozen Emmys and has become the longest-running scripted television series in history. According to Time magazine’s review of the twentieth century, The Simpsons was rated as the best TV series and Bart Simpson was considered to be one of the world’s hundred most important people. He was the only fictional character to appear on the list. Bart and his family also made history in 2009, when they became the first TV characters to have their own U.S. Postal Service stamps while still on-air. Matt Groening proudly proclaimed: “This is the biggest and most adhesive honor The Simpsons has ever received.”

  However, alongside this public and much deserved recognition, there has also been a quiet appreciation and respect from the nerd community. For us, the greatest achievements of The Simpsons and Futurama have been their celebrations of and flirtations with mathematics. Both series have enriched the geekosystem.

  It would be easy for non-nerds to dismiss the mathematical shenanigans that appear
on The Simpsons and Futurama as superficial and frivolous, but that would be an insult to the wit and dedication of the two most mathematically gifted writing teams in the history of television. They have never shied away from championing everything from Fermat’s last theorem to their very own Futurama theorem.

  As a society, we rightly adore our great musicians and novelists, yet we seldom hear any mention of the humble mathematician. It is clear that mathematics is not considered part of our culture. Instead, mathematics is generally feared and mathematicians are often mocked. Despite this, the writers of The Simpsons and Futurama have been smuggling complex mathematical ideas onto prime-time television for almost a quarter of a century.

  As my final day with the writers in Los Angeles approached, I had come to the conclusion that they were proud of their mathematical legacy. At the same time, among some of them, there was a sense of sadness that they had not been able to continue with their mathematical careers. Opportunities in Hollywood had obliged them to set aside any dreams of proving great theorems.