Movies + Math = A Beautiful Formula

Whether you love mathematics or roll your eyes when the topic is brought up, here are five films that blend arithmetic with spies, crime, sci-fi, and mystery to entertaining perfection.

Note: spoilers abound.

Cube (1997)

Five people wake up trapped inside some kind of mechanical maze, room after room, each with a series of doors leading to more cube-shaped rooms, but no exits. Some quarters are safe and others have motion detectors that set off lethal traps that fry, slice, and dice, etc.

Joan Leaven (Nicole de Boer) is a gifted student with mathematical skills. She notes every room has a series of numbers at the entrance: “Prime numbers! Prime numbers!” (numbers that are only divisible by one and itself) she exclaims, but it’s soon apparent that isn’t enough to get them out, and each prisoner will have to utilize their ingenuity to help them avoid the traps planted inside the cube. Given some crucial information by one of the members, Leaven estimates there are 17, 576 rooms, and eventually she realizes the numbers are coded Cartesian coordinates that offer an explanation of where they are in the cube.

But, each of the other captives—a police officer, doctor, architect, and autistic man—also unwittingly hold valuable clues to their escape. Low-budget (allegedly made for $350,000) but tension filled. The concept of the cube design was calculated by mathematician David W. Pravica. It’s been noted that Cube shares some similarities with The Twilight Zone’s “Five Characters in Search of an Exit.”

A Beautiful Mind (2001)

John Forbes Nash, Jr. (Russell Crowe), a brilliant math student from Princeton’s graduate program, gets a job with MIT’s mathematics department. He eventually finds the work less than rewarding, until an offer to be a code breaker comes from a William Parcher (Ed Harris) of the Department of Defense in dangerous cloak and dagger maneuvers against the Soviets.

The film, sharply directed by Ron Howard, chronicles Nash’s slip into paranoid schizophrenia, which derailed him from his academic career for a quarter of a century. Jennifer Connelly is excellent (she won a Best Supporting Actress award from the Academy, among others) as his compassionate wife, Alicia, who desperately tries to cope in understanding what he’s going through, ultimately discovering the truth behind Parcher and other characters in his life.

Based on the Pulitzer nominated book by Sylvia Nasar—highly recommended if you want to delve farther into this enigmatic personality—the movie follows through to 1994 when Nash was awarded a Nobel Prize in Economics for his game theory work. Best lines come from Christopher Plummer as Dr. Rosen, when he explains to Nash that the mathematician can’t reason his way out of his predicament.

The Number 23 (2007)

Ok, before anyone starts leaving critical comments, I’m quite aware The Number 23 is not in the same artistic universe as the other films on this list. It’s lot of paranoid silliness…and a whole lot of fun to watch as Jim Carrey (he was nominated for a Golden Raspberry Award for Worst Actor) goes off the deep end—even farther than normal.

The plot revolves around the 23 enigma, made well-known by William S. Burroughs that this prime number is responsible for a large number of coincidences in daily life, which was based on an early 20th-century slang “getting (to leave) while the getting’s good.”

Carrey plays Walter Sparrow, an animal control officer whose wife, Agatha (always top of her game Virginia Madsen), discovers a book written by Topsy Kretts that she gives to Walter as a present. Bad, bad mistake, Agatha. Her hubby soon believes that he is not only the author, but a detective named Fingerling, and he has nightmares of murdering Agatha. The film, and Carrey’s performance, ends up on a lot of worst lists, and I’ll argue that’s part of the charm if you are in the mood for a little mathematical, campy entertainment.

21 (2008)

College is expensive. Ask any debt-ridden grad and they can identify with Ben Campbell (Jim Sturgess) in 21.

He's a brilliant mathematics student at MIT who is accepted into Harvard Medical School, but there’s one expensive catch: he can’t come up with the steep $300K tuition. So, he joins Professor Micky Rosa’s (Kevin Spacey) blackjack team to take on the casinos, with the intention of only staying long enough to collect the medical school fee. Of course, as any true gambler will tell you, getting out is easier said than done.

The film is based on real life Jeff Ma, who has a cameo in the film, and Ben wittily refers to him as a “brother from another mother.” The Monty Hall problem brain teaser that Micky proposes to Ben was created by Steve Selvin.

Suppose you're on a game show, and you're given the choice of three doors: Behind one door is a car; behind the others, goats. You pick a door, say No. 1, and the host, who knows what's behind the doors, opens another door, say No. 3, which has a goat. He then says to you, “Do you want to pick door No. 2?” Is it to your advantage to switch your choice?

Before clicking here for the answer, what’s your educated guess?

The Imitation Game (2014)

Before this movie, starring Benedict Cumberbatch as Cambridge professor Alan Turing (1912-1954), there’s a good chance that a majority of people had never heard of the mathematician now regarded by many as the father of artificial intelligence—and whose research shaved a couple years of World War II, thus saving countless lives.

How did his heroics go so long unnoticed?

For one, his work for British Intelligence was that far ahead of its time, staying classified for fifty years. Sadly, the other reason was that he was a homosexual. Busted on a ridiculous indecency charge in the early 1950s, he was given the choice of prison or DES (chemical castration), of which he chose the drugs—eventually he killed himself with a cyanide-laced apple.

What a shame, and who knows how much farther ahead we would have been technologically if our myopic society hadn’t decided to dictate “normal.” As the equally brilliant Joan Clarke (1917-1996) (played by Keira Knightley) noted, thankfully Alan wasn’t like everyone else because that keen mind not only built a foundation for the future of artificial intelligence, but helped win the war. Like Nikola Tesla, he was the right man at the right time, but only appreciated by the future he helped create.


David Cranmer aka Edward A. Grainger is the publisher and editor of BEAT to a PULP books and author of The Drifter Detective #7: Torn and Frayed. He lives in New York with his wife and daughter.


  1. Charles Gramlich

    Cube was a really fascinating movie. They made a couple of sequels too which were also interesting.

  2. David Cranmer

    And I heard they are making a big budget remake though I’m not sure why because the first film despite its humble origins is about perfect.


    Haven’t seen one of these, A Beautiful Mind and The Imitation Game are true stories about people who commit suicide. Both sound interesting.

  4. Oscar Case

    Please deleete my comment.. Only one person committed suicide, I guess.
    Wouldn’t mind seeing both Mind and Imitation.

  5. David Cranmer

    Understand what you meant, Oscar. And if I had to pick one film on the list to start with I’d go with A Beautiful Mind. It actually awakened my deeper interest in mathematics.

  6. Terrie Farley Moran

    Fascinating post. You are a genius. I left the goats and cars for brighter minds. Terrie

  7. David Cranmer

    Terrie, I’m liking the genius title. Please continue to spread around.

  8. Prashant C. Trikannad

    David, I have only seen “A Beautiful Mind” and though I liked the film and Crowe’s portrayal of John Nash’s life, I didn’t really notice the math on the blackboard and window panes. Well, you know how it is with me and math! Although it does not “blend arithmetic with spies, crime, sci-fi, and mystery,” I thought “Good Will Hunting” was also a nice film set around math.

  9. David Cranmer

    Good Will Hunting remains a top film and one I’ve seen many times. Like you noted it didn’t serve my purposes here. Another good drama with math elements is Stand And Deliver starring Edward James Olmos. And I will work on getting you interested in mathematics yet, Prashant! Wait and see.

  10. Math Calculator

    Thanks for sharing the best combination of doing math. I also share a method i always doing math with Music and also very interested when using Online Math Calculator for time saving and get fast with accurate results.

Comments are closed.

The owner of this website has made a commitment to accessibility and inclusion, please report any problems that you encounter using the contact form on this website. This site uses the WP ADA Compliance Check plugin to enhance accessibility.