Back to Movie Clips

The Mathematician's Mambo

“Three lights. One rule. One astonishing fractal.”

The Mathematician’s Mambo — what’s going on?
Mathematician's Mambo intro screen: three colored floor lights, one rule, infinite dots

This animation was originally built in Adobe Flash around 2011 as a classroom demonstration for TNT’s early programming courses. Because Flash was discontinued in 2020, the original .swf file no longer runs in any modern browser — so what you’re watching is a screen recording captured before Flash went dark.

The premise is deceptively simple: three colored floor-lights are placed at the corners of a triangle on a dance floor. A mathematician stands somewhere on the floor. At each beat:

  1. One of the three lights blinks at random.
  2. The mathematician moves halfway to that light.
  3. The dance floor lights up at his new position in the blinking light’s color — and stays lit.

Repeat… tens of thousands of times. What do you expect? A random smear of colored dots? That’s the intuition — and it is spectacularly wrong.

What actually emerges is the Sierpiński Triangle — one of the most famous fractals in mathematics — assembled, dot by dot, from pure randomness. The mathematician never follows a script; chaos writes the pattern for him.

The deeper idea: This algorithm is known as the Chaos Game, described by mathematician Michael Barnsley in 1988. It reveals that deterministic rules applied to random inputs can produce precise, infinitely detailed structure — a cornerstone idea in fractal geometry and dynamical systems.
Flash is dead — Processing lives on!   The Mathematician’s Mambo has been rebuilt from scratch in Processing / p5.js. The new version runs natively in any modern browser — no plugins, no Flash, no excuses.

Run the Math Mambo Saga — Stage 4 →

Movie clip is only available in larger viewports.
On some mobile devices, rotating to landscape will allow viewing.

The Original Flash Animation (screen recording, c. 2011)

The Music: “Boogie Fever” — The Sylvers (1976)

The Sylvers were a family group from Los Angeles — ten siblings ranging in age from toddler to teenager — who became one of the defining acts of mid-’70s soul and funk. Their biggest hit, “Boogie Fever,” was written and produced by Freddie Perren and Kenny St. Lewis and released in early 1976. The irresistible groove climbed all the way to #1 on the Billboard Hot 100 in March of that year, spending one week at the top and becoming a signature sound of the disco era.

The song’s playful hook and rolling bass line made it the perfect soundtrack for a mathematician who just… can’t stop dancing.