I still remember the movie night when I watched it for the first time Goodwill Hunt with my mother. Matt Damon played a janitor at the Massachusetts Institute of Technology. While cleaning the halls, he passed a blackboard with an advanced math problem written on it. He stopped and started to fix the problem. I watched, fascinated, as he created seemingly unreadable structures of points and lines, until suddenly a math professor came out of a lecture room and chased him away.
The audience had already been told that this problem was supposed to be incredibly difficult and would take years of expert thinking to solve, but it was quickly solved by Damon’s insightful janitor in just a few moments. At the time, I was fascinated by the idea that people could possess a hidden talent that no one knew existed.
As I got older and better at math, I considered it all Hollywood hokum. Goodwill Hunt could tell a great story, but it’s not very realistic. In fact, the mathematical challenge does not stand up to close scrutiny. With the Academy Awards this month, many people are thinking back to past winners, including Goodwill Hunt. It’s worth taking a closer look at the blackboard of a film that, in 1997, earned nine nominations and won for both original screenplay and supporting actor.
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.
Based on real events
The film was inspired by a true story, one that I personally find much more fascinating than the fairy tale version of the film. Goodwill Hunt. The real story centers on George Dantzig, who would one day become known as the “father of linear programming.”
Danzig was not always an excellent student. He claimed to have I struggled with algebra. in college. But he was no layman when the event that inspired the film occurred. At that time he was a graduate student in mathematics. In 1939, he arrived late to a conference led by statistics professor Jerzy Neyman at the University of California, Berkeley. Neyman wrote two problems on the board and Danzig assumed they were homework.
Dantzig noted that the task seemed more difficult than usual, but he still solved both problems and submitted his solutions to Neyman. It turned out that he had solved two of the most famous unsolved statistical problems at the time.
This feat was quite impressive. In contrast, the math problem used in the Hollywood movie is very easy to solve once you master the jargon. In fact, I’m going to walk you through it. As the film presents it, the challenge is as follows: draw all the trees homeomorphically irreducible in size n = 10.
Before I go any further, I want to point out two things. First, presenting this challenge is actually the hardest thing. It is completely unrealistic to expect a layperson, no matter how talented in mathematics, to be familiar with the technical language used to formulate the problem. But that brings me to the second thing to note: once you’ve translated the technical terms, the actual task is simple. With a little patience and guidance, you might even be able to assign it to the kids.
Solve it Goodwill Hunt issue
Let’s get into the vocabulary. In mathematics, a tree is a type of graph, that is, a set of points connected to each other. Trees, in particular, cannot contain loops, so you cannot connect the points in a way that brings them together as 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 that we are supposed to draw all possible 10-node tree graphs.

The term “homeomorphic” essentially 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 make a connection between nodes A and B, I can make that link longer or shorter or rotate it slightly, and it won’t matter as long as the overall network structure stays the same. The important part is that A connects to B.
To think about it differently, imagine an X-shaped tree with five nodes and a K-shaped tree with five nodes. These trees are considered to be the even tree because the number of nodes and the sequence of connections are unchanged between the two forms.
And “irreducible”, in this case, means that each node in the graph must be connected either by one line or by three or more lines, so that no node is connected by only two lines: if a node were connected by only two lines, it could be reduced to a single line.

So, in plain English, the task is to draw all trees with the specified properties and each having 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 can start drawing by hand all the graphics that meet these criteria. Turns out you might only need a few minutes of doodling if you decide to go the latter route.
To demonstrate this, you can first draw a tree consisting of a central node that radiates with nine connections, giving us a total of 10 nodes. This design meets the required criteria: it is one of our homeomorphically irreducible pruning trees. n = 10. Good job!
Next, draw a tree with eight connections. You will find that this design leads to a dead end because you will not be able to add a node without recreating the previous tree or introducing a collapsible row. Then move on to drawing a tree that starts with a node with seven connections. You’ll still need to place two more nodes, but you can imagine adding them to one of the seven you just drew. At this point you should be able to continue scribbling through the possibilities.

If you prefer an even more systematic approach, although it may take you a little longer, depending on your comfort with graph theory— an intelligent solution consists of considering the mathematical conditions that trees must meet and representing them by equations.
For this approach, we can define nk like the number of nodes n with k relationships. Since the tree must be irreducible, there exists no circumstance where n2 can exist, therefore n2 = 0. Additionally, we know that the tree must have 10 nodes in total, which means you will never have n10 Or n11and 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 jumped n2 because we know that would be 0.
There is another constraint that we can express. Our 10-node tree 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, one being AB and the other being BA. We can use this to construct an equation in which we represent each connection and node individually. For example, if a node is linked to another node, it creates a connection: 1n1. If a single node is linked to three other nodes, three connections will be created, so 3n3etc. This leads us to the following equation:
n1 + 3n3 +4n4 +5n5 + 6n6 +7n7 +8n8 +9n9 = 18
You have now created two equations that correct and constrain our tree drawing options. But we need to combine them to identify the most relevant terms for our task. You can subtract the first equation from the second to produce:
2n3 + 3n4 +4n5 +5n6 + 6n7 +7n8 +8n9 = 8
This equation serves as a reference for drawing your different trees. The idea is to take terms that together will equal 8 when you add their first integer, or coefficient. Look 8n9 For example. This tells us we only need one n9 to construct our tree, which corresponds to the drawing in which a single node has nine connections.
If you try to draw n8you will find yourself in a dead end scenario, with no tree meeting our criteria. If you used our equation as a reference, you wouldn’t even bother trying to draw it because you would see that you can’t combine 7n8 with another term such that the first number of each would be equal to 8.
But a node with seven connections, n7can work if you combine it with n3which means you can combine a tree with seven connections (represented by 6n7 in the equation) and a tree with three co connections (2n3) to find another solution to the problem. And you can continue with the process from there!

Better examples exist
I can understand why Goodwill HuntDanzig filmmakers have distanced themselves from Danzig’s actual work. The solution he came up with wasn’t short and trees are probably more visually appealing to a filmmaker.
But I still think the filmmakers chose this particular math problem poorly, even for a Hollywood movie. The history of mathematics has many amazing stories, including true stories of lay people solving a problem. In an open issue, this could be a great source of material for films.
In the field of geometry, for example, many advances in tiling planes were made by ambitious people who had not studied mathematics or anything similar. One of my personal favorites happened in 2022, when David Smith, a retired printing technician, finally found the much sought-after “Einstein tile” a polygon that can completely fill a plane without any gaps and without the resulting pattern repeating.
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.



























