If you’ve already watched the series The Squid Game or if you’re not afraid of a major spoiler, keep reading this article to find out how statistics can save your life.

The Squid Game is the most-watched series in Netflix history. In it, a group of disgraced contestants have a chance to win a fortune if they pass six trials, which consist of popular children’s games.

Processing…
Success! You're on the list.

The fifth of these tests consists of crossing a floating bridge with 18 glass steps, separated by one meter. Each step is made up of two tiles, one of tempered glass, capable of supporting the weight of a person, and the other of normal glass, which breaks when stepped on.

Sixteen players will try to cross the bridge one after the other, choosing one of the two tiles at each jump. If one player falls, the next player advances through the safe tiles up to the previous player’s position and tries to cross the rest.

## Which player should I bet on?

Assuming that if one player crosses, those behind him will also cross, the question we ask ourselves is which player will be the first to cross?

To answer this question, we need to think of each of the steps of the bridge as an experiment. A player will jump to one of the two tiles. If they survive, they will perform the next experiment (jumping to the next tile). Otherwise, it will be the next player who will do it.

In this way, we can see the bridge game as a series of 18 experiments in which each failure means that a player has fallen. Zero failures mean that the first player has made it across the bridge, while 5 failures mean that only 11 players have crossed.

From this perspective we can see that the bridge problem is a random variable that follows a binomial distribution:

where n=18 is the number of experiments and p=0.5 is the probability of success of each experiment (there are two tiles and only one is correct).

Once we know the distribution that the problem follows, we need to figure out the probability of having 0 failures (all cross), 1 failure (all cross except the first one), etc. This is known as the probability mass function and is described by the following formula:

where k is the number of failures. We will compute this function using the Python library scipy. First, we create the random variable that describes the game:

```import numpy as np
from scipy.stats import binom
import plotly.express as px
n = 18
p = 0.5
rv = binom(n, p)```

Then, we calculate the function:

`failures = np.arange(16)probs = rv.pmf(failures)`

As you can see, we will most likely have nine falls in the game and the tenth player will be the first to cross the bridge. So that is the player we should bet on.

We also want to know the probability of getting k or fewer failures. That is, that at most k players die. This is achieved with the cumulative sum of the above function, which is known as the cumulative distribution function:

`probs = rv.cdf(failures)`

As you can see, if we are the twelfth player or above, we have reason enough to be calm before the game starts.

## On average, how many players will survive?

The expected number of failures can be calculated as:

which is the expected value of a binomial random variable. In Python, we can calculate it as:

`mean = rv.mean()`

As a result, we’ll expect 9 failures, leaving only 7 players alive.

## What is the probability that they will all survive? And none?

Intuitively, for the first player to cross the bridge without falling, he must hit all the jumps. If the probability of hitting is 1/2 and there are 18 jumps, the probability of crossing is:

To know the probability that no one survives, we will use the survival function of the binomial distribution. This function will be simply 1-CDF. We will calculate the probability of having 15 failures. The remaining probability until we reach 100% will be the probability that all 16 players have fallen. In Python we can calculate this value as follows:

`prob_none_survived = rv.sf(15)`

This probability is 0.065612%.

## If it is my turn, what are my chances of crossing?

Suppose we are one of the players and thanks to the previous contestants we have managed to advance to the eleventh step. What is our probability of surviving?

The result of our attempt to cross is a random variable that follows a geometric distribution. This distribution calculates the number of attempts (jumps) we will have to make before an event (falling) occurs. Through this distribution, we can see what outcome to expect.

To begin with, we will calculate the step on which we expect to fall, i.e., the mean. For a geometric distribution, it is calculated as follows:

`mean = rv.mean()`

The average is 2. That is, we can expect to survive one step and die on the next. Now, let’s see how likely we are to die on each of the steps:

```tiles = np.arange(1, 8)
probs = rv.pmf(tiles)```

As you can see, the probability of falling on step #12 is 50%. On step #13 it is 25%, and so on. Adding the probabilities of falling on the following steps, we have that the probability of falling is 99.21%. So, the probability of surviving is 0.78125%.

## If I am fourth in line, and the first player is on the tenth step, should I be worried?

To answer this question we can use a probability distribution related to the previous ones: the negative binomial. This distribution describes the number of experiments we have to carry out until an event (falling) occurs a given number of times.

In this distribution, r is the number of events we will count. Since we will be fourth in line, r=4. The average number of steps we will advance before the next 4 participants fall is calculated as:

In this case, the average is 4 steps. That is, our life expectancy is 4 steps and there are still 8 steps to cross. Now let’s look at the probability that the first 4 participants fall on each of the steps ahead of them. For that, we need to calculate the probability mass function of the distribution, with the following formula:

And the result will be the following graph:

In this graph we can see the cumulative probability, up to the last step:

Using the survival function we can analyze what is the probability of overcoming the remaining 8 steps before the first four participants fall (i.e., our survival probability):

`prob = rv.sf(7)`

This probability is ~11.32%.

## To sum up:

If after this review you still want to participate, all you need to do is call the number on the back of the invitation card. Good luck! 