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. ↓
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?
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.
After getting rid of the noise, we can listen to the signal. This way, Euler discovered a simple criteria that solved his problem: to traverse all edges exactly once in a single walk, either

• all nodes must have even edges,
• or all nodes must have even edges except two.
Since all five nodes of Königsberg's graph have an odd number of edges, we cannot cross each bridge exactly once.

And so, graph theory was born.
Abstraction is one of the strengths of scientific thinking. By trimming unnecessary features, we obtain models that can fit to a wide array of problems.

Without abstraction, our tools would be extremely limited.
Graph theory has fruitful applications in the study of

• data structures and databases,
• computer networks and security,
• sociology,
• molecular interactions,
• biochemical pathways,

and much more. Graph theory came a long way from a mathematical puzzle.
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 mathematics of machine learning, check out the early access!

tivadardanka.com/book

• • •

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 11
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.

The element in the 𝑖-th row and 𝑗-th column corresponds to an edge going from 𝑖 to 𝑗.
Why is the directed graph representation beneficial for us?

For one, the powers of the matrix correspond to walks in the graph.

Take a look at the elements of the square matrix. All possible 2-step walks are accounted for in the sum defining the elements of A². Image
Read 16 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 8
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.
Read 14 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

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!

:(