Description
We often say that for a fair coin, the chance of getting heads or tails is 1 out of 2 — or simply 0.5. But is this really true?
Let’s find out by using a technique called Monte Carlo Simulation, which helps us understand chances by repeating random experiments many times.
Experiment Details
Objective:
To check if the chance of getting tails when tossing a fair coin is really 0.5 using a Monte Carlo Simulation.
Parameters:
Number of simulations:
We will toss the coin 1,00,000 times (virtually, using a computer).
Coin toss outcome:
We’ll treat Heads as 1 and Tails as 2 to make things easier for the program.
Method
We use a random number generator (np.random.randint) to simulate each coin toss — just like flipping a real coin but using code.
Each time we get a 2, we count it as Tails and keep track of how many times it happens.
After all the tosses, we calculate the probability of getting tails by dividing the number of tails by the total number of tosses (1,00,000).
If the coin is fair, then we expect the number of tails to be close to half of the total tosses — that is, around 50,000 tails. So the probability should be close to 0.5 or 50%.
After running the simulation, we found that the number of tails was indeed very close to 50,000, and the calculated probability was very close to 0.5 or 50%.
This shows that the assumption we usually make — that a fair coin gives heads or tails with equal chance — is actually true when tested with enough trials.