Simulate the Texas Lottery on the TI-85. Demonstrate the futility of betting on the lottery. Program: LOTTO, LOTTOrpt, LOTTOini, LOTTOagn Author: John P. Powers (jpp@cpdvax.csc.ti.com) Date: May 8, 1993 LOTTO generates 6 of 50 LOTTO picks for the Texas Lottery. LOTTOrpt lets you input a winning lottery number then compare against hundreds of randomly generated lottery tickets. The program tallies how many match 3, match 4, match 5, and match 6 tickets were generated. Match Win 3 $3 4 $Hundreds 5 $Hundreds of thousands 6 $Millions Winnings for match 4, 5, and 6 are computed by a paramutual formula and depend on the number of winners. Simulate the investment of $100 worth of tickets and watch as you rack up six dollars of winnings! Run LOTTOrpt. The program prompts for a winning ticket number. Enter a list of six LOTTO numbers. The brackets that surround a list are found on the LIST menu. The program then prompts for the number of tickets to purchase. Each ticket costs a dollar. As the program runs, it displays the current ticket number being processed in the upper left corner of the screen. Each time a match is found, the winning ticket, the matching ticket, and a tally of match 3, 4, 5, and 6 is displayed. When the program is finished, a menu prompts for F1:MORE or F5:QUIT. Note: You should seed the random number generator if you have just reset calculator memory. All TI-85s start generating the same sequence of random numbers when reset to the factory random seed. Use something like "log 930508->rand" to start a different random sequence. Example: LOTTOrpt Winning ticket? {..} ?{7,10,11,23,34,43} <-- Texas Lottery May 1, 1993 winning ticket How many tickets? 100 {7 10 11 23 34 43} <-- Winning number {11 13 23 34 42 50} <-- Match 3: 11 23 and 34 {1 0 0 0} <-- Tallies of match 3, 4, 5, and 6 {7 10 11 23 34 43} {11 12 13 23 43 50} <-- Match 3: 11 23 and 43 {2 0 0 0} In this sample run, two tickets matched three of the winning numbers. A $100 investment won $6. I've simulated thousands of LOTTO tickets and seen less than a dozen match fours, and never any match five or six.