This year’s Super Bowl wasn’t a good one. Not because I care who won- I don’t- but because I lost every Super Bowl box pool I entered. Granted, law of large numbers, etc. this can happen. But I wanted to see if my complaints were justified.
Let’s take a look at my work pool. I had 4 boxes:
Carolina | Denver |
---|---|
8 | 5 |
6 | 1 |
4 | 3 |
5 | 9 |
I’d like to know the equity of my four boxes, how much of the prize pool I deserve to make back from my initial investment.
Strategy
- Find a data set containing all 2015 regular season games.
- Calculate the total number of times each of the 100 boxes would have hit at the end of the game.
- Divide each total by the number of games in the season.
- Each box now shows its equity.
Dataset
This step was surprisingly the hardest. Searching high and low, I finally found salvation on pro-football-reference.com. After exporting to a csv, I was off to the races.
Road Bump One: Who was Away
It does matter who is away and who is home – else, how could we populate the squares and rectify it with the Super Bowl results. Most teams will play better at home (that is speculation, but I think it’s justified) and therefore score more points.
Since, except in rare cases, both teams are on the road during the Super Bowl, I went with who won the coin toss: Carolina. So, I normalized the CSV such that the home team’s score always appeared on the left.
Here is how my csv looked:
Home,Away,Home,Away Oakland Raiders,Cincinnati Bengals,13,33 Jacksonville Jaguars,Carolina Panthers,9,20 Houston Texans,Kansas City Chiefs,20,27 ...
Raw Counts
Let’s just come out and say that we can easily exploit the modulus operator to get the digit in the ones column. So, the challenge now, is populating a matrix with the number of regular season games that would’ve ended on that square. The code below takes care of that.
public static void main (String[] args) throws IOException { int[][] boxes = new int[10][10]; File file = new File("C:/nfl2015.csv"); BufferedReader buffer = new BufferedReader(new FileReader(file)); String line; int count = 0; while ((line = buffer.readLine()) != null) { String[] fields = line.split(","); if (fields.length >= 4 && fields[3].matches("\\d+")) { int home = Integer.parseInt(fields[2]) % 10; int away = Integer.parseInt(fields[3]) % 10; boxes[home][away]++; count++; } } buffer.close(); }
Getting the Equities
Now we just need a 2d array of Doubles with the values being the box value divided by the number of games. Easily done:
double[][] equities = new double[10][10]; for(int i = 0; i < boxes.length; i++) { for(int j = 0; j < boxes[0].length; j++) { equities[i][j] = (double) boxes[i][j]/count; } }
Exporting to Something Useful
I don’t know about you, but printing to the console doesn’t really allow me to glean the full value. Instead, lets dump to a csv, and open in Excel.
public static void writeMatrixAsCsv(double[][] equities) throws FileNotFoundException { PrintWriter out = new PrintWriter(new File("C:/Output.csv")); for(int i = 0; i < equities.length; i++) { for(int j = 0; j < equities[0].length; j++) { out.print(equities[i][j] + ","); } out.println(); } out.close(); }
The Results
The typical expected value would be, and any math geeks may want to correct me, but I think (chances) * (mean EV), or .04 for four boxes.
Based on my data set, my four boxes had an equity of 2.3438% of the prize pool. In other words, for my $40, I should have expected something like $23.5. Poor ROI for sure. Then again, some boxes (like Home: 0 Away: 3), are worth almost 5x the typical box.
One last thing to mention: I let the guy running the pool choose my boxes for me. Never again!
Leave a Reply