Building a World Cup Predictor with Elo Ratings and Monte Carlo Simulation: A One-Prompt LLM Experiment

    This article describes an experiment in which a single prompt asked an AI coding tool to build a 2026 World Cup winner-probability predictor using Elo ratings and Monte Carlo simulation. It explains the architecture, the statistical methods, the cost and iteration process, and the simulation results, including three counterintuitive findings about team strength and draw luck.

    Building a World Cup Predictor with Elo Ratings and Monte Carlo Simulation: A One-Prompt LLM Experiment

    1. Background: A Casual Experiment

    Around major sporting events, prediction tools are always popular practice projects for developers and data enthusiasts. I recently ran an experiment: I sent a single prompt to an AI coding tool—“Build a 2026 World Cup winner-probability predictor using Elo ratings and Monte Carlo simulation”—and then went to make a cup of tea.

    By the time I came back, a fully functional tool had been generated. It supported full schedule simulation for 48 teams, output scoreline distribution predictions, and could generate a shareable results page. The API cost worked out to about $13 (input and output are priced per million tokens, with output tokens costing roughly 5x input tokens, a common pricing range for currently stronger reasoning models).

    Is that expensive? A little more than a takeout meal. But implementing the same functionality by hand—Elo data structure design, Poisson-based scoreline generation, the Monte Carlo main loop, and a front-end visualization interface—would take at least a full weekend. That is the most direct value anchor for current LLM-assisted development: compressing “a weekend of engineering work” into “one prompt and one cup of tea.”

    Of course, this needs to be emphasized: the model handles code generation, but the developer still needs to validate architectural soundness and statistical correctness. Below, I break down the technical details and result analysis from this experiment.

    2. Technical Approach: Elo Ratings + Monte Carlo Simulation

    2.1 Why Elo Ratings

    Elo ratings originated in the chess rating system and are now widely used to quantify strength in competitive matchups. Their core advantages are:

    • Dynamism: After each match, the two sides’ ratings move in opposite directions, reflecting recent form.
    • Interpretability: The rating gap between two teams can be directly converted into an expected win rate using the following formula:
    1. E_A = 1 / (1 + 10^((R_B - R_A) / 400))

    Here, R_A and R_B are the Elo ratings of the two teams. A 400-point gap implies an expected win rate of about 91% for the stronger team; a 100-point gap implies about 64%.

    • Data availability: Public Elo rating data sources continuously update national men’s team rankings.

    2.2 The Monte Carlo Simulation Flow

    A single simulation is effectively “virtually playing a full World Cup.” The complete flow is as follows:

    1. Initialization: load Elo ratings for 48 teams
    2. for i in range(10000): # number of simulations
    3. Group stage: simulate each group match according to the schedule
    4. Win/draw/loss -> sample based on expected win probability
    5. Accumulate points -> determine qualifiers
    6. Knockout stage: single-match elimination
    7. If tied -> decide via extra time/penalties using a probability model
    8. Record the champion
    9. Statistics: each team's title count / total simulations = winning probability

    2.3 Scoreline Generation: Poisson Distribution

    Beyond win/loss outcomes, the tool also needs to output specific scorelines. Goal counts in football approximately follow a Poisson distribution:

    1. P(X = k) = (λ^k · e^(-λ)) / k!

    The expected goal count λ for each team is derived from the Elo rating gap (the stronger team gets a higher λ), and then the scoreline is sampled separately for each side. This not only provides a reasonable basis for extra-time decisions when knockout matches are tied, but also makes it possible to output a distribution chart of “most likely scorelines,” significantly improving shareability.

    2.4 Engineering Organization

    The generated code structure was roughly:

    • Data layer: team Elo ratings and group information (JSON structure).
    • Core engine: pure-function modules for Elo win/loss sampling, Poisson scoreline generation, and schedule progression, making unit testing easier.
    • Simulation layer: the Monte Carlo main loop; 10,000 simulations complete in seconds on an ordinary laptop.
    • Presentation layer: a web interface that renders probability rankings and scoreline distributions, with one-click share-link generation.

    Generating all of the above modules stably in one pass is unrealistic. In practice, two or three iterations are usually needed to fix edge cases (such as tie-breaking rules within the group stage and simplified assumptions for penalty shootout probabilities). These “human-AI correction rounds” are also part of the $13 total cost.

    3. Simulation Results: Top Five Teams Capture About 70% Probability

    Based on the Elo ratings at the time of simulation, the top five winning probabilities from 10,000 simulations were:

    Rank Team Elo rating Winning probability
    1 Spain 2157 ~31.9%
    2 Argentina 2115 ~17.8%
    3 France 2063 ~9.2%
    4 Brazil 1991 ~6.6%
    5 England 2021 ~6.0%

    The top five together account for about 70%, while the remaining 43 teams split the rest. This distribution broadly matches the implied probabilities from mainstream bookmakers’ odds, suggesting that the model’s statistical framework is self-consistent. But the simulation also produced three findings that clearly contradict common intuition and deserve a closer look.

    4. Three Counterintuitive Findings

    4.1 Colombia Is Significantly Underrated

    Colombia ranks seventh globally in Elo (1982), above the Netherlands and Germany, yet most people’s list of title contenders does not include them at all. Their group is not especially difficult to escape, and once they reach the knockout stage, their Elo strength is enough to support a deep run. Moreover, they reached the final of the last Copa América, and their core squad is still in its prime. Intuitive predictions are often dominated by “reputation,” while Elo only recognizes results—this is exactly where quantitative models add value.

    4.2 Germany’s Draw Is Extremely Difficult

    Germany’s Elo is 1932, but in the group stage they immediately face Ecuador, whose Elo is 1938—the opponent is actually 6 points higher, making the first group match an immediate clash. Compare that with another seeded team: its group opponents are rated only in the 1400–1600 range, almost a guaranteed path to advancement. With the same seeded status, the luck of the draw can be precisely quantified through simulation, which is a unique advantage of Monte Carlo methods over subjective judgment.

    4.3 Japan’s Elo Is Surprisingly High

    At 1906, Japan ranks 14th globally and first in Asia, more than 130 points ahead of South Korea and Iran. In their group, against the Netherlands (1948), the Elo gap is only 42 points—corresponding to an expected win rate of about 44% vs. 56%, a genuine toss-up rather than an “underdog vs. giant” script.

    There is also an interesting Easter egg: the simulation shows that the Elo gap between Spain and Argentina (42 points) is exactly the same as the gap between Japan and the Netherlands. In other words, in this model’s eyes, the level of suspense in “Japan vs. the Netherlands” is equivalent to that of a “Spain vs. Argentina” summit clash. Statistical models do not lie, but their answers often challenge our experiential intuition.

    5. Conclusion: Efficiency Boundaries and Engineering Lessons

    This experiment yields three general lessons:

    1. Prompts should specify methodology, not just describe requirements. A technical constraint such as “use Elo plus Monte Carlo” lets the model directly produce a reasonably architected implementation instead of toy code piled up with if-else statements.
    2. Have cost awareness, but use the right anchor. Token-priced API costs should be evaluated against “in-house engineering hours”—a low-double-digit dollar call that saves a weekend is worthwhile for most developers.
    3. Model-generated does not mean inspection-free. Details such as group-stage tie-breaking rules and penalty-shootout probabilities are often simplified by the model and need to be checked one by one. Humans own domain correctness; the model owns engineering efficiency. That is the best division of labor in current human-AI collaboration.

    From one prompt to a runnable product, what stands in between is no longer coding ability, but the ability to ask the right question and validate statistical logic. That may be the real reason this kind of experiment is worth recording.