Polygons and Archimedes' method for approximating $\pi$

A couple of days ago, I worked out the solution to Konigsberger I (2.7) which deals with Archimede’s method for approximating $\pi$ by means of nested intervals. I found the approach intriguing, in particular the trigonometry-based way to determine the area of the inscribed and circumscribed regular polygons in the unit circle that both converge to the same value, $\pi$, for $n \to \infty$. In the following, I want to present the solution in detail including the derivation of the polygon area.

Preliminaries

Let us fix some notation and terminology:

$f_n$ represents the area of the regular polygon with $n$ vertices, or $n$-gon, that is inscribed in the unit circle and $F_n$ the analogue for the circumscribed regular polygon. $I(\cdot)$ represents the area of a geometric object. For some positive numbers $a, b$ let $G(a, b)$ denote the geometric mean and $H(a, b)$ the harmonic mean.

Inscribed and circumscribed $n$-gons

In order to construct nested intervals that lead to an approximation of $\pi$, let us first derive an explicit formula for both $f_n$ and $F_n$. The derivations of these – which Konigsberger does not mention in detail – are based on geometric considerations. The following picture was produced in Tikz and shows both inscribed as well as circumscribed regular polygons for $n = 4, 5, 6, 12$ vertices. The main idea is to decompose all polygons in a number of congruent triangles whose angle with the circle midpoint is identical for all triangles. The triangles for all $n$ are created by connecting each vertex with the circle midpoint.

For the case of $n = 5$, I marked one triangle red for both the inscribed as well as the circumscribed case. It is clear that determining the area of the polygon reduces to determining the area of one triangle and then multiply that with the number of triangles the polygon is composed of. For the case of the inscribed polygon this is easy.

Since both sides of the triangle that span from the circle midpoint to the respective vertex have length 1, we only need to find the height of the triangle to calculate its area. But according to the law of sines, we have that the height is equal to $\sin(\alpha)$ and hence the area of the triangle is given as $I(\triangle_{i, n}) = \frac{1}{2} \sin(\alpha)$. Therefore, the area of the polygon itself is given as $f_n = \frac{n}{2}\cdot \sin(\alpha)$. Note that $\alpha = \frac{2\pi}{n}$ due to the triangles being congruent.

The area of the circumscribed polygon is similarly derived but a bit more complicated. First, we have to divide each triangle again into two congruent triangles with adjacent side length 1 and angle $\frac{\alpha}{2}$. The unknown side length of the hypotenuse is then given as $(\cos(\frac{\alpha}{2}))^{-1}$ by means of elementary trigonometry. Hence, the area of the original (whole) triangle is given as

$$ I(\triangle_{c, n}) = \frac{1}{2}\Big((\cos(\alpha)\Big)^{-2}\sin(\alpha) = \frac{1}{2}\Big(\frac{2}{1 + \cos(\alpha)}\Big)\sin(\alpha) = \frac{\sin(\alpha)}{1 + \cos(\alpha)} = \tan\Big(\frac{\alpha}{2}\Big) $$

and whence the area of the polygon as $F_{n} = n\tan\Big(\frac{\alpha}{2}\Big)$.

In total, we have derived the formulas $f_n = \frac{n}{2}\sin\Big(\frac{2\pi}{n}\Big)$ and $F_n = n\tan\Big(\frac{\pi}{n}\Big)$.

GM-HM-relationship between $f_n$ and $F_n$

There is a recursive relationship between $f_n$ and $F_n$ that involve the geometric and harmonic mean:

$$ f_{2 n} = n \sin(\frac{\alpha}{2}) = n \sqrt{\frac{1 - \cos\Big(\alpha\Big)}{2}} = n\sqrt{\frac{1}{2}\sin\Big(\alpha\Big)\frac{1-\cos(\alpha)}{\sin(\alpha)}} = \sqrt{\frac{n\cdot n}{2}\sin(\alpha) \tan\Big(\frac{\alpha}{2}\Big)} = \sqrt{f_n F_n} = G(f_n, F_n) $$

and similarly,

$$ F_{2n} = H(f_{2n}, F_n) $$

It’s obvious that $F_n - f_n \geq 0$ for all $n \in \mathbb{N}$.

Nested intervals

Define $I_k := [a_k, b_k]$ with $a_k := f_{3\cdot 2^{k}}$ and $b_k := F_{3\cdot 2^k}$. Next, we show that $I_k$ is a nested interval. For this, we have to demonstrate that

(a). $I_{k + 1} \subset I_k$ for all $k \in \mathbb{N}$.

(b). $\forall \epsilon \; \exists k \in \mathbb{N}: \vert I_k \vert = b_k - a_k < \epsilon$.

With regard to (a)., it is clear that

$$ a_{k + 1} = f_{3\cdot 2^{k + 1}} = G(f_{3\cdot 2^k}, F_{3\cdot 2^k}) = \sqrt{f_{3\cdot 2^k}F_{3\cdot 2^k}} \geq f_{3\cdot 2^k} \iff F_{3\cdot 2^k} \geq f_{3\cdot 2^k} $$

and

$$ b_{k + 1} = F_{3\cdot 2^{k + 1}} = H(f_{3\cdot 2^{k + 1}}, F_{3\cdot 2^k}) \leq G(f_{3\cdot 2^{k + 1}}, F_{3\cdot 2^{k}}) = \frac{f_{3\cdot 2^{k + 1}} + F_{3\cdot 2^k}}{2} \leq \frac{2\cdot F_{3\cdot 2^k}}{2} = F_{3\cdot 2^k} = b_k $$

which proves the claim.

With regard to (b)., we have that

$$ b > a \implies \frac{b}{2} > \frac{a}{2} \implies G(a, b) \geq a $$

as well as

$$ \frac{\textnormal{d}}{\textnormal{d}a} H(a, b) = 2b\frac{1}{a + b} - 2ab\frac{1}{(a + b)^2} = \frac{2b^2}{(a + b)^2} > 0 $$

which implies

$$ G(a, b) - H(G(a, b), b) \leq G(a, b) - H(a, b) $$

In sum, we have $G(a, b) - H(a, b) \leq \frac{1}{2}(b - a)$ and $b_{k+1} - a_{k+1} \leq \frac{1}{2^k}(b - a)$, so we conclude that for every $\epsilon > 0$ we can find a $k \in \mathbb{N}$ such that $I_k < \epsilon$. Consequently, $I_k, k \in \mathbb{N}$ are nested intervals.

Approximating $\pi$

By now, we know that $a_k \leq \pi \leq b_k$ for all $k \in \mathbb{N}$. In this fashion, Archimedes calculated the area of the inscribed and circumscribed 192-gon to approximate $\pi$. We may produce some lines of code to approximate $\pi$ with the help of these nested intervals. Obviously, the approach itself uses $\pi$ but this does not invalidate the illustrative purpose of the method.

Inscribed.Circle = function(k){
      return((k/2)*sin((2*pi)/k))
}

Circumscribed.Circle = function(k){
      return(k*tan(pi/k))
}

Nested.intervals = function(k){
     IC = format((Inscribed.Circle(3*(2^(k - 1))) + Circumscribed.Circle(3*(2^k)))/2, digits = 15)
     CC = format((2*Circumscribed.Circle(3*(2^(k-1)))*Inscribed.Circle(3*(2^k)))/(Circumscribed.Circle(3*(2^(k-1))) + Inscribed.Circle(3*(2^k))), digits = 15)
    return(cat("Pi is between", IC, "and", CC, "."))
}

For $k = 6$ we arrive at a 192-gon and hence at Archimede’s result:

> Nested.intervals(6)
Pi is between 3.14061162651335 and 3.14187304997982

and for $k = 10$, which means a polygon with $3072$ vertices,

> Nested.intervals(10)
Pi is between 3.14158882045983 and 3.14159374877135 .

The exact value of $\pi$ to 15 digits is

> format(pi, digits = 15)
[1] "3.14159265358979"

so, all in all, this already is a good approximation.

Epilogue

There is more to say about $f_n$ and $F_n$. For example, one can show that $\lim\limits_{n \to \infty} f_n = \frac{n}{2}\sin(\frac{2\pi}{n}) = \pi = \lim\limits_{n \to \infty} F_n$. Especially the first limit is famous in classic calculus. Also, the limit reflects precisely the fact that $\pi$ lies in all intervals $I_k$.