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:
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.
There is an issue: the number of terms depends on N.
Thus, we can’t take the limit term by term.
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.
Adding them together yields a simple and manageable expression for the partial sums.
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.
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:
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.
This can be beautifully visualized in the case of q = 1/2.
Where does the geometric series appear?
For instance, when deriving a closed-form expression for the Fibonacci numbers. Or, tossing coins ad infinitum.
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.
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!
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.
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.
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!
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.
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.