There are 25 people in a room. What is the probability that two of them share the same birthday?
If you think it is low, you'll be surprised to find out that the actual probability is more than 50%.
Here is why!
↓ A thread. ↓
The usual thinking is if there are 25 people and 365 days in a year, then chances should be roughly 24/365 ≈ 6.5%, and if we have 366 people, then it is guaranteed that two of them share birthdays.
However, this is not how probability works.
First, it is much easier to talk about the probability of having no shared birthdays.
This is a common trick, often making the calculations much more manageable.
Let's simplify the problem even more.
Given two people, what is the probability of sharing the same birthday?
By encoding the birthday with an integer between 1 and 365 and the configurations as tuples, we can easily count their total number.
How many days can we pick as the 1st element of the tuple? 365.
How many days can we pick as the 2nd element to avoid the birthday collision? 364.
In total, there are 365*364 ways.
To count the number of total configurations, we simply disregard the potential birthday collision.
Thus, there are 365*365 possibilities.
Now we can calculate the probability as the ratio of the number of desired outcomes and all possible outcomes.
In this case, the result is the following.
Summing up, the probability of two people sharing the same birthdays is less than one percent.
What about the general case?
Following the same logic, we can solve the general problem.
At n = 23 people, the probability reaches 50%.
At n = 41, the probability is 90%.
Quite surprising, isn't it?
If you are curious, this is what the probabilities look like.
A few days ago, I posted this very same question, asking you to estimate the probability of shared birthdays, given 25 people.
That our intuition about probability often fails hard. When asked, most estimate the chances of having a shared birthday among 25 people very low, even though the actual probability is more than 50%.
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!
Why is matrix multiplication defined the way it is?
When I first learned about it, the formula seemed too complicated and counter-intuitive! I wondered, why not just multiply elements at the same position together?
Let me explain why!
↓ A thread. ↓
1/11
First, let's see how to make sense of matrix multiplication!
The elements of the product are calculated by multiplying rows of 𝐴 with columns of 𝐵.
It is not trivial at all why this is the way. 🤔
To understand, let's talk about what matrices really are!
2/11
Matrices are just representations of linear transformations: mappings between vector spaces that are interchangeable with addition and scalar multiplication.
Let's dig a bit deeper to see why are matrices and linear transformations are (almost) the same!