Illinois Pick 4 contains the following programs:
Lottery | Program | Description |
---|---|---|
Pick 4 | combo.c | Subroutine to Calculate Combinations |
permute.c | Subroutine to Calculate Permutations | |
getp4.c | Subroutine to Calculate Probability | |
p4prob.c | Prints Probability | |
pick4.c | Illinois Pick 4 (your ticket) |
By reading the source code in getp4.c you can learn how to calculate the probability for winning a prize.
There are no parameters for the p4prob program. Just run it directly from the console.
The pick4 program allows you to play Illinois Pick 4 for 100 years to see how often you win each prize. The help parameter is -h.
pick4 -h
By playing pick4, you can see how many times you have to play just to break even. Since the lottery pays out no more than half of its income, you will almost always lose money in the long run by playing pick4.
The prizes depend on the playing options and the odds of winning. This program assumes that you always pay $1.00 per game for the larger prize.
If you play with the straight/box option, you will see two winnings.
The net earnings column shows half as much gain or loss, because half the cost is allocated to exact match and the other half is allocated to match in any order. If you combine the two net earnings, the total should equal close to $33,000.00.
The pick4 program runs 13 times per week for 100 years. That gives you 67830 chances to win with your favorite numbers.
It is easier to describe probabilities in terms of one urn. Four balls are drawn from one urn with replacement. However, in practice, the lottery draws 1 ball from each of four urns. This gives the same probability as drawing with replacement.