There is a non-recursive formula for the Fibonacci numbers, expressing them in terms of the golden ratio and its powers.
Why should you be interested? Because it teaches an extremely valuable lesson about power series.
Read on to find out what:
The Fibonacci numbers form one of the most famous integer sequences, known for their intimate connection to the golden ratio, sunflower spirals, mating habits of rabbits, and several other things.
By definition, they are defined by a simple second-order recursion:
What’s usually not known is that the Fibonacci numbers have a simple and beautiful closed-form expression, written in terms of the golden ratio.
This is called the Binet formula.
In this thread, we are going to derive it from the first principles.
Let's start with our primary tool: power series.
A power series is an infinite sum of monomials. You can think about them as “polynomials of infinite degree”.
The coefficients of the monomials are called the coefficients of the power series.
One of the most important examples is the famous geometric series.
We’ll use this to derive the closed formula for the Fibonacci numbers.
A power series is fully determined by its coefficients: two power series are equal if and only if their coefficients are equal.
This is called the uniqueness property of power series.
Power series are also linear in a sense.
That is, summing two power series is the same as summing their coefficients.
What happens if we define a power series via the Fibonacci numbers?
Let’s find out.
This is called the Fibonacci generating function:
First, we’ll use recursion to obtain a closed-form expression for F(x).
Do you recall how the Fibonacci numbers were initially defined?
We can multiply each term by the corresponding monomial to obtain the terms of the generating function on both sides.
After summing the terms, we obtain an equation - for the generating function!
With a tiny bit of algebra, we can find the closed form of F(x)!
Here it is below:
The right-hand side is a rational fraction, that is, the fraction of two polynomials.
How are we going to find the power series for this particular rational fraction?
By taking a closer look at the polynomial 1 - x - x² in the denominator.
The second-degree polynomial 1 - x - x² is a famous one. Why?
Let’s take a look at its roots via the quadratic formula:
This is the golden ratio and its conjugate!
These two numbers are quite special.
Geometrically speaking, they describe the segments a and b such that the ratio of a to b is the same as a to a + b.
Besides its geometric properties, the golden ratio and its conjugate are also special in an algebraic way.
Their sum and product are 1 and -1, respectively, while their difference is √5.
Take note of these, as they’ll come in shortly.
What can we do with all of these? As the golden ratio and its conjugate are the roots of 1 - x - x², we can decompose this quadratic polynomial into the product of two linear terms.
How? Via the partial fraction decomposition.
We love rational fractions for one main reason: because they can be decomposed into the sum of geometric series.
In the case of the Fibonacci generating function, the decomposition is particularly simple.
We can find a and b by adding the two fractions together.
Using the fact that two polynomials are equal if and only if their coefficients are equal leads to a simple system of linear equations.
This can be easily solved in terms of the golden ratio and its conjugate.
Applying this to the Fibonacci generating function, we can obtain its final form.
(Recall that addition and scalar multiplication of power series can be done coefficientwise.)
And thus, we finally obtain the Binet formula!
(As follows from the uniqueness property of power series.)
Most machine learning practitioners don’t understand the math behind their models.
That's why I've created a FREE roadmap so you can master the 3 main topics you'll ever need: algebra, calculus, and probabilities.
The Law of Large Numbers is one of the most frequently misunderstood concepts of probability and statistics.
Just because you lost ten blackjack games in a row, it doesn’t mean that you’ll be more likely to be lucky next time.
What is the law of large numbers, then? Read on:
The strength of probability theory lies in its ability to translate complex random phenomena into coin tosses, dice rolls, and other simple experiments.
So, let’s stick with coin tossing.
What will the average number of heads be if we toss a coin, say, a thousand times?
To mathematically formalize this question, we’ll need random variables.
Tossing a fair coin is described by the Bernoulli distribution, so let X₁, X₂, … be such independent and identically distributed random variables.
In machine learning, we take gradient descent for granted.
We rarely question why it works.
What's usually told is the mountain-climbing analogue: to find the valley, step towards the steepest descent.
But why does this work so well? Read on:
Our journey is leading through:
• Differentiation, as the rate of change
• The basics of differential equations
• And equilibrium states
Buckle up!
Deep dive into the beautiful world of dynamical systems incoming.
First, let's talk about derivatives and their mechanical interpretation!
Suppose that the position of an object at time t is given by the function x(t), and for simplicity, assume that it is moving along a straight line — as the distance-time plot illustrates below.
Differentiation reveals much more than the slope of the tangent plane.
We like to think about it that way, but from a different angle, differentiation is the same as an approximation with a linear function. This allows us to generalize the concept.
Let's see why:
By definition, the derivative of a function at the point 𝑎 is defined by the limit of the difference quotient, representing the rate of change.
In geometric terms, the differential quotient represents the slope of the line between two points of the function's graph.