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?
For instance, if you have $3 (n = 3) and the casino has $7 (m = 7), this is what one possible outcome looks like.
(x is the number of rounds, y is your balance.)
This problem is much simpler if we think outside the box and generalize the question.
When we ask the probability of winning, conditioned on starting from $n, a recursive relation and its boundary conditions are revealed.
Think about it: winning from $n can happen when you either
• start from $(n+1) and lose the next round,
• or start from $(n-1) and win the next round.
Solving this recursion, we obtain a simple formula: your probability of winning is proportional to the money you have.
(If you are interested in working out the solution and the general case when the coin can be biased, check out this lecture from Harvard's Statistics course.)
If you are curious, I simulated 10 000 trajectories and overlaid them on top of each other, with low opacity. (The paler a line is, the fewer trajectories go through it.)
You can see here that starting from $1, losing is much more frequent than winning.
Even though the game is fair (since winning or losing a round is equally probable), deeper pockets are advantageous.
In real casinos, your account is tiny compared to theirs. Thus, in the long run, you are likely to lose.
Thus, the house (almost) always wins.
However, casino games are never balanced. They are designed so that probabilities favor the house, so your chances are even worse than this simple mathematical model shows.
TL;DR: you don't stand a chance against a casino.
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!
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.
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.