PostHole
Compose Login
You are browsing eu.zone1 in read-only mode. Log in to participate.
rss-bridge 2026-03-01T13:00:00+00:00

Why mathematicians hate Good Will Hunting

This Oscar-winning classic set a surprisingly simple mathematical challenge


March 1, 2026

7 min read

Add Us On GoogleAdd SciAm

Why mathematicians hate Good Will Hunting

This Oscar-winning classic set a surprisingly simple mathematical challenge

By Manon Bischoff edited by Daisy Yuhas

[Actor Matt Damon writing on a chalkboard in the movie Good Will Hunting]

Entertainment Pictures/Alamy

I still remember the movie night when I first watched Good Will Hunting with my mom. Matt Damon played a janitor at the Massachusetts Institute of Technology. While mopping the hallways, he walked past a blackboard with an advanced math problem written on it. He stopped and started solving the problem. I watched, mesmerized, as he created seemingly illegible structures of dots and lines—until suddenly a math professor came out of a lecture hall and chased him away.

As I got older and more mathematically savvy, I dismissed the whole thing as Hollywood hokum. Good Will Hunting might tell a great story, but it isn’t very realistic. In fact, the mathematical challenge doesn’t hold up under much scrutiny. With the award ceremony for the Oscars this month, many people are thinking back on past winners—including Good Will Hunting. It’s worth taking a closer look at the blackboard in a film that, in 1997, took nine nominations and won for both original screenplay and actor in a supporting role.


On supporting science journalism

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.


Based on Actual Events

The film was inspired by a true story—one I personally find far more compelling than the fairy tale version in Good Will Hunting. The real tale centers George Dantzig, who would one day become known as the “father of linear programming.”

Dantzig was not always a top student. He claimed to have struggled with algebra in junior high school. But he was not a layperson when the event that inspired the film occurred. By that time, he was a graduate student in mathematics. In 1939 he arrived late for a lecture led by statistics professor Jerzy Neyman at the University of California, Berkeley. Neyman wrote two problems on the blackboard, and Dantzig assumed they were homework.

Dantzig noted that the task seemed harder than usual, but he still worked out both problems and submitted his solutions to Neyman. As it turned out, he had solved what were then two of the most famous unsolved problems in statistics.

That feat was quite impressive. By contrast, the mathematical problem used in the Hollywood film is very easy to solve once you learn some of the jargon. In fact, I’ll walk you through it. As the movie presents it, the challenge is this: draw all homeomorphically irreducible trees of size n = 10.

Before we go any further, I want to point out two things. First, the presentation of this challenge is actually the most difficult thing about it. It’s quite unrealistic to expect a layperson—regardless of their mathematical talent—to be familiar with the technical language used to formulate the problem. But that brings me to the second thing to note: once you translate the technical terms, the actual task is simple. With a little patience and guidance, you could even assign it to children.

Solving the Good Will Hunting problem

Let’s get into the vocabulary. In mathematics, a tree is a type of graph—that is, a collection of points that are connected to one another. Trees, notably, cannot contain loops, so you cannot connect the points in a way that causes them to close into one. The size of the tree is given in terms of the number of points, or nodes, in the graph. In this case, we know we are meant to draw all possible tree graphs with 10 nodes.

The term “homeomorphic” basically refers to the idea that the nodes in this network always follow a particular sequence; the exact shape of the tree is not as important as the sequence of connections. When I draw a connection between nodes A and B, I can make that link longer or shorter or rotated slightly, and it won’t matter so long as the overall structure of the network remains the same. The important part is that A connects to B.

To think about that in a different way, imagine a tree shaped like an X with five nodes and a tree shaped like a K with five nodes. These trees are considered to be the same tree because the number of nodes and sequence of connections are unchanged between the two shapes.

And “irreducible,” in this case, means that every node in the graph must be connected by either one line or by three or more lines such that no node is connected by only two lines: if a node was connected by only two lines, it could be reduced into just a single line.

So in plain language, the task is to draw all trees with the specified properties that each have 10 nodes. There are several approaches to this. For example, you could write a computer program that solves the task in a fraction of a second. Or you could start drawing all the graphs that fulfill these criteria by hand. It turns out that you may only need a few minutes of doodling if you decide to go with the latter route.

To demonstrate that, you can first draw a tree consisting of one central node that radiates out with nine connections, giving us a total of 10 nodes. That design meets the required criteria—it’s one of our homeomorphically irreducible trees of size n = 10. Good work!

Next, draw a tree with eight connections—you’ll find this design leads to a dead end because you won’t be able to add a node without either re-creating the previous tree or introducing a reducible line. Move on to drawing a tree that begins with a node that has seven connections. You will still need to place two more nodes, but you can imagine adding them to one of the seven you’ve just drawn. At this point, you should be able to keep doodling through the possibilities.

If you prefer an even more systematic approach—though it may take you a bit more time, depending on your comfort with graph theory—one clever solution involves considering which mathematical conditions the trees must fulfill and representing them with equations.

For this approach, we can define nk as the number of nodes n with k connections. Because the tree should be irreducible, there is no circumstance where n2 can exist, so n2 = 0. Furthermore, we know the tree must have 10 nodes total—that means you’ll never have n10 or n11, and so on. The maximum is n9.

We can then represent what we know with a mathematical formula:

n1 + n3 + n4 + n5 + n6 + n7 + n8 + n9 = 10

Note that we skipped n2 because we know that would equal 0.

There’s another constraint that we can express. Our tree with 10 nodes will ultimately have 18 lines, or connections, between them if we count in such a way that the link between node A and node B counts twice, with one being A-B, and the other being B-A. We can use that to build an equation where we represent each connection and node individually. For example, if a node links to one other node, it creates one connection: 1n1. If a single node links to three other nodes, there will be three connections created, so 3n3, etcetera. This leads us to the next equation:

n1 + 3n3 + 4n4 + 5n5 + 6n6 + 7n7 + 8n8 + 9n9 = 18

Now you’ve created two equations that corral and constrain our tree-drawing options. But we need to combine them to identify the terms most relevant for our task. You can subtract the first equation from the second to produce:

[...]


Original source

Reply