Bill Cheswick's Lottery Simulator: How long does it take to win the lottery?

This is a port to iOS of a hands-on science museum exhibit I wrote around 2002. It is hard to teach people about probability, but a lot of people play the lottery. How long does it take to actually win, if you purchase two tickets a week?

The program simulates the play and payoff of a popular state lottery. You choose six numbers, and get a payoff for matching three or more.

The jacket pot (matching all six numbers) may be shared with other winners. Like most lotteries, this one assumes that the jackpot is an annuity, paid out over 20 years. It also assumes that you take the cash, and pay a typical tax on the jackpot. (Tax is not computed for the lesser matches.)

You can pick your own numbers, have the computer pick numbers at random, or it will pick at random a set of numbers that has actually been picked in a real lottery. Your best bet (not that are any good bets) is to pick the numbers randomly, since you are less likely to pick a popular number. The odds of selection are the same, but you are less likely to have to share the winnings with someone.

The app keeps "buying" tickets and choosing random numbers until you win. The date is shown. You can keep playing if you wish.

In a future version, I might add a section showing the amount of money you would earn useing some alternative investments. Suggestions are welcome.