# The Big Internet Math-Off 2024, Quarter-final 1

Here’s the first quarter-final match of The Big Internet Math-Off. Today, we’re pitting Benjamin Dickman against Matt Enlow.

Take a look at both pitches, vote for the bit of maths that made you do the loudest “Aha!”, and if you know any more cool facts about either of the topics presented here, please write a comment below!

## Benjamin Dickman – Thinking Outside the Magic Box

Prelude: If you’ve arrived at Round 2 of the Big Internet Math-Off 2024 less as a mathemagician and more as an equation solver, rest assured: We will find a solution to $$157x + 225y = 1$$ over the integers by the end of this post. (And hopefully encounter deeper and more fascinating mathematics along the way!)

In the previous round, I wrote about what I learned in the previous summer at PCMI. In the current round, I am writing about what I’m learning in the current summer at PROMYS for Teachers. This involves continued fractions, which I will call cons, and something called the Magic Box for an algorithm described below.

Cons pop up in all sorts of con-texts; often, one is seeking (increasingly accurate) rational estimates for irrational numbers. Here, though, we start off in $$\mathbb{Q}$$ (but see the Notes for less rational matters).

Con-sider, for reasons not yet clear, the con $$1 + 1/(2 + 1/(3 + 1/(4 + 1/5)))$$ which can be written:

$\huge{1 + \frac{1}{2 + \frac{1}{3 + \frac{1}{4 + \frac{1}{5}}}}}$

Pros with cons would express this as [1; 2, 3, 4, 5].

WolframAlpha computes that this con is equivalent to 225/157. Let’s use the magic box to compute the same!

The setup has three rows: the top one has a bit of magic followed by the numbers that appear in the con; the middle row begins with 0, 1, then blanks underneath each con number; the bottom row begins with 1, 0, then blanks underneath blanks.

Let’s carry out the algorithm row by row (you might skip ahead to Figure 2 for a con-crete example worked out).

For the middle row, multiply its column header by the entry one earlier in the row, and add this product to the entry two earlier in the row.

This begins with: $$1 \times 1 + 0 = \color{#cf2e2e}{1}$$, then $$2 \times 1 + 1 = \color{#ff6900}{3}$$, then $$3 \times 3 + 1 = \color{#00d084}{10}$$.

For the bottom row, do the same [I’ll copy and paste]: multiply its column header by the entry one earlier in the row, and add this product to the entry two earlier in the row.

This begins with: $$1 \times 0 + 1 = \color{#cf2e2e}{1}$$, then $$2 \times 1 + 0 = \color{#ff6900}{2}$$, then $$3 \times 2 + 1 = \color{#00d084}{7}$$.

The result (e.g., for step three: multiply the underlined numbers then add the italic number for 10):

Success! The final column, in purple, reveals the con (if not the trick): 225/157. But what did we calculate along the way?

The rainbow colored columns indicate the convergents that provide estimates for 225/157, and which can be found by computing the initial segments of our con:

\begin{align} 1 &= {\color{#cf2e2e} \frac{1}{1}} \\[1em] 1 + \frac{1}{2} &= {\color{#ff6900} \frac{3}{2}} \\[1em] 1 + \frac{1}{2 + \frac{1}{3}} &= {\color{#00d084} \frac{10}{7}} \\[1em] 1 + \frac{1}{2 + \frac{1}{3 + \frac{1}{4}}} &= {\color{#0693e3} \frac{43}{30}} \end{align}

Our fourth convergent is $$43/30 = 1.4\bar{3}\ldots$$ which is impressively close to $$225/157 = 1.433121\ldots$$

But wait – there’s more! Look at the 2×2 tables formed as we moved along the middle and bottom rows, and take the difference of their cross products. In other words, consider $$ad-bc$$ for each sub-table of the form:

What do we get as we move across the 2×2 tables in Figure 4’s Magic Box?

\begin{align} -1 &= 0 \times 0 – 1 \times 1 \\[0.5em] 1 &= 1 \times {\color{#cf2e2e} 1} – {\color{#cf2e2e} 1} \times 0 \\[0.5em] -1 &= {\color{#cf2e2e} 1} \times {\color{#ff6900} 2} – {\color{#ff6900} 3} \times 1 \\[0.5em] 1 &= {\color{#ff6900} 3} \times {\color{#00d084} 7} – {\color{#00d084} 10} \times {\color{#ff6900} 2} \\[0.5em] -1 &= {\color{#00d084} 10} \times {\color{#0693e3} 30} – {\color{#0d93e3} 43} \times {\color{#00d084} 7} \\[0.5em] 1 &= {\color{#0693e3} 43} \times {\color{#9b51e0} 157} – {\color{#9b51e0} 225} \times {\color{#0693e3} 30} \end{align}

Observe that this last line provides an integral solution to $$157x + 225y = 1$$, as promised in the prelude! In particular, we can take $$(x, y) = (43, -30)$$.

A real mathemagician never reveals their tricks, but in the spirit of this being a con-test, I include exploratory problems as Notes for the reader looking to understand a bit more.

### Notes

0. I ended my previous entry with a tombstone, and I started this one with a title-acronym of TOMB.

1. You may have seen (otherwise, you will see) that the golden ratio – which, incidentally, is Mr. Enlow’s topic for today! – is represented as the infinite con: [1; 1, 1, 1, …]

If you fill out the Magic Box below, what do you notice? What do you wonder?

2. Suppose our con is [1; 2, 2, 2, …], i.e., an initial 1 and then infinitely many 2s. Can you fill out the Magic Box below and use its first few convergents to guess the value of this con?

3. At some point in this writeup, there was a con-tention that the cross product differences are always ±1. In particular, they alternate between -1 and 1. Is this true? (Why or why not?)

4. (This lengthier note can be skipped without loss of con-tinuity.)

If you’ve seen the Euclidean Algorithm (aka Euclid’s Algorithm) then you already know how to find the gcd (greatest common divisor) of two integers. For example, $$\gcd(157, 225)$$ can be found with repeated division:

\begin{align} 225 &= {\color{#cf2e2e} 1} \times 157 + 68 \\ 157 &= {\color{#ff6900} 2} \times 68 + 21 \\ 68 &= {\color{#00d084} 3} \times 21 + 5 \\ 21 &= {\color{#0d93e3} 4} \times 5 + 1 \\ 5 &= {\color{#9b51e0} 5} \times 1 + 0 \end{align}

The last line’s 1 is the greatest common divisor, i.e., $$\gcd(157, 225) = 1$$.

Notice that the rainbow colored quotients are precisely the ones found in our continued fraction of [1; 2, 3, 4, 5]. (If this is new to you, consider it further food for thought!) Euclid’s Algorithm can be unwound through a rather involved process to find integer solutions for, in this case, the equation $$157x + 225y = 1$$. With our Magic Box method above, though, we used [1; 2, 3, 4, 5] to find such an $$(x, y)$$ solution rather more efficiently!

5. We saw the con for $$\frac{225}{157}$$. How might you find the con for a number like $$\sqrt{7}$$?

6. If you extend the con explored above as [1; 2, 3, 4, 5, 6, 7, 8, …] then you get into some very deep mathematics. In particular, you end up with $$I_0(2)/I_1(2)$$, where $$I_n(z)$$ is the modified Bessel function of the first kind. WolframAlpha calculates this expression as ≈ 1.43313 using a ratio of summed unit fractions whose denominators are factorial products. Indeed, this is con-vincingly close to our computed convergent of $$\frac{225}{157} = 1.433121 \ldots$$

## Matt Enlow – Golden Squares & A Circle

Filmmaker David Lynch began his creative career as a painter, but he has said that he got into making movies because he found himself wanting his paintings to move. I sometimes find myself in a similar position. For example, consider the following image:

For those unfamiliar, this is indeed a golden rectangle—meaning that it has just the right proprtions so that when it is dissected into a square and a smaller rectangle, the smaller rectangle has the same proportions as the original. This means that a golden rectangle can be “dissected” into the infinite spiral of squares you see above.

It can be calculated that the ratio of a golden rectangle’s length to its width is $$\frac{1+\sqrt{5}}{2} \approx 1.618$$. This number is referred to as the golden ratio, and it is often represented by the Greek letter $$\varphi$$ (phi).

When I see a static image like the one above, I find myself wanting it to move.

Like… What if each square touched the next smaller square only at a corner, but the squares were free to move around otherwise? What if we could… unfurl that spiral of squares?

I have been an avid Mathematica user for decades now, and I frequently use it to help me answer questions like these by creating animations. Here is an unfurling of the squares:

As satisfying as this is, it does only lead me to more wondering. What would it look like if we went past that fully-extended “straight line” of squares?

In every frame of this animation, the sequence of squares shrinks down to a particular limit point:

And now I’m wondering… Watch that limit point as it moves. What path does it appear to trace?

That sure appears to be a circle! But is it? And if it is, where is its center located? What is its radius?

This is where complex numbers come in handy.

### The Complex Plane

Let’s think of these squares as living in the complex plane, with the largest one having its lower-left corner at the origin (0), and its upper-right corner at $$1+i$$. Each succesive, smaller square is rotated counter-clockwise by an angle of $$\theta$$, and $$\theta$$ is what varies (from $$0$$ to $$2\pi$$) over the course of the animations.

Let’s call the limit point we’re looking for $$z$$. We need to find an expression for $$z$$ in terms of $$\theta$$, and then see how $$z$$ changes as $$\theta$$ completes a full rotation (from $$0$$ to $$2\pi$$).

One way to find this expression for $$z$$ is to notice the self-similarity of the diagram above. Through a sequence of linear transformations, this diagram can be copied onto itself, leaving only the point $$z$$ fixed.

So the $$z$$ that we are seeking is the complex number that is unchanged by this sequence of transformations. In other words, we want to solve this equation for $$z$$: $\left(\frac{1}{\varphi }\; z\right)e^{\theta i}+(1+i)=z$

When we do, we get $z=\frac{1+i}{1-\frac{1}{\varphi }e^{\theta i}}.$

Now, this doesn’t exactly look like the equation of a circle. But we can show that it is, using the following logical steps (which, in the interest of not making this pitch even longer, I invite you to verify for yourself):

1. The expression $$e^{\theta i}$$, as a function of $$\theta$$, represents the unit circle in the complex plane.
2. The formula we derived for $$z$$ can be thought of as a Möbius transformation of $$e^{\theta i}$$.
3. In the complex plane, Möbius transformations map circles to circles.
4. Therefore, our formula for $$z$$, as a function of $$\theta$$, represents a circle in the complex plane.

So we’ve now established that this path is indeed a circle. But we still haven’t found its center or radius.

Evaluating $$z$$ when $$\theta = 0$$ and when $$\theta = \pi$$ will give us the endpoints of a diameter of the circle. When $$\theta = 0$$, $$z=\frac{1+i}{1-\frac{1}{\varphi }}$$. Using some very helpful properties of $$\varphi$$, we can show that this is equal to $$(\varphi +1)(1+i)$$. Similar logic can show that when $$\theta = \pi$$, $$z=(\varphi -1)(1+i)$$.

The center will be located at the average of these two endpoints, which is $$\varphi (1+i)=\varphi + \varphi \, i$$, or the coordinates $$(\varphi , \varphi )$$ in the coordinate plane. Which just so happens to be where the second and third squares connect when $$\theta =0$$:

The radius of the circle would simply be half of the distance between the two diameter endpoints we found earlier: $\frac{1}{2}\left|(\varphi +1)(1+i) – (\varphi -1)(1+i)\right| = \frac{1}{2}\left|1+i\right| \left|2\right| = \sqrt{2}$

So the circular path traced by the limit point has its center at $$(\varphi ,\varphi )$$, and a radius of $$\sqrt{2}$$.

I hope this excursion has caused even more questions to come up for you! In case you could use some prodding, here are a couple more images that might set off some ideas and wonderings…

So, which bit of maths has tickled your fancy the most? Vote now!

Quarter-final 1: Benjamin Dickman vs Matt Enlow

Matt with an unfurled golden rectangle
Benjamin with the magic box

Total Voters: 491

This poll is closed.

The poll closes at 08:00 BST tomorrow. Whoever wins the most votes will get the chance to tell us about more fun maths in the semi-final.

Come back tomorrow for the second quarter-final match, pitting Angela Tabiri against Howie Hua, or check out the announcement post for your follow-along wall chart!