Little Lotto

Copying lotto

Little Lotto contains the following programs:

Lottery Program Description
Little Lotto combo.c Subroutine to Calculate Combinations
getlot.c Subroutine to Calculate Probability
lotprob.c Prints Probability
lotto.c Little Lotto (your ticket)
qpick.c Little Lotto (quick picks)

By reading the source code in getlot.c you can learn how to calculate the probability for winning each of the 4 prizes.

There are no parameters for the lotprob program. Just run it directly from the console.

The lotto program allows you to play Little Lotto for 100 years to see how often you win each prize. This program has 5 parameters, the five numbers on your ticket. For example,

      lotto 01 03 05 07 09

The qpick program allows you to play Little Lotto over and over to see how often you win each prize. This program has 1 parameter, the number of times you want the program to play Little Lotto. For example,

      qpick 100000

In this example, the program plays lotto 100 thousand times and then prints the totals and the chi square test for the run.

By playing lotto or qpick, you can see how many times you have to play just to break even.

Notice the last line 0 before the total line. This line shows you how often you do not win a prize.

Earnings are based on a cost of $1.00 per game. The winning pool is one half the sales revenue from the lottery. The all the prizes are a different percentage of the winning pool, divided among the winners. In this program, the sales revenue is assumed to be derived only from your participation.

You can see from running the program that if you buy 100 thousand tickets, you usually lose more then 75 thousand dollars. The qpick program allows you to play as often as you wish. The lotto program runs twice a week for 100 years. That gives you 10436 chances to win with your favorite numbers at a cost of one dollar per chance.