Lottery Winners Counter

Did you know that 94% of lottery tickets get no balls, one ball, or two balls – and therefore don’t win a prize… the odds of getting three balls (1 in 57) [source: National Lottery: Prize Allocation] is less likely than the odds that recently-reported asteroid 2004-MN4 was going to hit us (widely reported as 1-in-37, now disproven: we will not be hit by 2004-MN4 in 2029)?

Yes; let’s face it – we all know these figures. But numbers like these aren’t a great way to reflect quite how hideously unlikely you are to win anything. So….

Recently, a colleague of mine showed me a little JavaScript application that counts real-time deaths from various causes. Basically, the author took statistics from the WHO about averages deaths by cause per year, and wrote this application to illustrate the death rates. Go watch it for awhile and then you’ll understand.

In any case; Claire suggested that a really good idea would be a similar application based on National Lottery statistics – one that showed the rate of ticket purchases versus the ‘win rate’ in a “live”, graphical, display. Of course, this model would make some assumptions – that tickets were bought evenly throughout the week (and not in a ‘rush’ on Saturday afternoons), for example, and that every ticket was pre-determined to be a ‘winner’ or not. In any case: she did the maths, and I wrote the code, and here it is

(if you’re viewing this page through Abnib this won’t appear as it should – view the calculator here)

If you want to put this application on your own weblog, or your own web site, or wherever, the code to do so is:

<script language="JavaScript" type="text/javascript" src="/q23-content/lottery.js"></script>

If your weblog is hosted with somebody else (e.g. LiveJournal) you might not be able to put scripts on your ‘blog. Just so you can’t say I didn’t warn you.

0 comments

    Reply here

    Your email address will not be published. Required fields are marked *

    Reply by email

    I'd love to hear what you think. Send an email to b582@danq.me; be sure to let me know if you're happy for your comment to appear on the Web!