BrunoP.Blog

EA simulated the World Cup and already 'knows' the winner. I got suspicious and ran my own — 50,000 times

Every year EA runs the game and 'calls' the World Cup champion — and sometimes nails it. It felt like magic until it clicked: it's just statistics run MANY times. I built a Monte Carlo simulator in your browser so you can run thousands of World Cups and watch each team's odds emerge before your eyes.

Every World Cup eve, the same scene plays out: EA runs their football video game, simulates the whole tournament, and drops a headline like "the game already knows who'll be champion." And the funny part is that sometimes it nails it — in 2022 their prediction called Argentina before a single ball was kicked. I went to bed wondering: can a game actually predict reality?

The next morning it clicked — and there's no crystal ball involved. It's stubborn statistics, run over and over and over. The name for it is Monte Carlo simulation, and it's one of the most useful (and most underrated) tools I use in real work. I rewrote the idea from scratch into a simulator that's right below — you run thousands of World Cups and watch each team's odds emerge before your eyes. But let me show you how it works, because it's simpler than it sounds.

You can't "calculate" a match — but you can bet on it

That's the first knot: you can't say for certain "Brazil beats France." Football has upsets. What you can say is how likely each outcome is. So we give each team a strength score (a rating, chess-Elo style) and turn the gap in strength into a probability. The classic formula:

P(A beats B) = 1 / (1 + 10(ratingB − ratingA) / 400)

Read it like this: if both teams have the same score, it's 50/50 — a fair coin. Every ~400 points of edge make the favourite ~10× more likely to win. Then, to "play" the match, I draw a random number between 0 and 1: if it lands below team A's probability, A advances; otherwise B does. It's a coin flip loaded toward the stronger side. (A draw? In a knockout someone always advances, so we fold penalties into that same probability.)

One World Cup tells you almost nothing

Here's the trick. If I simulate one Cup, the result is basically folklore: it might be the favourite, it might be a historic upset. A single sample doesn't reveal the trend — the same way flipping a coin once doesn't prove it's fair.

The Monte Carlo insight is to repeat the experiment a ton of times and count. I run the tournament 10,000, 50,000 times, note who lifted the trophy each time, and divide: "Team X was champion in 23.7% of the Cups." That fraction is the estimated probability of them winning, given the strengths I set. The more simulations, the closer the estimate gets to the true number — and that has a name: the Law of Large Numbers. In the simulator below you can watch it happen: with few Cups the bars shake like a leaf; with many, they lock in and barely move.

Monte Carlo is what you use when the math is too tangled to solve with a formula: instead of calculating the answer, you sample it thousands of times and let the average tell you the result.

A trick born in the atomic bomb (and named after a casino)

This story is too good not to tell. The method was invented in the 1940s by mathematician Stanisław Ulam while he was recovering from an illness playing solitaire — he kept trying to compute by hand the odds of the game working out, couldn't, and thought: "what if I just play it many times and count?" He and von Neumann took the idea to the Manhattan Project to simulate the path of neutrons. Since it was a military secret, it needed a codename — they picked Monte Carlo, after the casino where Ulam's uncle blew his money. So: the technique that today "predicts" the World Cup was born computing atomic bombs and is named after a roulette wheel.

And it's everywhere: risk pricing in banks, particle physics, light rendering in Pixar films, and — nerdy confession — in project deadline estimation. Remember PERTCalc, one of my tools? The serious version of "when will this project be done?" is exactly this: simulate the schedule thousands of times and look at the distribution, instead of pretending there's a single magic date.

My honest take: probability isn't prophecy

I have to be fair with you: the ratings I plugged in there are illustrative, for teaching — not official. And even a model with perfect scores only captures relative strength. It doesn't know about the injury the night before, the red card at minute 20, the keeper having the game of his life. The model gives you odds, not destiny. When EA "gets the champion right," it's half method and half luck of the most-likely number landing — and when it's badly wrong, it's just the upset the model itself said was possible.

That, to me, is the lesson that goes way beyond football. In my work I deal with uncertainty all the time — deadlines, costs, server load, the conversion rate of a new site. The temptation is to state a single number and fake confidence. The honest path (and the more useful one for the client) is to say "look, the most likely scenario is this, but there's a 20% chance of that other thing, so let's prepare for it." A good model isn't the one that guesses the future; it's the one that makes uncertainty visible so you can decide better.

Enough talk — run the Cup 👇

Below is the simulator I wrote: pure JavaScript, no libraries at all. Click "Play one Cup" to watch a bracket play out on luck (and sometimes a gorgeous upset). Then hit "Run Monte Carlo" — pick how many tournaments on the slider — and watch the probability bars fight, wobble, and finally settle. It's the Law of Large Numbers coming alive on your screen.

monte-carlo.js

Pure JS, no libraries. Illustrative ratings (not official). Run one Cup or thousands and watch the odds converge.

If you spent a few minutes running Cups up there, thanks for making it this far. This is exactly how I work: I take a silly curiosity — "how does the game predict the champion?" — and turn it into something that works, teaches, and is fun to play with. If you have a project that deals with numbers, probability, or decisions under uncertainty (or just an idea that deserves to ship), I'd love to chat.

Let's talk about your project