Gautam Mittal

6 min

Magical Mathematics

September 9, 2016

Mathematics is truly magical. It's also really important. How important? Well, the entire basis for our understanding of the universe relies on rules outlined by mathematics. The examples I outline in this post are very simple and are limited to a very simple set of concepts.

Fibonacci and The Golden Ratio

The Fibonacci sequence is related to some of the most beautiful concepts yielded by mathematicians, such as the Golden Ratio (also denoted by $\phi$), defined as:

$ \phi = {1 + \sqrt 5 \over 2} \approx 1.61803399 $

The Golden Ratio is often found in nature and is considered appealing to the human eye. It takes the form of the following spiral (Donald Trump's hair happens to fit this "golden spiral" as well).

The Issue with a Recursive Formula

The simplest way to think of the Fibonacci sequence is to think of each number as the sum of the previous two numbers. This "recursive formula" is the most well-known way of computing the terms in the sequence. However, this recursive algorithm becomes exponentially more inefficient as you try to compute later terms in the sequence. Let's take this simple Scheme code to get some early terms of the sequence.

The execution tree is exponentially larger! In fact, my computer can barely compute (fib 20), and even that takes around a minute to calculate. Clearly, this recursive formula is fairly cumbersome if we cannot compute Fibonacci terms greater than the 20th term. Now in terms of computer science, you can drastically speed up the compute process by rewriting the Fibonacci code above as an iterative procedure. However, the question is, can we do this using pure mathematics?

Jacques Binet and Raiders of The Lost Explicit Formula

This is where it starts to get interesting.

It turns out that an intuitively recursive sequence like the Fibonacci numbers can be computed explicitly, or using a direct formula in terms of the $nth$ Fibonacci term.

One way to generate an approximation of the sequence is to use the Golden Ratio. Because the Fibonacci sequence adheres to the Golden Ratio, you can find a decimal approximation for the next term in the sequence by multiplying the previous term by the Golden Ratio.

That's great an all, but it does not provide an explicit integer formula. Also, we don't just want an approximation. We want the real deal.

In fact, Jacques Binet, a French mathematician, created an explicit integer formula (proof available here) using the Golden Ratio (he, along with Euler and Bernoulli were the first to prove the ratio). He discovered this:

$ F_n = {{\phi ^n - (- \phi) ^{-n}} \over \sqrt(5)} $

The formula above produces something that is truly amazing (but not unexpected):

$ 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, ... $

Binet produced this around 150 years ago. But what if I told you there was a simpler (more profound) method of generating Fibonacci numbers?

Math or Magic?

The rational function below produces all of the Fibonacci numbers.

$ G(x) = {{1} \over {1 - x - x^2}} $

$ G(10^{-3}) = 1.0102030508132134... $

Woah, now that's some real wizardry. This is where I start to question my sanity. We talked about recursive formulas. Then we discussed the Golden Ratio. But how can a rational function that involves neither of those two produce the magical series once discovered by Fibonacci?

This is crazy, and to be honest, I don't have the credentials to prove this sort of magic. I first saw this formula on Paul Hankin's blog, and I found it particularly interesting because I had never seen it done this way before. He has a wonderful proof and explanation of how this works, and has some nice Python code which you can try for yourself.

Until next time, keep observing the mystical ways of the mathematical universe.