## Application Worksheet: Lottery Simulator

Maple 14

This is not really the next part in my randomness series, but more of an aside.  I used Maple's embedded components to use the Lotto649 drawing data from my last post to create a historical lottery simulator.  Basically, you fill in your prefered numbers, and it simulates you playing the lottery in every draw since 1982. Here is a screenshot of the interface, and an example of the sort of output it generates from your pick:

```In the 2768 draws of the Canadian National 6 of 49 Lottery from Jun 12, 1982 to Jul 31, 2010,
the pick {7, 20, 23, 26, 33, 46} would have won the:

6/6 jackpot 0 time(s)
5/6 + Bonus ~\$200,000 prize 0 time(s)
5/6 ~\$2000 prize 0 time(s)
4/6 ~\$75 prize 5 time(s)
3/6 \$10 prize 53 time(s)
2/6 + Bonus \$5 prize 34 time(s)
2/6 match but no prize 381 time(s)

That would have won approximately \$1075 or \$0.39 per \$2 ticket.
Putting the cost of a ticket into the cookie jar each week would have yielded \$5536.
Putting the cost of a ticket into a savings account each week at 3% interest would have yielded \$8475.
```

Download the worksheet here: Lotto649-Simulation.mw and play with your own numbers.

I wrote this back in June, and in a case of great minds think alike, Rob  Cockerham of Cockeyed.com posted this similar Incredibly Depressing Mega Millions Lottery Simulator in September. His simulator generates its own random draws, I believe, rather than using historical data, however.  Hopefully you will find my simulator just as depressing.

I also created a number of other simulators with this data to let you simulate many of the schemes presented in "How to Win the Lottery!" books.  I will post those applications in the near future, but I don't think its spoiling anything to tell you that the yield of every system I tried is about 18 cents on the dollar.

﻿