đď¸ The Algorithm Museum
An algorithm is a recipe: a list of exact steps that anyone, or any computer, can follow to solve a problem. Some of the best ones are thousands of years old and still run inside every phone.
In each room you can run an algorithm yourself, one step at a time, and see why it works. Use the Step button (or the â key) to go forward, Back (â) to rewind, and Play to watch.
Numbers wing
The Sieve of Eratosthenes
about 240 BC ¡ Alexandria
Find every prime up to 100 by crossing out everything that isn't one. Includes Ulam's prime spiral.
Euclid's Algorithm
about 300 BC ¡ Alexandria
Find the greatest common divisor of two numbers by cutting a rectangle into squares.
Fast Powers by Squaring
over 2,000 years old ¡ India
Compute giant powers on a clock in a handful of steps: the engine inside RSA.
Searching wing
Words wing
Order wing
Rooms being built
- Huffman coding (1952): squeeze a message by giving common letters short codes
- Dijkstra's shortest paths (1956): the maze, but with roads of different lengths
- The extended Euclidean algorithm: build an RSA private key
- Caesar and Vigenère ciphers, and how frequency counting breaks them
- Conway's Game of Life (1970): simple rules, surprising patterns