Tivadar Danka Profile picture
Aug 19 12 tweets 4 min read Read on X
One of my favorite formulas is the closed-form of the geometric series.

I am amazed by its ubiquity: whether we are solving basic problems or pushing the boundaries of science, the geometric series often makes an appearance.

Here is how to derive it from first principles: Image
Let’s start with the basics: like any other series, the geometric series is the limit of its partial sums.

Our task is to find that limit. Image
There is an issue: the number of terms depends on N.

Thus, we can’t take the limit term by term. Image
The trick is to notice that multiplying the partial sums by (-q) yields a polynomial that can be used to eliminate all but two terms. Image
Adding them together yields a simple and manageable expression for the partial sums. Image
I know, this feels like pulling a rabbit from a hat.

Trust me, after you have seen this trick a few times, it’ll feel like second nature. The result is called a telescopic sum.

Thus, the partial sums are significantly simpler now. Image
We are almost done.

Before we study the limit of partial sums, let’s focus on qᴺ.

Its limiting behavior (as N goes to ∞) is quite simple: Image
With this, we are ready to put all the pieces together.

The geometric series is convergent for all |q| < 1, with a nice and simple closed-form expression as the cherry on top. Image
This can be beautifully visualized in the case of q = 1/2. Image
Where does the geometric series appear?

For instance, when deriving a closed-form expression for the Fibonacci numbers. Or, tossing coins ad infinitum.

There are countless applications.
This simple formula is one of the building blocks of mathematics, and it should be under the belt of anyone interested in looking behind the curtain of science, engineering, and mathematics.
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

Aug 16
Problem-solving is at least 50% of every job in tech and science.

Mastering problem-solving will make your technical skill level shoot up like a hockey stick. Yet, we are rarely taught how to do so.

Here are my favorite techniques that'll loosen even the most complex knots: Image
0. Is the problem solved yet?

The simplest way to solve a problem is to look for the solution elsewhere.

This is not cheating; this is pragmatism. (Except if it is a practice problem. Then, it is cheating.)
When your objective is to move fast, this should be the first thing you attempt.

This is the reason why Stack Overflow (yeah, I'm old-school) is the best friend of every programmer.
Read 18 tweets
Aug 16
The following multiplication method makes everybody wish they had been taught math like this in school.

It's not just a cute visual tool: it illuminates how and why long multiplication works.

Here is the full story: Image
First, the method.

The first operand (21 in our case) is represented by two groups of lines: two lines in the first (1st digit), and one in the second (2nd digit).

One group for each digit.
Similarly, the second operand (32) is encoded with two groups of lines, one for each digit.

These lines are perpendicular to the previous ones.
Read 10 tweets
Aug 15
If it is raining, the sidewalk is wet.

If the sidewalk is wet, is it raining? Not necessarily. Yet, we are inclined to think so. This is a common logical fallacy called "affirming the consequent".

However, it is not entirely wrong. Why? Enter the Bayes theorem: Image
Propositions of the form "if A, then B" are called implications.

They are written as "A → B", and they form the bulk of our scientific knowledge.

Say, "if X is a closed system, then the entropy of X cannot decrease" is the 2nd law of thermodynamics.
In the implication A → B, the proposition A is called "premise", while B is called the "conclusion".

The premise implies the conclusion, but not the other way around.

If you observe a wet sidewalk, it is not necessarily raining. Someone might have spilled a barrel of water.
Read 9 tweets
Aug 15
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.
Read 24 tweets
Aug 14
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: Image
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. Image
Read 17 tweets
Aug 13
The single most important "side-effect" of solving linear equation systems: the LU decomposition.

Why? Because in practice, it is the engine behind inverting matrices and computing their determinants.

Here is how it works: Image
Why is the LU decomposition useful?

There are two main applications:

• Computing determinants
• Inverting matrices

Check out how the LU decomposition simplifies the determinant.

(As the determinant of a triangular matrix is the product of the diagonal.) Image
We’ll demonstrate the technique in the 3 x 3 case.

Let’s go back to square one: where do matrices come from?

For one, systems of linear equations.

They are used to model various phenomena ranging from economic processes to biological systems. Image
Read 15 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!

:(