Tivadar Danka Profile picture
Aug 15, 2025 24 tweets 7 min read Read on X
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: Image
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: Image
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. Image
One of the most important examples is the famous geometric series.

We’ll use this to derive the closed formula for the Fibonacci numbers. Image
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. Image
Power series are also linear in a sense.

That is, summing two power series is the same as summing their coefficients. Image
What happens if we define a power series via the Fibonacci numbers?

Let’s find out.

This is called the Fibonacci generating function: Image
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. Image
After summing the terms, we obtain an equation - for the generating function! Image
With a tiny bit of algebra, we can find the closed form of F(x)!

Here it is below: Image
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: Image
This is the golden ratio and its conjugate! Image
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. Image
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. Image
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. Image
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. Image
We can find a and b by adding the two fractions together. Image
Using the fact that two polynomials are equal if and only if their coefficients are equal leads to a simple system of linear equations. Image
This can be easily solved in terms of the golden ratio and its conjugate. Image
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.) Image
And thus, we finally obtain the Binet formula!

(As follows from the uniqueness property of power series.) Image
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.

Get the roadmap here: thepalindrome.org/p/the-roadmap-…

• • •

Missing some Tweet in this thread? You can try to force a refresh
 

Keep Current with Tivadar Danka

Tivadar Danka Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

PDF

Twitter may remove this content at anytime! Save it as PDF for later use!

Try unrolling a thread yourself!

how to unroll video
  1. Follow @ThreadReaderApp to mention us!

  2. From a Twitter thread mention us with a keyword "unroll"
@threadreaderapp unroll

Practice here first or read more on our help page!

More from @TivadarDanka

Jan 20
The single most undervalued fact of linear algebra: matrices are graphs, and graphs are matrices.

Encoding matrices as graphs is a cheat code, making complex behavior simple to study.

Let me show you how! Image
If you looked at the example above, you probably figured out the rule.

Each row is a node, and each element represents a directed and weighted edge. Edges of zero elements are omitted.

The element in the 𝑖-th row and 𝑗-th column corresponds to an edge going from 𝑖 to 𝑗.
To unwrap the definition a bit, let's check the first row, which corresponds to the edges outgoing from the first node. Image
Read 18 tweets
Jan 14
Matrix multiplication is not easy to understand.

Even looking at the definition used to make me sweat, let alone trying to comprehend the pattern. Yet, there is a stunningly simple explanation behind it.

Let's pull back the curtain! Image
First, the raw definition.

This is how the product of A and B is given. Not the easiest (or most pleasant) to look at.

We are going to unwrap this. Image
Here is a quick visualization before the technical details.

The element in the i-th row and j-th column of AB is the dot product of A's i-th row and B's j-th column. Image
Read 17 tweets
Jan 8
Behold one of the mightiest tools in mathematics: the camel principle.

I am dead serious. Deep down, this tiny rule is the cog in many methods. Ones that you use every day.

Here is what it is, how it works, and why it is essential: Image
First, the story:

The old Arab passes away, leaving half of his fortune to his eldest son, third to his middle son, and ninth to his smallest.

Upon opening the stable, they realize that the old man had 17 camels. Image
This is a problem, as they cannot split 17 camels into 1/2, 1/3, and 1/9 without cutting some in half.

So, they turn to the wise neighbor for advice. Image
Read 18 tweets
Jan 1
The single most undervalued fact of linear algebra: matrices are graphs, and graphs are matrices.

Encoding matrices as graphs is a cheat code, making complex behavior simple to study.

Let me show you how! Image
If you looked at the example above, you probably figured out the rule.

Each row is a node, and each element represents a directed and weighted edge. Edges of zero elements are omitted.

The element in the 𝑖-th row and 𝑗-th column corresponds to an edge going from 𝑖 to 𝑗.
To unwrap the definition a bit, let's check the first row, which corresponds to the edges outgoing from the first node. Image
Read 18 tweets
Dec 11, 2025
The single most undervalued fact of linear algebra: matrices are graphs, and graphs are matrices.

Encoding matrices as graphs is a cheat code, making complex behavior simple to study.

Let me show you how! Image
If you looked at the example above, you probably figured out the rule.

Each row is a node, and each element represents a directed and weighted edge. Edges of zero elements are omitted.

The element in the 𝑖-th row and 𝑗-th column corresponds to an edge going from 𝑖 to 𝑗.
To unwrap the definition a bit, let's check the first row, which corresponds to the edges outgoing from the first node. Image
Read 18 tweets
Dec 9, 2025
Matrix multiplication is not easy to understand.

Even looking at the definition used to make me sweat, let alone trying to comprehend the pattern. Yet, there is a stunningly simple explanation behind it.

Let's pull back the curtain! Image
First, the raw definition.

This is how the product of A and B is given. Not the easiest (or most pleasant) to look at.

We are going to unwrap this. Image
Here is a quick visualization before the technical details.

The element in the i-th row and j-th column of AB is the dot product of A's i-th row and B's j-th column. Image
Read 17 tweets

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3/month or $30/year) and get exclusive features!

Become Premium

Don't want to be a Premium member but still want to support us?

Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal

Or Donate anonymously using crypto!

Ethereum

0xfe58350B80634f60Fa6Dc149a72b4DFbc17D341E copy

Bitcoin

3ATGMxNzCUFzxpMCHL5sWSt4DVtS8UqXpi copy

Thank you for your support!

Follow Us!

:(