03 / 10 · Square roots
Heron's method
Squeezing a rectangle into a square
How does a calculator find √20? One of the oldest methods, used in Babylon and written down by Heron of Alexandria around 60 AD, is still close to what computers do.
Start with any guess, say 2. Build a rectangle with area 20 and one side 2. The other side must be 20 ÷ 2 = 10. A 2 × 10 rectangle is far from square: the true side is somewhere between 2 and 10.
guess x → other side = N ÷ x next guess = (x + N ÷ x) ÷ 2 N = 20: 2 → 6 → 4.667 → 4.476 → 4.4721
Try it · Pick a number and a first guess, then press Next step. Watch the rectangle turn into a square and the digits settle in the table.
Loading…
So take the average of the two sides: (2 + 10) ÷ 2 = 6. Now build a 6 × 3.33 rectangle. Still not square, but closer. Average again: 4.667. Then 4.476. Then 4.4721…
Each step roughly doubles the number of correct digits. After four or five steps the rectangle is a square to within the width of a hair, and its side is √20.
Key ideas
Words worth remembering
- Iteration
- Repeating the same step, each time starting from the last answer.
- Convergence
- Getting closer and closer to a fixed answer as the steps go on.
Think about it
Why does averaging the two sides always land between the guess and the true root?