Tivadar Danka Profile picture
Aug 6 18 tweets 5 min read Read on X
The way you think about the exponential function is (probably) wrong.

Don't think so? I'll convince you. Did you realize that multiplying e by itself π times doesn't make sense?

Here is what's really behind the most important function of all time: Image
First things first: terminologies.

The expression aᵇ is read "a raised to the power of b."

(Or a to the b in short.) Image
The number a is called the base, and b is called the exponent.

Let's start with the basics: positive integer exponents. By definition, aⁿ is the repeated multiplication of a by itself n times.

Sounds simple enough. Image
But how can we define exponentials for, say, negative integer exponents? We'll get there soon.

For that, two special rules will be our guiding lights. First, exponentiation turns addition into multiplication.

We'll call this the "product of powers" rule. Image
Second, the repeated application of exponentiation is, again, exponentiation.

We'll call this the "power of powers" rule. Image
These two identities form the essence of the exponential function. Image
To extend the definition to arbitrary powers, we must ensure that these properties remain true.

So, what about, say, zero exponents? Here, the original interpretation (i.e., repeated multiplication) breaks down immediately.

How do you multiply a number by itself zero times?
To find the definition, we’ll use wishful thinking.

I am not kidding. Wishful thinking is a well-known and extremely powerful technique.

The gist is to assume that powers with zero exponents are well-defined, then use some algebra to find out what the definition might be.
In this case, the "product of powers" property gives the answer: any number raised to the power of zero should equal to 1. Image
What about negative integers? We cannot repeat multiplication zero times, let alone negative times.

Again, let's use wishful thinking.

If powers with negative integer exponents are indeed defined, the "product of powers" tells us what they must be. Image
What about rational exponents? You guessed right. Wishful thinking!

The "power of powers" rule yields that it is enough to look at exponents where the numerator is 1. Image
The same rule gives that rational exponents with numerator 1 must be defined in terms of roots. Image
Thus, we finally see how to make sense of rational exponents. Image
Now, what about arbitrary real numbers?

Buckle up. We are about to floor the gas pedal. So far, we have defined the exponential function for all rationals.

Let's use this to our advantage!
Real numbers are weird.

Fortunately, they have an exceptionally pleasant property: they can be approximated by rational numbers with arbitrary precision.

This is because no matter how close we get to a real number, we can find a rational number there. Image
When the approximating sequence is close to the actual exponent x, the powers are also close.

Closer and closer as n grows. Image
Thus, we can define exponentials for arbitrary real exponents by simply taking the limit of the approximations.

And we are done! Image
Join 20,000+ ML practitioners who get 2 actionable emails every week to help them understand the math behind ML, make smarter decisions, and avoid costly mistakes.

Subscribe here (it’s free): thepalindrome.org

• • •

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 6
Logistic regression is one of the simplest models in machine learning, and one of the most revealing.

It shows us how to move from geometric intuition to probabilistic reasoning. Mastering it sets the foundation for everything else.

Let’s dissect it step by step! Image
Let’s start with the most basic setup possible: one feature, two classes.

You’re predicting if a student passes or fails based on hours studied.

Your input x is a number, and your output y is either 0 or 1.

Let's build a predictive model! Image
We need a model that outputs values between 0 and 1.

Enter the sigmoid function: σ(ax + b).

If σ(ax + b) > 0.5, we predict pass (1).

Otherwise, fail (0).

It’s a clean way to represent uncertainty with math. Image
Read 15 tweets
Aug 5
This will surprise you: sine and cosine are orthogonal to each other.

What does orthogonality even mean for functions? In this thread, we'll use the superpower of abstraction to go far beyond our intuition.

We'll also revolutionize science on the way. Image
Our journey ahead has three milestones. We'll

1. generalize the concept of a vector,
2. show what angles really are,
3. and see what functions have to do with all this.

Here we go!
Let's start with vectors. On the plane, vectors are simply arrows.

The concept of angle is intuitive as well. According to Wikipedia, an angle “is the figure formed by two rays”.

How can we define this for functions? Image
Read 18 tweets
Aug 3
In machine learning, we use the dot product every day.

However, its definition is far from revealing. For instance, what does it have to do with similarity?

There is a beautiful geometric explanation behind: Image
By definition, the dot product (or inner product) of two vectors is defined by the sum of coordinate products. Image
To peek behind the curtain, there are three key properties that we have to understand.

First, the dot product is linear in both variables. This property is called bilinearity. Image
Read 15 tweets
Aug 3
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
Aug 2
The single biggest argument about statistics: is probability frequentist or Bayesian?

It's neither, and I'll explain why.

Buckle up. Deep-dive explanation incoming: Image
First, let's look at what is probability.

Probability quantitatively measures the likelihood of events, like rolling six with a dice. It's a number between zero and one.

This is independent of interpretation; it’s a rule set in stone. Image
In the language of probability theory, the events are formalized by sets within an event space.

The event space is also a set, usually denoted by Ω.) Image
Read 33 tweets
Aug 2
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 16 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!

:(