The TGIAF World Cup Simulator
In the build-up to the World Cup, we built a simulator for the 2014 Brazil World Cup. This led to a large number of articles, which can be found at the bottom of this page.
These articles contain thorough mathematical explanations for the workings behind the model. However, this page aims to give a more general overview of the model. This is based on a talk I gave to the Computing Science & Mathematics department at the University of Stirling.
These articles contain thorough mathematical explanations for the workings behind the model. However, this page aims to give a more general overview of the model. This is based on a talk I gave to the Computing Science & Mathematics department at the University of Stirling.
Introduction

The model began as an experiment to see if individual matches could be simulated using weightings determined from odds from bookmakers. However, it soon expanded into a tool which could simulate the whole tournament. Running large numbers of simulations has allowed us to try and understand how the tournament might be expected to evolve, which also meant we could trade off short-term odds (individual match odds) against long-term odds (for example, the odds of a team winning the tournament).
The model is of the 2014 World Cup. The teams, in their groups, are shown above.
The model is of the 2014 World Cup. The teams, in their groups, are shown above.
One-off match
If we had a single odd for an event, for example, 175/1, we might think this represents a 1/175 chance (0.57%) of the event occurring. However, bookmakers are there to earn a living, and so the odds are weighted to make sure they do. Which means this event has a less than 1/175 chance of occurring. But we don't know how much less. (This said, the event in question is Luis Suarez biting an opponent, so in this case the bet came through).
However, for an event where you have odds for every possibility, you can get a reasonable estimate of each outcome's chances of occurring. And for an individual match, the bookies will give odds on all three outcomes: Team 1 winning, a draw, and Team 2 winning.
However, for an event where you have odds for every possibility, you can get a reasonable estimate of each outcome's chances of occurring. And for an individual match, the bookies will give odds on all three outcomes: Team 1 winning, a draw, and Team 2 winning.
We will use the example of the Spain - Netherlands match. Fig. 1a shows the odds given to this match beforehand. Use the arrow icons to move between the different figures.
The lower the odds are, the more chance that event has of occurring. But it would be easier for us to have a larger number representing a larger chance of happening, so we simply turn the odds upside-down to get the inverse, where a larger number represents a higher chance of occurring Fig. 1b). |
|
We now have three values, of the right size to reflect their likelihood. In order to find the actual probability, we divide each of these values by the total, so they add up to 1 (Fig. 1c). We can then create three boundaries, and generate a random number between 0 and 1 to simulate the match:
Below you can simulate this match for yourself! Simply type anything into the grey cell, and press enter.
- 0 - C1, where if the random number lands here, then Team 1 will win.
- C1 - C2, where if the random number lands here, then it will be a draw.
- C2 - C3, where if the random number lands here, then Team 2 will win.
Below you can simulate this match for yourself! Simply type anything into the grey cell, and press enter.
Group stages
We can now easily implement this method to all the matches in the group stages of the World Cup, an example of this is in Fig. 2a, where Group G is used.
This means we can draw up a league table using these results. However, a situation might arise, as in Fig. 2b (which shows the real-life results), where two teams are tied. As we don't look at goal difference, we need a way of separating teams. We simply just generate a new, smaller, random number to decide this for us. Below you can simulate Group G for yourself. Once again, just type anything into the grey box and press enter. |
|
Knock-out rounds
Whilst group stage matches were straightforward to model, the knock-out stages poses problems, as odds didn't exist for the matches (since the matches hadn't been decided yet), therefore we have to create our own odds.
|
We needed to first understand how strong teams were in relation to each other. To do this we used the odds of each team winning the tournament (averaged across four bookmakers). This gives us a coefficient for each team, and are shown in Fig. 3a.
To understand how strong a team is in a particular match, we divide its coefficient by its opponent's (which we'll call x). We can then look at the relationship between x and the odds given for group stage matches. This relationship is shown in Fig. 3b. |
Breaking this graph up into smaller parts, we were able to find rules for the odds of a team winning or drawing given x. These rules are shown in Fig. 3c.
One final challenge was to decide the outcome of a draw (an example is shown in Fig. 3d). Once again, we generate another new random number between 0 and 1. If the number is below 0.5 then Team 1 go through, and if it is above 0.5 then Team 2 progress.
Below you can put this all together. Enter any team teams within the tournament into the "Team 1" and "Team 2" boxes. Once again, you can get a new simulation by entering text into the dark grey cell and pressing enter.
One final challenge was to decide the outcome of a draw (an example is shown in Fig. 3d). Once again, we generate another new random number between 0 and 1. If the number is below 0.5 then Team 1 go through, and if it is above 0.5 then Team 2 progress.
Below you can put this all together. Enter any team teams within the tournament into the "Team 1" and "Team 2" boxes. Once again, you can get a new simulation by entering text into the dark grey cell and pressing enter.
The final simulator
With everything in place, below is the TGIAF World Cup simulator for you to enjoy! Once again, type anything into the dark grey cell and press enter to bring up a new simulation.
Below you can find more details on how the simulator was constructed, and more analysis on its effectiveness and how it could have made you money.
Related articles
Predicting Football Results Using Odds - where the full logic behind the one-off match calculations is explained.
Creating Football Odds - where we work out the best way to predict odds for any two teams meeting in a World Cup knock-out match.
The TGIAF World Cup Simulator - the final touches are applied to the simulator, and it is available to download.
A Thousand World Cups - the simulator is run 1000 times, allowing us to get data estimate each team's chances in the tournament.
What to Bet On - we use our multi-simulations to find the best value bets for the tournament.
World Cup Permutations (Groups A-D, Groups E-H) - before the final round of group matches, the model is used to give the probabilities of each team qualifying from their group.
Testing the Simulator - we review the performance of the simulator, and see if the recommended bets would have made money.
Creating Football Odds - where we work out the best way to predict odds for any two teams meeting in a World Cup knock-out match.
The TGIAF World Cup Simulator - the final touches are applied to the simulator, and it is available to download.
A Thousand World Cups - the simulator is run 1000 times, allowing us to get data estimate each team's chances in the tournament.
What to Bet On - we use our multi-simulations to find the best value bets for the tournament.
World Cup Permutations (Groups A-D, Groups E-H) - before the final round of group matches, the model is used to give the probabilities of each team qualifying from their group.
Testing the Simulator - we review the performance of the simulator, and see if the recommended bets would have made money.