Mathematics & Cinema
The Best Math Movies: Lives Written on the Board
Abakcus · Cinema

The proof of a theorem is the thing the camera does not love. It is silent, motionless, it happens in a room. A good while passed before cinema learned how to film it.
For a long time cinema kept a strange relationship with mathematics. What the camera loved was motion. A chase, an explosion, a glance. Yet the proof of a theorem most often happens in a room, at the head of a sheet of paper, in hours no one sees. Inside, something tremendous turns, but someone looking from outside sees only a bent back and a hand that keeps scribbling. For years directors could not find how to film this silence. So they got out of it by showing the mathematician as either a man cut off from the world, or a prodigy child, or a set piece scrawling incomprehensible symbols on a board.
Then, slowly, something changed. Films realized that the real tension of mathematics is hidden not in the result but on the road to the solution. What was interesting was not whether an equation came out right, but what the person solving it became in the meantime. A good mathematics film is one that tells not of numbers themselves but of the loneliness, the arrogance, the obsession, and sometimes the salvation of someone wrestling with numbers. The symbols on the board stay there, but the camera turns mainly toward the eyes looking at those symbols.
The twenty-three films below are made up of works that have captured this transformation from different angles. Not all of them are masterpieces. Some use mathematics only as an ornament, others place it at the very heart of the story. But each one has understood at least one thing about mathematics correctly. I have put the list together not in order of viewing but so that the people they portray complete one another. By the time you reach the end, you will have an idea less about mathematics than about the mathematician. If you would rather watch the real thing, our companion guides to beautiful math documentaries and math movies based on true stories chase the same obsession from other directions.
A Beautiful Mind
2001This film does not really set out to explain the equilibrium concept that earned John Nash the 1994 Nobel Prize in economics. Its concern lies elsewhere. It is about how a mind loses the boundary between reality and the fictions it produces. Nash makes an enduring contribution to game theory at a young age, and then schizophrenia slowly pulls him into himself. The man who builds a brilliant career in the corridors of Princeton becomes, after a while, a patient who talks to agents who do not exist and pastes newspaper clippings on his walls.
The cleverest move the film makes is to place the viewer in Nash's position. For a long time we too cannot tell which character is real and which is a delusion. So the film does not explain mathematics to us, it makes us imitate the mathematician's perception. It teaches how hard it is to separate the real from the imagined by making us live it through a patient's eyes. For this reason it stays in the memory less as a film of calculations and more as a portrait of a person who cannot trust his own mind.
The real Nash's story is more tangled and less sweet than the film, which softens the corners as Hollywood always does. Even so, no other film carries to such a wide audience the idea that a mathematician's greatest enemy can sometimes be his own mind. The thing to keep in mind while watching is this: Nash's genius and his illness are two faces of the same mind, and it is hard to understand one without the other.
Trailer below
Find it on AmazonGood Will Hunting
1997A young man who mops floors at MIT secretly solves, at night, a problem left unsolved on a hallway board. This scene has since become a cliché, but in 1997 it was fresh. Will Hunting has a natural gift for mathematics, yet his real problem is not his talent but his fear of carrying it. Coming from a traumatic past, the young man sabotages every opportunity offered to him, because succeeding feels like accepting a life that does not belong to him.
In the film, mathematics is a pretext. The graph theory problem written on the board is a real problem, but the story is not interested in its solution so much as in the relationship the solver builds with his therapist. The psychologist played by Robin Williams teaches Will that the truly hard proof lies not on a sheet of paper but in claiming ownership of his own life. So the film's mathematics is a tool used to tell the story of a person fleeing from himself.
The fine thing about this approach is that it does not sanctify genius. Most films present extraordinary talent as a gift, whereas here that talent sits on Will like a weight stuck to him. The question to ask while watching is this: why would a person flee from a talent everyone envies? The film's answer is simple but solid, because real courage lies not in solving a problem but in choosing a life you find worth solving.
Trailer below
Find it on AmazonStand and Deliver
1988It is based on the true story of a teacher, Jaime Escalante. In a high school in a poor neighborhood of Los Angeles, he teaches calculus to Latino students whom most people expect nothing from. Expectations from the surroundings are low, the system has long assumed these children cannot succeed. In defiance of that assumption, Escalante prepares his students for a difficult calculus exam at the national level.
The film's mathematics is built on accessibility. Calculus here is presented not as an elite subject but as a door anyone can reach. Escalante's method is discipline, humor and unshakable belief. The students pass the exam with such high scores that the testing board grows suspicious and accuses them of cheating. This is where the film's real conflict appears.
Because no one wants to accept those children's success. The idea that a group of poor and minority students might have learned calculus properly clashes with the system's prejudice. So the film tells, more than mathematics, the story of who is deemed worthy of doing mathematics. What should be seen while watching is this: sometimes solving an equation is easy, the hard part is convincing a world that does not believe you can solve it.
Trailer below
Find it on AmazonRain Man
1988It tells of an autistic man with savant abilities who, years later, sets out on a journey with his brother. The character has an extraordinary capacity for calculation. He names the number of matches spilled on the floor at a glance, performs complex multiplications instantly. The film carefully avoids reducing this ability to a parlor trick and treats it instead as part of something deeper.
The mathematics here is instantaneous and intuitive. The character cannot explain how he processes numbers so quickly, because for him it is not a method but a way of perceiving the world. What is interesting is that this extraordinary ability is intertwined with the very thing that distances him from people. The flawless relationship he builds with numbers is a reflection of the relationship he cannot build with people.
The film thus asks a question: is an extraordinary gift for calculation a present, or is it a form of being unable to make contact with the world any other way? The character's brother at first tries to exploit the ability, then slowly learns to love him as he is. What is seen while watching is this: you cannot measure a person in numbers, no matter how fast he calculates, what truly matters is the bond you build with him.
Trailer below
Find it on AmazonPi
1998Darren Aronofsky's first feature turns mathematics from a passion into, in the fullest sense, an illness. The protagonist Max is a mathematician who believes that everything in the universe can be reduced to a numerical pattern. He searches for a hidden code in the movements of the stock market, in the veins of a leaf, even in religious texts. This search slowly drives him toward paranoia and physical collapse.
The film was shot on a very low budget, in grainy black and white. This choice is no accident. It was made to transmit to the viewer Max's way of perceiving the world, that grating and claustrophobic atmosphere. The golden ratio, the Fibonacci sequence and number mysticism recur throughout, but Aronofsky uses them not as knowledge but as fuel for an obsession. Mathematics here is a light that blinds rather than illuminates.
The question the film asks is disturbing. If there really is a pattern in the universe that explains everything, does finding it save a person or destroy him? As Max approaches the pattern he loses his mind, as if that knowledge is heavier than the human mind can bear. What should be remembered while watching is this: this film tells not of the beauty of mathematics but of the price of becoming fixated on it. It should be watched like a warning.
Trailer below
Find it on AmazonProof
2005Adapted from a stage play, the film takes place after the death of a famous mathematician who had lost his sanity. Catherine, who watched over her father's final years, carries both a talent for mathematics and the fear of whether she has inherited his madness. Among her father's notebooks a groundbreaking proof is found, but it is unclear to whom this proof really belongs.
The film's mathematics is largely behind the scenes, because the real issue is not a theorem but a matter of trust. Catherine says the proof is hers, but no one believes her, because the idea that a young woman could achieve such a thing occurs to no one. Here mathematics becomes a ground on which to tell how easily a woman's intellectual labor is ignored.
The real tension is the question of the kinship between genius and madness. If Catherine has inherited her father's talent, she fears she has inherited his illness too. The film does not resolve this fear as neatly as a number, nor does it intend to. What deserves dwelling on while watching is not how the truth of a proof is established, but how fragile the trust a person places in her own mind can be. Mathematics is certain, but the mathematician is not always so.
Trailer below
Find it on AmazonMoneyball
2011On the surface it is a baseball film, but what it tells is the quiet victory of statistics over intuition. Billy Beane, general manager of a low-budget baseball team, realizes he cannot compete with wealthy teams by buying star players. Instead he turns to a method that finds cheap but productive players by looking at statistics traditional scouts disregard. This method rests on data analysis called sabermetrics.
The film's mathematics is invisible yet pervades everything. A player's value is reduced not to how he looks or how famous he is but to cold numbers like on-base percentage. This approach directly challenges the intuition of the experienced scouts who have governed baseball for a hundred years. The film is really the story of an optimization problem: how do you win the most games with a limited budget?
What is striking is that the film tells this data revolution not with a cry of triumph but with melancholy. Beane proves the numbers are right, but that proof also kills something of the spirit of old baseball. What should be thought about while watching is this: reducing a thing to numbers lets us understand it more accurately, but what do we lose of its magic in the process? The film leaves this question open, deliberately.
Trailer below
Find it on AmazonWhat is striking is that almost none of these films try to explain mathematics. They all use mathematics as a pretext and speak of the human being. The symbols on the board are always the guise of something else, of loneliness, stubbornness, fear, or faith.
Travelling Salesman
2012It takes its name from one of the most famous problems in computer science, the travelling salesman problem, but its real concern is the P versus NP question. The film takes place almost entirely in a single room. Four mathematicians discuss the consequences of a vast problem they have solved for the government. What they have solved is a discovery that could suddenly make easy many computations that today seem nearly impossible.
The film's courage lies in turning a scientific concept into an element of suspense. The solution of the P versus NP problem seems at first a wonderful thing. But that solution could also render every encryption system in the world meaningless, because every cipher we consider secure today rests on a computation that takes impractically long to undo. If that computation suddenly becomes easy, all secrets come into the open.
For this reason the film makes you think that a discovery can be frightening rather than joyful. The four mathematicians debate whether the knowledge in their hands will turn into a weapon or a gift. The dialogue is at times too theoretical and the film is visually drab, but intellectually it is bold. The question to ask while watching is this: is solving a problem always a good thing, or is it wiser to keep some doors closed?
Trailer below
Find it on AmazonGifted
2017It tells of a seven-year-old girl with an extraordinary gift for mathematics, caught between an uncle who wants to raise her within an ordinary childhood and a grandmother who wants her to use her genius to the fullest. The child's mother, herself a talented mathematician, took her own life, so throughout the film the question of whether genius is a gift or a curse hangs in the air.
The mathematics in the film is shown through the child easily solving advanced problems, but the real matter does not lie in those scenes. The matter is this: if a child's mind belongs to her, who should decide what is done with that mind? The grandmother wants her granddaughter to become a monument of mathematics, the uncle wants her first to live like a child. Two forms of love clash over who the child will become.
The film does not sanctify genius, on the contrary it stresses that it is a responsibility. Extraordinary talent burdens not only the one who carries it but also those around her. The question to dwell on while watching is simple but not easy: should one feed a child's mind or her happiness, and can these two truly be separated? The film gives no definite answer, because life offers none either.
Trailer below
Find it on AmazonThe Bank
2001This Australian production tells of a young mathematician trying to predict stock market movements with fractal mathematics. A large bank wants to use the model he has developed to profit from the markets. But the mathematician's true intent is other than it appears, and the story slowly turns into a plan of revenge.
The mathematics in the film is built on chaos theory and fractal geometry. The idea that there might be a hidden order beneath the seemingly random movements of markets is both exciting and dangerous. A formula, if it really can predict the market, gives extraordinary power to the one who holds it. The film questions in whose hands this power should rest.
What is interesting is that mathematics is used here as a weapon. The same formula can make a bank rich or bring it down. This leaves behind a fine question about the neutrality of mathematics: an equation in itself is innocent, but does the intent of the hand using it stain the equation? What is seen while watching is this: numbers are not moral, morality lies in the hand of the person using them, and this film examines that hand closely.
Trailer below
Find it on NetflixCube
1997This Canadian cult film, shot on a low budget, tells of a group of strangers who wake in a huge trap made of interconnected cube-shaped rooms. Some of the rooms are full of deadly traps, others are safe. The key to survival is to understand in advance which room is trapped, and this rests on mathematics.
The clever thing about the film is that the escape is hidden in prime numbers. There are numbers on each room, and these numbers determine whether the room is trapped. One of the characters tries to find the safe path through prime factorization. Here mathematics is not an abstract pursuit but a direct means of survival. A computation error means death.
The film is interesting for turning mathematics into an element of suspense. The numbers here are cold and merciless, but at the same time saving. The one who can calculate lives, the one who cannot dies. This is a sharp reply to the widespread belief that mathematics seems so remote from daily life. What should be remembered while watching is this: this film shows not the beauty of mathematics but its raw power, and that power sometimes brings good, sometimes terror.
Trailer below
Find it on AmazonFermat's Room
2007This Spanish thriller begins with four mathematicians invited to a room under the pretext of a dinner. Before long they notice that the walls of the room are slowly closing in on each other. The only way to survive without being crushed is to solve the mathematical puzzles sent to them within a set time. Each correct answer halts the advance of the walls.
The film's mathematics is built on classic puzzles. The riddles that must be solved against the clock make both the characters and the viewer think. But what is truly interesting is how the human mind works under the pressure of the puzzles. The one who can think coolly wins, the one who panics loses. The film stages, almost like a laboratory experiment, how mathematical intelligence behaves under deadly pressure.
Why the characters were lured into this trap is a mystery that slowly comes to light, and it shows that the film's real subject is not mathematics but an injustice done in the past. The puzzles are a means, revenge the end. What is seen while watching is this: intelligence alone is not enough, it needs a reason to direct it, and this film manages to hide that reason until the last moment. A tightly plotted film, less known than it deserves.
Trailer below
Find it on NetflixThe Oxford Murders
2008This mystery set in Oxford is built on the idea that a series of murders follows a mathematical pattern. Each murder seems to be part of a sequence of symbols, and a young mathematics student and a respected professor try to solve this sequence in order to prevent the next murder. It is full of references ranging from Wittgenstein's philosophy to the Fibonacci sequence.
The film's mathematics concerns logic and pattern recognition. Finding the rule of a sequence, guessing what comes after the first few terms, seems easy at first. But here the film lays a fine trap: the same few terms can continue with infinitely many different rules. So the pattern we see may be not the one that really exists but the one we want to see.
This is precisely the film's central idea. The human mind is so inclined to see patterns that it invents an order even where none exists. The truth behind the murders turns out to be different from what is expected, and this stems not from a computational error but from our desire to impose meaning on the world. What deserves dwelling on while watching is this: seeing a pattern does not mean it is real, and this mistake can sometimes be fatal.
Trailer below
Find it on AmazonSneakers
1992It tells of a group of experts who make their living testing security systems and their adventure to seize a mysterious box that can break any cipher. This box rests on a mathematical discovery: a device that can easily solve the hard problem underlying all modern encryption. If such a thing really exists, every cipher in the world becomes meaningless in an instant.
The film's mathematics concerns cryptography and rests, surprisingly, on a solid foundation. Today everything from banking to state secrets relies on factorization being a very difficult operation. If someone finds a method that can do this operation instantly, the entire security system collapses. The film cunningly hides this nightmare inside an entertaining heist comedy.
What is interesting is that the film stresses how dangerous it is for this power to be concentrated in the hands of a single person. Whoever seizes the box gains access to all the world's secrets. Mathematics here is both a great freedom and a great threat. What is seen while watching is this: however elegant a discovery may be, the question of who will hold its power is always more important than the discovery itself.
Trailer below
Find it on AmazonContact
1997Adapted from Carl Sagan's novel, the film tells of an astronomer searching for first contact with an extraterrestrial intelligence. The first meaningful signal from space is a sequence of prime numbers. This choice is the film's cleverest idea, because prime numbers are a message nature would not produce at random, one only a thinking mind could send. So mathematics is the common language of the universe.
The film takes seriously the idea of why mathematics might be universal. Even if two civilizations do not speak the same language or share the same history, prime numbers mean the same thing to both. The appearance of numbers like 2, 3, 5, 7 one after another in a radio signal shows there is an intent behind it. This is one of science fiction's most solidly grounded ideas.
As the story unfolds, the tension between science and faith deepens. The protagonist is a scientist, but the experience she lives turns into something unprovable, and she too must confront a kind of matter of faith. The film is one of the rare Hollywood productions that respects science. What should be remembered while watching is this: if there is someone other than us in the universe, the first bridge we build with them will be made not of words but of numbers.
Trailer below
Find it on AmazonMean Girls
2004It begins as a high school comedy but ends in an unexpected place, a mathematics competition. The protagonist Cady was homeschooled and is quite talented in mathematics. But when she starts high school, she hides her talent in order to be popular, even deliberately getting bad grades in math class. Much of the film is about the absurdity of the desire for social acceptance.
The film's finale takes place at a mathematics competition, where Cady is asked a question about a limit. That moment symbolizes the girl's return to her true self, the self that loves mathematics. When she answers the question correctly, she has really solved not an equation but a decision about who she wants to be. A surprisingly subtle message for a high school comedy.
What is interesting is that the film presents mathematics as a refuge. Beside the volatile and merciless rules of social life, a limit problem has a definite and fair answer. Cady loses at the popularity game, but mathematics is always waiting for her. What is seen while watching is this: sometimes an equation offers firmer ground than the chaos you are in, and the way back to yourself runs unexpectedly through a number.
Trailer below
Find it on AmazonLittle Man Tate
1991Jodie Foster's first directorial effort tells the story of a small child of extraordinary intelligence, Fred. Fred is a talent who could be considered a prodigy in mathematics and many other fields, but at the same time he is the child of a loving yet ordinary mother. The film examines the tension between the child's inner world and the expectations of the outer one.
In the film mathematics appears as a part of Fred's mental world. But the real matter is not a display of talent. The matter is how such a child should be raised. His mother wants him to live a happy and normal childhood, while an academic wants to develop his genius to the fullest. The child is torn between these two worlds.
The question the film asks is the question many films about genius ask, but here it is told through the eyes of the child. Fred is lonely, because neither his peers nor adults can fully talk with him. What deserves dwelling on while watching is this: an extraordinary mind is as much a burden as a gift, and in making a child carry that burden one must not forget that he is first of all a child. The film builds this balance in a warm and plain language.
Trailer below
Find it on AmazonBreaking the Code
1996This television film about the life of Alan Turing was made years before the better-known cinema film on the same subject. It is adapted from a play, and Derek Jacobi's interpretation of Turing offers a plain but deep portrait. The film handles in a balanced way both Turing's scientific genius and the drama he lived through because of his homosexuality.
The most valuable thing about this production is that it does not cut short the mathematical conversations. Unlike the more spectacular cinema adaptation, here Turing's ideas are told at length. Questions such as what computability is, whether a machine can think, and how we can know whether a problem is solvable are woven into the film. So here mathematics is not an ornament but the very substance of the character's mind.
The film is visually plain, even close to theatre, but precisely for that reason it draws nearer to Turing's inner world. It offers a more patient narration in which the thinking mind, not the machine, is at the center. What is seen while watching is this: the same life can be told very differently through different cameras, and sometimes the version free of spectacle portrays the person more honestly. A little-known production, more valuable than it deserves.
Trailer below
Find it on AmazonAntonia's Line
1995This Dutch production, which won the Oscar for Best Foreign Language Film, tells the epic story of a woman and the generations descended from her. It is not remembered as a mathematics film, because it is not one. But within it there is a woman character passionately devoted to mathematics and philosophy, and this character shows how abstract thought can be a refuge.
In the film mathematics appears in the very middle of a rural and ordinary life. Within the cycle of fields, seasons and births, someone sits and thinks about abstract problems. This contrast is fine, because it reminds us that mathematics can be a part not only of universities and cities but of every corner of life. One needs no luxurious setting in order to think, a mind is enough.
The film paints a broad canvas, within it there is birth, death, love and loss. Mathematics is a small but meaningful corner of this canvas. Abstract thought becomes, even in the most concrete and rural life, an escape, a consolation, a source of meaning. What should be remembered while watching is this: mathematics is not a profession but a way of looking at the world, and that way can sprout in the most unexpected places, in the minds of the plainest people.
Trailer below
Find it on AmazonAgora
2009It takes place in late fourth-century Alexandria and tells of a real historical figure, the mathematician and philosopher Hypatia. Hypatia is a scholar trying to understand the movements of the heavenly bodies, questioning why orbits are not perfect circles. The film portrays her as a researcher who approaches the idea of the ellipse, thinking far ahead of her age.
The film's mathematics is intertwined with astronomy. There are scenes in which Hypatia tries to explain planetary motion, wrestling with the contradictions of the model that places the earth at the center. In these scenes science struggles to breathe under the pressure of religious dogma. The destruction of the Library of Alexandria stands at the film's center as the most bitter symbol of the fragility of knowledge.
What it really tells is the clash of reason and intolerance. Hypatia is seen as dangerous because she keeps asking her questions, and in the end she pays the price with her life. The film takes liberties with some historical details, but it powerfully shows a scientist's loneliness before the fanaticism of her age. What should be remembered while watching is this: knowledge is always crushed between those who want to protect it and those who want to destroy it, and sometimes the losing side is knowledge.
Trailer below
Find it on Amazon21
2008It tells of a group of MIT students who, led by a professor, win money from Las Vegas casinos through card counting. It is inspired by a true event. The film's mathematics is built on probability and expected value. Card counting is not magic, it is the discipline of catching the moments when the probability of winning turns in one's favor by tracking which cards remain in play.
The film is one of the rare productions that shows how probability turns into concrete money at the table. In blackjack every hand is a decision problem, and when played correctly the gain becomes, over the long run, mathematically inevitable. The protagonist wins as long as he behaves like a cold calculating machine. The problem is that people are not calculating machines.
Because as the winnings grow, arrogance and greed seep into the protagonist. Mathematics gives him an advantage, but over time he loses the composure to protect that advantage. The film offers a fine lesson here: even the right calculation is useless once the person doing it loses his discipline. What is seen is this, numbers are neutral but the person using them is not, and most losses come not from the mathematics but from the emotions that make one forget it.
Trailer below
Find it on AmazonThe Imitation Game
2014It tells of the effort of Alan Turing and his team to break the Nazis' Enigma encryption machine during the Second World War. Turing sees that solving the cipher by hand is impossible and argues that a machine can only be defeated by another machine. He builds the device considered today the ancestor of the computer. In the film mathematics is not an abstract pursuit but the concrete means of winning the war. Each day the cipher goes unbroken means ships sinking at sea and people dying.
Yet the film carefully avoids being a cold engineering tale. Turing's social awkwardness, his loneliness, and the persecution he suffers because of his homosexuality stand at the very center of the story. The man who broke Enigma is, after the war, declared a criminal by his own country and forced into chemical castration. The film's bitter equation is this: a mind that saved millions of lives is broken by the society that ordered his own.
Dramatic liberties have been taken with historical details, the real Enigma effort was far more crowded and disordered than shown in the film. Even so, the film's real achievement is making visible the human cost behind a computational problem. It should be remembered while watching: the hardest thing Turing solved was not Enigma, the thing he could not solve was the blindness of the age he lived in.
Trailer below
Find it on AmazonHidden Figures
2016There was a time when the word computer described not a machine but a person. Before electronic machines entered the room at NASA, there were people who did orbital calculations by hand, and most of them were women. The film tells the true story of three African American mathematicians working in the American space program in the early 1960s. Katherine Johnson computes the orbital equations that put John Glenn into Earth orbit.
The film's approach to mathematics is quite concrete. There are scenes in which Katherine works at the board with analytic geometry, trying to verify the new electronic computation with the old methods. Here mathematics is not an abstract display of genius but the responsibility of bringing the human inside a rocket back safely. A sign error means the death of an astronaut, so the accuracy of the computation is a matter of life.
Its real strength is placing the neutrality of mathematics and the injustice of society side by side. Numbers do not care who computes them, but the Virginia of the 1960s does. Katherine having to run to a bathroom at the far end of the building in order to do her calculations is one of the film's most shattering scenes. What is seen while watching is this: talent was always there, the only thing missing was a world that allowed it.
Trailer below
Find it on Amazon





