img

Inputs Please!

Why we human need deadlines to make complex or big decisions which most of the cases we always end up in analysis paralysis ( Which makes us to make detrimental decisions )

Sign in to a Grapevine account for the full experience.

Discover More

Curated from across

img

Software Engineers on

by salt

Gojek

Daily Series #2: Geeking out → Monte Carlo Simulations

I will continue with this series for people who like this kind of content, drop "+1" in the chat and I will tag you the next time I post content. Imagine you have a very complex situation with varying degrees of randomness. How do you evaluate the probability of certain outcomes? One way is a deterministic way which is to sit down and try to compute probabilities of events. Another way is to simulate these interactions with various seed values and see how these outcomes vary. This is called a Monte Carlo simulation, where we use random sampling to model and analyze complex systems that involve uncertainty. Let's set up a game and apply a Monte Carlo simulation to it. You(Hero) and Me(Villain) engage in a strategic coin flipping competition over a series of rounds. Before each round, both of us independently decide whether to flip a coin or pass the turn to the opponent. The outcomes are as follows: 1. If both players decide to flip, a fair coin is tossed, and the player who called it correctly gains a point. 2. If one player decides to flip and the other passes, the flipping player gains a point without the need for a coin toss. 3. If both players pass, no points are gained or lost. We can simulate it by making each decision random: 1. Hero and Villain both independently choose between 0 and 1 for deciding whether to toss or pass. We use 0 as Pass and 1 as Toss. 2. If both pass then we let the scores as is. 3. If one passes and not the other, then we add +1 to whoever decided to toss. 4. If both decide to toss then, we do a random coin flip where 0 = Heads and 1 = Tails. Hero can randomly choose between Heads or Tails. The Villain takes the opposite position. First is the Monte Carlo Simulation and the difference between potential outcomes for 1000 rounds and 20 simulations, which is the graph shared.

img