Pages

Friday, August 8, 2014

Winning The Lottery

I am not a gambler but I do like the idea of winning $115,000,000 which is the current jackpot for the Mega Millions Lottery.  I am aware that the odds of winning the top prize is 1 in 258,890,850.  In fact there is a formula that tells you what your ticket is worth and when it's best to buy yourself a ticket.
You multiply 1/258,890,850(odds of winning) X  $115,000,000(jackpot)/1 = 0.44 X $1(ticket price) = $0.44 so if I buy a ticket today my $1 ticket is worth about 44 cents.  When the jackpot rises to $259 million and above the value of your ticket is actually higher than $1 which makes this a better time to buy a ticket if you play regularly.  With that said I am too busy to play but occasionally I do play for fun and I try to find creative ways to do so.

I wrote a computer program a few years ago using Python I tried it out a few times but then forgot about it I did match 2 numbers the first time I used it.  I recently decided to take a look at the program and update it using a newer version this new code will pick random numbers for me similar to the quick pick option at the store or the random number generator on the website.  I created the program as a fun way to play the lotto I wouldn't want to play any other way.  Technically the program could pick the right numbers to make me a winner but the program will not give me a higher probability of winning compared to any other method that others use.


Step 1 - Run the program I created  by pressing 'run' (top left) write down the numbers                  



Step 2 - Bubble in the numbers on the NY Mega Millions Lottery Slip



No comments:

Post a Comment