Lesson goal: Infinite Inscribed Squares and Circles

Previous: Zoom in or out | Home | Next: Checkerboard disc coverage

In the 1966 MAA High School Mathematics Contest (Problem #20), contestants analyzed this geometric progression: A circle is inscribed in a square of side $s$. Then a square is inscribed in that circle, then a circle in that square, and so on infinitely. What happens to the areas of the figures? Let's trace the geometry centered at the Cartesian origin $(0, 0)$: 1. The outer square has side $s$, so its half-width is $h = s / 2$. Its area is $A_1 = s^2$. 2. The circle inscribed in this square has radius $R = h$. 3. The next square is inscribed inside this circle. By the Pythagorean theorem, its diagonal equals the diameter $2R$, which means its half-width is $h / \sqrt{2}$. Its area is $(s / \sqrt{2})^2 = \frac{1}{2} s^2$. Each successive square has half the area of the previous square! The total area of all nested squares forms an infinite geometric series: $$S = s^2 + \frac{1}{2}s^2 + \frac{1}{4}s^2 + \frac{1}{8}s^2 + \dots$$ Using the infinite geometric sum formula $S = \frac{a}{1 - r}$ with common ratio $r = 1/2$: $$S = \frac{s^2}{1 - 1/2} = 2s^2$$ In this lesson, we will use CodeByMath's canvas drawing functions (line and circle) to draw these nested figures and calculate their total area!
circle(0, 0, h)
line(-h, -h, h, -h)

line(h, -h, h, h)

h = h / math.sqrt(2)
Move the mouse over a dotted box for more information.

Notice how the circle touches each square at exactly 4 tangent points: $(0, h), (0, -h), (h, 0), (-h, 0)$.

Now you try. Replace ???? with h / math.sqrt(2). Run the code to watch the nested geometric figures draw on the screen and see the sum of areas approach $2 s^2 = 80000$!

Type your code here:


See your results here: