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 greatly 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.
However, differentiation can be formulated in another way.

We can write the difference quotient as the derivative plus an error term (if the derivative exists).
With a bit of algebra, we obtain that around 𝑎, we can replace our function with a linear function. The derivative gives the coefficient of the 𝑥 term.

(The term 𝑜(|𝑥-𝑎|) means that it goes to 0 faster than |𝑥-𝑎|. This is called the small o notation.)
So, the derivative is the first-order coefficient of the best linear approximation. Why is this good for us? There are two main reasons:

1) this gives a template to explain higher-order derivatives,

2) and one can easily extend the formula for multivariable functions.
Let's talk about higher-order derivatives first.

Going further with the idea, we might ask, what is the second-order polynomial that best approximates our function around a given point?

It turns out that we can continue our formula with the help of the second derivative.
In general, we can continue this expansion indefinitely. The more terms you use, the smaller the error gets.

This is called the Taylor polynomial, one of the most powerful tools in mathematics.

I'll show you an example to see why.
Have you ever wondered what happens when you type in the sine of some number into a hand calculator?

Since sin is a transcendental function, it is replaced with an approximation, such as its Taylor expansion that you can see below.
Now let's talk about the generalization of differentiation to multiple dimensions.

How would you define the derivative of a multivariable function? The most straightforward way would be as below, but there is a problem: division is not defined for vectors.
However, the definition offered by the best approximating linear function can be easily generalized!

The gradient (the multivariate "derivative") is the vector that gives the best linear approximation around a given point.
Having a deep understanding of math will make you a better engineer. I want to help you with this, so I am writing a comprehensive book about the subject.

If you are interested in the details and beauties of mathematics, check out the early access!

tivadardanka.com/book
Correction! When talking about the higher order differentiation and the Taylor expansion, I sadly forgot to include one crucial part of the formula: the factorials.

Below are the correct formulas.
The Taylor expansion:

• • •

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

Mar 10
Taking a walk can change the course of science.

Roaming the streets of Königsberg, Euler was working on a simple puzzle: can he cross each of the city's bridges exactly once? The answer was no. And so, graph theory was born.

↓ This is its story. ↓ Image
At the time of Euler, the central part of Königsberg (now Kaliningrad) was split into four parts by the Pregel (now Pregolya) river, with seven bridges between them, as illustrated below.

The question is, can you cross each one exactly once during a single walk? Image
To answer this question, we don't have to study the particular geography and layout of Königsberg, only the islands and the bridges connecting them.

By stripping away all unnecessary details, we end up with a few nodes connected by edges. This was the first graph. Image
Read 8 tweets
Mar 9
97.8% of people instantly believe any oddly specific statistic they read on Twitter.

Don't be susceptible to logical fallacies and subtle manipulations. Spotting and avoiding them is essential to making good decisions in our times.

↓ Here is what to look out for. ↓
1. Argument from repetition.

In Latin, this is called argumentum ad nauseam, that is, an argument that has been repeated until nausea.

Want an example when it worked successfully?
"Ceterum censeo Carthaginem esse delendam."

Cato, the Roman senator closed every one of his speeches with the phrase "Carthage must be destroyed". And so, Carthage was eventually razed and its ruins were sown with salt.
Read 17 tweets
Mar 7
There are two mistakes people make when building predictive models.

Most models are either too simple to be useful or too complicated to be used. Learning to pick just the right one is a valuable skill that can be applied anywhere.

Here is the basic principle behind it. ↓
Let's see some movie review sentiment analysis to illustrate the point!

Here is a short review snippet: "I had the terrible misfortune of having to view this b-movie in its entirety."

Without a doubt, this review is negative.
Based on this sample, one possible way to capture the sentiment could be just simply looking for the word "horrible".

Reviews containing it are predicted as negative. Otherwise, they are positive.
Read 11 tweets
Mar 4
There is a mind-blowing application of matrix multiplication: doing recursion (almost) at the speed of light!

By the end of this thread, you'll learn precisely how.

Trust me, if you are into programming and math, you want to know this trick.

↓ ↓ ↓
Let's start with the simplest example for recursion: Fibonacci numbers.

Each Fibonacci number is the sum of the previous one and the one before.

The recursion starts with 0 and 1.
In Python, the implementation is rather straightforward.

Can you guess the issue?
Read 14 tweets
Mar 3
There is more than one way to think about matrix multiplication.

By definition, it is not easy to understand. However, there are multiple ways of looking at it, each one revealing invaluable insights.

Let's take a look at them!

↓ A thread. ↓
First, let's unravel the definition and visualize what happens.

For instance, the element in the 2nd row and 1st column of the product matrix is created from the 2nd row of the left and 1st column of the right matrices by summing their elementwise product.
To move beyond the definition, let's introduce some notations.

A matrix is built from rows and vectors. These can be viewed as individual vectors.

You can think of them as a horizontal stack of column vectors or a vertical stack of row vectors.
Read 13 tweets
Mar 2
One common wisdom about gambling is that the house always wins.

This is not just a catchphrase; there is mathematical evidence behind it. If you play against an opponent with much deeper pockets, your chances of winning approach zero.

Read on to see why.

↓ A thread. ↓
To illustrate the problem above, consider a simple example: betting on coin tosses.

The dealer tosses a fair coin. If it lands on heads, you win $1. If tails, you lose $1.

You have 𝑛 dollars, while the casino has 𝑚. In total, there are 𝑁 = 𝑛 + 𝑚 dollars on the table.
You win when you reach 𝑁 dollars. However, if you get to zero, you lose.

The question is simple: what is the probability of winning?
Read 12 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 on Twitter!

:(