January 07, 2010

Such a Geek!

This entry is going to make me sound like such a nerd, but hey, it's my blog and if I want to sound like I belong at a Star Trek convention I will do!

As the calendar flipped over to 2010, I was in a position to get a betting program set up for the forthcoming Football World Cup. Yes, it's not until June, but punters want to place early bets on it, and if you can be first in the market, you get the upper hand on your competitors. I took it upon myself to get the betting list up and running.

Are you familiar with sports betting? I know some of you will be, but just in case you're not, you have to imagine that people want to be able to bet on everything and anything. It's not just 'who will win the world cup?' it's things like 'who will be the tournament's leading goalscorer?', 'at what stage will Germany get knocked out of the tournament?', 'How many points will South Korea get in their three group games?'. You get the picture? If you can think of a legimate bet, someone out there will want odds for it.

Ok, Some of the odds are pretty straight forward to set. Tournament Winner etc., but others require a bit of careful planning, and here comes the geeky bit.

There are thirty-two teams in the event, and initially they are divided into eight leagues of four teams. Each team plays the other three teams in their league and the best two go through to the next phase. During this 'group phase' teams get three points for victory, one point for a draw and a big fat zero for losing. Doesn't take much mathematic reasoning to see that each team can score between zero and nine points (except for eight points which is impossible to obtain from three matches).

..and here comes the bet. Take any team, and bet on how many points they will get from their three opening games. Doesn't matter which team you support, you can bet on them. Perhaps you think France will beat all three of their opponents - so you can get a price for France to win nine points. Do you think England will easily win two of their fixtures, but might only manage a draw against USA? No problem, you can bet on England to finish the group games on seven points. Still with me?

Thirty-two teams, nine possible point outcomes (zero to nine excluding eight points). Two hundred and eighty-eight seperate bets. It can't be done by hand, you have to create a formula....and so I did.

Took a while and a lot of failed attempts, but then I finally hit upon the winning combination. The formula was written in Microsoft Excel, and could have rivalled the Encyclopedia Britannica if I printed it out, but there it was. I could enter the details of any team, and out popped a table of bettings odds for all the nine different point outcomes.

..The hard part now was the laboreous bit - typing it all into our computer system. The formula may generate the odds for me, but nothing is in place to help me export them all over to the other system. With a couple of breaks to work on other things, it took me just short of five hours to complete the typing.

..but there's more...the geeky bit :D

Up until a moment ago, I had nothing to compare my odds with. No other bookmaker I could find was offering these bets. That was until I found a leading British online bookmaker was offering it (but only for the England team). Tentatively I compared my odds to theirs. Chances are they had a super computer generating their odds, not a ream of scrap paper and one chap in front of a keyboard....

...and all nine odds were in the same ball-park! That is to say they agreed with my figures. (not exactly of course, would be a very boring industry if all our odds were identical, but they were all comparible). This meant two things. Firstly it meant I had the formula right, so I could trust the other two hundred and seventy nine odds, and secondly...

....it meant I am permitted to wear a smug face for a few days :)

1 comment:

Tim R said...

Geoff you are now an excel god. All hail the excel god!!!!