Liu Hui's π algorithm
Liu Hui's π algorithm
Liu Hui, a Chinese mathematician from the 3rd century, gave a famous method to calculate π by refining inscribed polygons inside a circle. Instead of Archimedes’ circumference approach, he showed how to use the areas of polygons with more and more sides to get closer to the circle’s true area.
How the method works
- Each inscribed polygon fits inside the circle. The more sides it has, the closer its area is to the circle’s area.
- If A_N is the area of an N-gon inscribed in a circle of radius r, then doubling the number of sides to 2N gives a new area A_{2N} = m · r, where m is the side length of the 2N-gon.
- Liu Hui started with a hexagon (6 sides) inside the circle. He then found the side length m of the next polygon (a 12-gon) using right triangles formed by bisecting sides. The key relation is:
m^2 = (M/2)^2 + j^2, where:
- M is the previous side length (of the N-gon),
- G = sqrt(r^2 − (M/2)^2),
- j = r − G.
In words: you compute a little triangle, use the Pythagorean theorem, and that gives the next polygon’s side length.
- Repeating this process doubles the number of sides each time (12, 24, 48, 96, …). The area of each polygon is A_{2N} = m · r, so you get progressively better approximations to the circle’s area, and thus to π.
The quick method
- Liu Hui also introduced a faster way to improve the estimate without doing many square roots.
- Let D_N = A_N − A_{N/2} be the difference in areas between successive orders.
- He observed that the ratio D_N ≈ (1/4) · D_{N/2} when N is large. Using this, he could estimate the area of very high-order polygons without all the heavy calculations.
- He defined a quantity C for the circle’s area (when the circle has radius 1) and showed the inequality:
A_{2N} < π < A_{2N} + D_{2N}.
This means the true π lies between the area of the 2N-gon and that area plus the extra small “difference” D_{2N}.
A concrete result
- With a circle of radius 1, Liu Hui found that using a 192-sided polygon gives a good estimate:
π is between A_{192} and A_{192} + D_{192}, and a refined computation using the quick method gave
π ≈ A_{192} + (1/3) · D_{192} ≈ 3.1410319509 + 0.0005605826 ≈ 3.1415925335.
- This matches π to eight decimal places and shows how the area-based approach can reach very high accuracy with surprisingly little labor for the time.
Why it was important
- Liu Hui’s π algorithm was one of the earliest systematic methods in ancient China for calculating π to any desired accuracy, using a clear iterative process based on areas rather than perimeters.
- The approach demonstrated the idea that by cutting a circle into many tiny pieces (polygons) and adding up their areas, you could get as close as you like to the circle’s true area.
- His work influenced later mathematicians, including Zu Chongzhi, who pushed the method to even higher accuracy with incredibly large polygons (up to 12,288 sides).
Significance
- Liu Hui showed a rigorous, repeatable way to approximate π, marking a major advance in ancient mathematics.
- His area-based method contrasted with the Archimedean perimeter approach and helped set the stage for more precise calculations of π in many centuries to come.
This page was last edited on 29 January 2026, at 05:09 (CET).