Squid Game : A data scientist’s take on surviving the glass bridge.

The latest pop culture phenomenon, Squid Game, has seen massive success worldwide over the last couple weeks. For those who aren’t in the know, the show feels like like a mix between The Hunger Games and Saw. The show is about 456 debt-ridden players who join a survival contest in order to win 45.6 Billion Won (~38.1 Million USD) with the hopes of breaking free of their financial obligations. The contest consists of 6 different children’s games (such as red light green light and tug-of-war) but the catch is if you lose, you die.

image source: @chartrdaily
image source: @chartrdaily
Image Source: Instagram (@chartrdaily)

For the most part, each game culls a proportion of the contestants based on skill, strength, and pure luck. But one of the games, the glass bridge in episode 7, caught my eye as there is an element of optimization that could be applied in order to maximize the chances of survival. Being the geek that I am I decided to develop a model that would help me stay alive in Squid Game if I’m ever desperate enough to pay off my student loans.

What is the glass bridge game?

(SPOILER WARNING!!!):

16 contestants choosing the order that they decide to cross the glass bridge

The premise of the glass bridge game is simple: contestants first choose what order they cross a glass bridge (in the show there are 16 contestants, thus 16 player positions). This becomes their predetermined order for crossing the bridge and the group has 16 minutes to complete the journey.

Contestants must cross a glass bridge that has 18 steps and 2 sides: one side made from normal glass and the other from tempered glass.

The glass bridge itself is made up of 18 steps with two sides to choose from at each step. One side will be made from normal glass and the other from tempered glass. If someone steps on the tempered glass, they will be safe. If they step on the normal glass, the tile will break and that player falls to their death.

One immediate observation is that if the game had no time limit, the obvious choice is to choose the last possible position and let all the other players ahead of you discover the safe path across the bridge. However, due to time limitations you might not want to be the last person across since you might run out of time before you’re safely across.

Simulating the game

I’m aiming to answer the question: what is the optimal player position to take to maximize survival? I used python to code up a glass bridge game and ran hundreds of thousands of runs to determine this answer.

Here are some of the assumptions I’ve built in to my simulations:

  • 16 players: all move forward in their ordered number and can “memorize” what the person ahead of them does
  • 18 steps: 2 tiles each , 1 false tile per pair randomly assigned
  • Players cannot willingly jump off the bridge and “un-alive” themselves
  • Players cannot pass each other
  • Players have no way of knowing the outcome of unexplored tiles (i.e. none of them worked in glass manufacturing in their previous life)

Based on these assumptions, in the unlikely scenario that the first player was able to guess the correct tile correctly (P = 0.5¹⁸ or 0.0004% chance) then all players would memorize the path and survive.

Given these conditions, I’ve simulated the game 100,000 times and gathered survival statistics in order to determine the likelihood of surviving the glass bridge game based on positioning. Intuitively, the further a player is behind the pack, the higher likelihood of survival.

Results from 100,000 game simulations (16 players, 18 tiles) based on Squid Game’s episode 7 conditions. Players in position 13 survived 95% of the time.

Again, taking the last position possible gives the highest likelihood of survival in a game with limitless time. However, we need to consider what the optimal player position should be under time constraints. To do this, I’ve considered what is the earliest player position with the most acceptable survival rate (set arbitrarily at 95%). Thus, I’m defining the optimal player position as the earliest player position with a 95% survivability.

If we use this heuristic and based on the simulation results, in a game of 16 players and 18 steps, the player in position 13 is the optimal position for having an acceptable survival rate while maximizing the amount of time to cross the bridge.

What if…?

Let’s take this analysis to another level, how would we generalize this finding? Instead of just 18 steps, what if there were 100? To answer this question, I changed the simulation condition to extend both the number of players and the number of steps to 100.

The first intuitive finding is that the number of players in the game doesn’t affect the optimal player position, only the ability to choose the optimal player position. In other words, if the optimal player position is 13, but there are only 10 players, everybody in that group will most likely lose. In a game of 100 players and 18 steps, position 13 is still the same optimal position.

What does affect the optimal player position is the number of steps in the game. The greater the number of steps, the greater the number of discovery is needed. When plotting out the survival statistics for a 100,000 simulations of the 100-step games, the result shows that player position 59 is the first position to hit a 95% survival rate, thus being the optimal player in this scenario.

In a glass bridge game with 00 steps, the optimal player position (>95% survivability) is position 59

To extend this analysis further, I’ve programmatically iterated over hundreds of conditions: from 1-step games to 456-step games. In other words, what if this was the first game everyone had to play and there were 456 players in the round? I plotted the optimal player position with its respective number of steps game which yields a fairly linear pattern.

Graphing the optimal player position against the number of steps in a game yield a linear relationship with a slope of 0.53 and an intercept of 5.83

Applying basic linear regression (or a line of best fit), I’m able to develop a simplistic model to determine the specific player position I need to choose based on the number of steps in the game in order to maximize survival.

And finally, the model:
Optimal Player Position = 0.53 x Number of Steps + 5.83

Thanks for taking the time to read my little nerd rant. I hope you enjoyed reading it as much as I had writing it! Full code of how I developed the simulation is available here!