# In which he uncovers statistical anomalies in the Powerball lottery drawings

TL;DR > my analysis of the drawing results reveals that the best numbers to choose are 41, 20, 32, 16, 26 – and the best Powerball is 37.

Purely intentional link bait headline.  Sorry.  I’m not terribly well versed in statistics so you should do your own analysis.

I don’t play it, but the Powerball intrigues me because it should be a game of chance … but oddly the numbers aren’t distributed quite as evenly as I would have thought. (see what I did there?)

I’ve experimented with the historical lottery data before, having massaged it in Perl as well as in Ruby and even put it into a MySQL database to run some overly-complicated SQL on it.

The more time I spend with Ruby’s Enumerable, though, the more I see I can do with it.  It’s a programming enlightenment of sorts for me.  I cut my professional teeth as a DBA and databases have been my first instinct for problem-solving for a long time – but the reality is I can do an awful lot with just a little bit of code, and I’m enjoying the challenge of putting it together.

What I found in tonight’s look at the Powerball echoes what I remember last time I looked at the numbers – that some numbers occur nearly half again as often as others, even across nearly 1,500 lottery drawings.  Excluding numbers in the 50s as they are newer to the game, we find that 41 has been drawn 162 times as of today, while 25 has been drawn just 117 times.  Similarly, with the Powerball, 37 has been drawn 51 times and 16 just 28 times (40, 41 and 42 were added later, I believe).

Here’s my Ruby project on Github - you can see the current results on the main page.

There are a number of complicating factors that make this simple analysis close to, if not completely, meaningless – not the least of which are the several changes to the numbers included in the game over the last several years.

Also, in case you’re wondering, the odds are 1 in 175 million that you’ll win the jackpot.  Wikipedia notes you may be 3 times as likely to die in a traffic accident driving to the store to buy the ticket as you are to win.  So if this analysis improves your odds by a (rather fantastic) factor of 3, it’s even money whether you’ll win or be crushed and incinerated in a fiery tanker truck collision.