From One Sentence to a Working App: Building a World Cup Winner Probability Predictor with an AI Coding Assistant
A hands-on retrospective on using an AI coding assistant to build a 2026 World Cup winner probability predictor from a single prompt. Covers the technical design behind Elo ratings plus Monte Carlo simulation, the quality of the AI-generated code, cost analysis, three counterintuitive findings from 10,000 simulations, and a reusable workflow for AI-driven development.
From One Sentence to a Working App: A Full Retrospective on AI-Driven Development
1. Background: When Development Becomes “Ordering Off a Menu”
Major sporting events are always a great testbed for modeling skills. With the 2026 World Cup expanding to 48 teams, the schedule becomes far more complex, and computing championship probabilities by hand is essentially impractical. Around the same time, AI coding tools took another step forward—particularly in long-context handling and multi-step reasoning—turning “generate a working product from one sentence” from a marketing slogan into something you can actually verify yourself.
So I ran an experiment: no requirements document, no prototype mockups—just one sentence sent to an AI coding assistant:
“Build me a 2026 World Cup winner probability predictor using Elo ratings and Monte Carlo simulation.”
Then I went and made a cup of tea. When I came back, a tool that could simulate the full 48-team tournament, predict score distributions, and generate shareable links was sitting in my folder. The API bill for a single conversation came to roughly $13.
This article won’t stop at “AI is amazing.” Instead, I’ll break the process down and cover three things clearly: how the technical approach was designed, what the code looks like, and how to interpret the results without falling into traps.
2. Technical Approach: Why Elo + Monte Carlo
2.1 Elo Ratings: Compressing Strength into a Single Number
The Elo system was originally designed for chess, and its core idea is simple: after each match, both teams’ ratings are adjusted based on the gap between the “actual result” and the “expected result.” The expected win probability is determined by the rating difference:
E_A = 1 / (1 + 10^((R_B - R_A) / 400))
Here E_A is Team A’s expected score, and R_A, R_B are the two teams’ ratings. A 400-point difference corresponds to roughly a 10x strength gap. The advantages of this system:
- Self-contained: only requires historical match results—no scouting reports or market odds needed;
- Interpretable: rating differences convert directly into win probabilities with transparent logic;
- Updatable: after each match, ratings roll forward with
R' = R + K × (S - E), where the K-factor controls sensitivity to individual results.
It does have limitations: it doesn’t account for home advantage (a home-field adjustment is needed), ignores lineup changes and injuries, and requires manually tiered weights for friendlies versus competitive matches. But for a predictor that ships “same day,” these simplifications are reasonable engineering trade-offs.
2.2 Monte Carlo: Breaking “Who Wins It All” into Ten Thousand Parallel Universes
Championship probability has no closed-form solution—knockout matchups depend on group standings, creating massive conditional branching. The Monte Carlo approach is straightforward: let the tournament play out completely in the computer ten thousand times, and count how often each team wins.
The flow of a single simulation:
- Initialize all 48 teams according to the group draw;
- Generate each group-stage score using a Poisson distribution (expected goals mapped from Elo differences);
- Rank teams within groups by points and goal difference;
- Advance through the knockout bracket, resolving draws with penalty shootouts (win probability plus a random number);
- Record the champion, and repeat ten thousand times.
2.3 Score Generation: The Poisson Distribution Is the Key Piece
The classic way to model football scores is to give each team an expected goals value λ, with goals following a Poisson distribution. λ can be derived from the Elo difference via a calibrated mapping function:
import numpy as npdef expected_goals(elo_a, elo_b, base=1.35):diff = elo_a - elo_b# Each 100 Elo points roughly corresponds to a 3:1-scale change in the# expected goal ratio; the coefficient must be calibrated on historical dataratio = 10 ** (diff / 400 * 0.9)lam_a = base * ratio ** 0.5lam_b = base / ratio ** 0.5return lam_a, lam_bdef simulate_score(lam_a, lam_b):return np.random.poisson(lam_a), np.random.poisson(lam_b)
This produces “normal” scorelines like 2:1 and 0:0, while occasionally simulating upset blowouts—matching the distribution of real matches.
3. The Quality of the AI-Generated Code: What Exceeded Expectations
Reviewing the generated code, several points deserve mention:
1. Data structures were right on the first pass. It automatically defined classes like Team (with Elo and group assignment), Match, Group, and Tournament, with clean module separation between the simulation core and the frontend—no second round of refactoring needed to extend it.
2. Edge cases were covered. Tiebreaker rules for equal points in the group stage (points → goal difference → goals scored → fair play points) and penalty shootout handling in the knockouts—exactly the spots that are easiest to get wrong—were proactively handled. This suggests modern LLMs are now reliable enough at long-chain logical reasoning to support development of moderately complex, self-contained modules.
3. The cost structure of one-shot generation. The generated code is billed by tokens; one conversation cost about $13. Measured against human developer time, this simulator plus its frontend would have taken at least a full weekend. The cost conclusion: for tool-type applications with clear structure and requirements that can be precisely described in natural language, the marginal cost of one-shot AI generation is already below the cost of one hour of developer time—and that’s the real prerequisite for this kind of usage to make sense.
That said, caveats remain: AI-generated parameters (like the Poisson mapping coefficients) need manual calibration and shouldn’t be trusted blindly; probability conclusions should be cross-validated against external references.
4. Interpreting the Results: Three Counterintuitive Findings in the Data
After 10,000 simulations, the headline conclusions weren’t surprising—based on Elo ratings at the time, the top five teams absorbed about 70% of the championship probability, with Spain (~31.9%) and Argentina (~17.8%) leading, broadly consistent with mainstream bookmaker odds. But three spots in the distribution diverged from popular intuition, and that’s where the modeling value lies:
1. The underrated seventh-ranked team. One South American team ranks seventh globally by Elo—ahead of several traditional powerhouses—yet barely anyone mentions it in popular predictions. The reason: Elo reflects over two years of consistent results (including a run to the final of the last continental championship), while public memory lingers on older impressions. Its group opponents are relatively weak, so after advancing, its strength rating can carry it far. Probabilistic models are especially sensitive to these “overlooked upper-mid-tier strong teams.”
2. The “luck of the draw” gap among seeded teams. Among teams that are all seeded, some face group opponents whose average Elo is within 50 points of their own—making the group stage a genuine battle—while others face opponents rated over 300 points lower, effectively a free pass to the knockouts. Monte Carlo simulation naturally amplifies this draw-luck difference into significant divergence in championship probability, something manual analysis struggles to quantify.
3. The stratification in Asian football. The top Asian team’s Elo is more than 130 points above the second- and third-ranked Asian teams—a clear gap. Yet its Elo difference against a European heavyweight in the group stage is only about 40 points, meaning the stereotype that “Asian teams will inevitably be crushed” doesn’t hold up in the data.
Together these findings point to one thing: intuitive predictions are systematically biased toward “fame,” while probabilistic models faithfully reflect “recent strength + schedule structure.” Where the two diverge is often where the informational edge lives.
5. A Reusable Workflow
Abstracting this experiment into a transferable methodology:
- Compress the requirement into one sentence: settle on the key technical terms first (“Elo + Monte Carlo”); the ceiling of AI generation quality depends on the precision of the approach you describe;
- Data first: organize external data (the Elo ratings table) into a structured format and feed it to the model, so it doesn’t fabricate data;
- One-shot generation + manual calibration: let AI handle the structure, and calibrate parameters yourself against historical data;
- Cross-validate conclusions: compare model output against independent references (e.g., market odds). Agreement adds confidence; divergence may signal informational edge—or model bias—and needs to be checked item by item;
- Cost awareness: estimate token consumption in advance; 10,000 simulations is a reasonable balance between accuracy and cost.
When “one sentence for one product” becomes reality, a developer’s real competitiveness is no longer typing speed, but solution design ability, data judgment, and critical interpretation of results. The stronger the tool, the more skill it takes to use it well.
