Skip to content
All Things
Classroom
Let's talk
Blog
Math StoriesMath Storytelling · #25 min read

Homer's last theorem: the Simpsons equation that almost breaks Fermat.

A blackboard in a 1998 episode carries an equation that seems to defy a theorem it took 358 years to prove. Grab a calculator with more than eight digits.

Varchas KoushikVarchas KoushikFounder · Storyteller & Learning Experience Designer

Remember the show that predicted Donald Trump's presidency? Yes, I am talking about The Simpsons in my story #2.

In the episode "The Wizard of Evergreen Terrace" (1998), Homer writes something on the blackboard. The first equation predicts the mass of the Higgs boson… well, almost. It yields an answer of 775 giga-electron-volts — higher than the 125 GeV estimate when it was discovered in 2012, but not a bad guess in 1998, is it?

My interest: the second equation on the board

3987¹² + 4365¹² = 4472¹²

Why? We all recognise the equation x² + y² = z², right? Diophantus, in his book Arithmetica, challenged his readers to find whole-number solutions to it. There are infinitely many — do Pythagorean triples ring a bell?

So what's special in Homer's equation?

Homer seems to have defied Fermat's last theorem.

Pierre de Fermat got bored of Diophantus' puzzle and wanted to find solutions for x³ + y³ = z³. He could only come up with trivial ones, like 0³ + 7³ = 7³. He raised the powers further and tried again; despite his best efforts he couldn't find any. So he concluded that it is impossible to find whole-number solutions to any equation of the form xⁿ + yⁿ = zⁿ when n > 2.

He scribbled this in his copy of Arithmetica in 1637, and then confidently added a sentence (translated from Latin):

I have discovered a truly marvellous proof of this, which this margin is too narrow to contain.
— Pierre de Fermat, 1637 — the most frustrating note in the history of mathematics

No one could prove it, and so the claim became known as Fermat's last theorem — the only one of Fermat's claims that remained unproven. In 1995 it was finally proven by Andrew Wiles at Princeton University. The proof ran to 130 pages. No kidding.

Is Homer's equation true?

Take your calculator and check it now. If it can show more than eight digits, you'll realise it's not exactly correct — but almost. The actual value is 4472.000000007057617187512…

Fermat's theorem still holds, and so does the 130-page proof. This was a mathematical prank played by the writer David S. Cohen. Cohen knew Fermat's equation had no solutions, but this way he paid homage to one of the greatest mathematical minds — and to Andrew Wiles. The prank amused almost everybody who knew the theorem and checked the board with a calculator.

How did Cohen find it?

To find this pseudo-solution, he wrote a computer program that scanned through values of the variables until it found a set that was almost balanced. Cohen was one of the mathematically gifted writers who joined The Simpsons in the mid-1990s; he studied physics at Harvard before his passion for writing took over. The first equation on the board, predicting the Higgs mass, was largely based on the work of his high-school friend David Schiminovich. The last two lines concern the density of the universe and an area of mathematics called topology.

The Simpsons has a lot of mathematical titbits in its episodes. Stay tuned for more stories on math.

First published on LinkedIn as Math Storytelling #2

Varchas Koushik

Written by

Varchas Koushik

Founder · Storyteller & Learning Experience Designer

Founder of All Things Classroom. 10,000+ hours facilitating sessions with students across age groups and geographies; writes about game-based learning, story-driven teaching and what's possible when a lesson is designed like an experience instead of a script.

More about Varchas