Math Applets

Geometric series

Geometric series (special case):
14+(14)2+(14)3+=13. \frac14+\left(\frac14\right)^2+\left(\frac14\right)^3+\cdots=\frac13.

More generally, for r<1|r|<1,

k=1rk=r1r. \sum_{k=1}^{\infty} r^k=\frac{r}{1-r}.

How to use the applet

  • Move the slider NN to display the first NN shaded triangles.
  • Start with the large triangle T1T_1.
  • In any triangle, connect the midpoints of its sides. The central (medial) triangle has side length scaled by 12\tfrac12, hence area scaled by (12)2=14(\tfrac12)^2=\tfrac14.
  • In the applet, at step kk the shaded triangle has area
(14)k \left(\frac14\right)^k

(relative to the area of the original triangle).

  • As NN increases, you are adding areas
14, (14)2, (14)3,  \frac14,\ \left(\frac14\right)^2,\ \left(\frac14\right)^3,\ \dots

so the total shaded area approaches a limit.

  • The construction partitions the current triangle into 4 congruent triangles each time: 1 shaded + 3 unshaded. Repeating this indefinitely shows the shaded region approaches one third of the whole triangle, matching the sum 13\frac13.
Loading graph…
  • Hold Shift + scroll to zoom
  • Hold Shift + drag to move
  • Points shaped like <> act as sliders

Description

Link to code.
This is quiet experimental and not related to the lecture notes. Paper reference: https://arxiv.org/pdf/2006.05062

This applet reproduces a classical picture that gives a visual proof of

14+(14)2+(14)3+=13. \frac14+\left(\frac14\right)^2+\left(\frac14\right)^3+\cdots=\frac13.

Move the slider N to show the first NN shaded triangles. Each new shaded triangle represents the next term of the geometric series.

The construction uses the midpoint triangle: inside any triangle, connect the midpoints of the three sides. The small “central” triangle has side length scaled by 12\tfrac12, hence its area is scaled by (12)2=14(\tfrac12)^2=\tfrac14. In the applet, at each step we shade this midpoint triangle, then repeat the same construction in the smaller top triangle. Therefore the shaded areas are

14, (14)2, (14)3, \frac14,\ \left(\frac14\right)^2,\ \left(\frac14\right)^3,\dots

and the total shaded area is their sum.

A second viewpoint explains why the total shaded area is 13\tfrac13 of the big triangle: at every step, the current triangle is partitioned into four congruent triangles. One of them is shaded, while the other three form the “remainder” to be subdivided at the next step. This creates layers whose total area is exactly three times the shaded area in each layer, so the union of all shaded triangles occupies one third of the whole triangle.

In the code, the midpoint construction is implemented by repeatedly computing midpoints and drawing the corresponding shaded triangle.

const TL = mid(T, L);
const TR = mid(T, R);
const LR = mid(L, R);
// shade triangle [TL, TR, LR] (area = 1/4 of [L, R, T])