This repository provides a method to optimally choose lottery games by:
-
Ensuring no two games share three numbers in common
This means that if a partial prize is awarded by matching three or more numbers, the likelihood of winning a partial prize is optimized. -
Ensuring no numbers below a given threshold are contained in these games
A suggested threshold is 32, since many people pick "birthday" or "favorite" numbers that rarely go higher than 20. Excluding lower numbers helps minimize the chance of sharing any potential prize with those who pick common low numbers.
- Adjust the variables in
config.toml. - Recommended: set your own seed for the random number generator. This helps ensure that you won’t be playing the exact same games as someone else using this repository.
- The initial set of games (
games) can be set with your lucky or favorite game sets.
To generate your set of lottery games, run:
cargo runThis will produce optimized_games.csv.
For a quick correctness check (written in Python), run:
python test_set.pyBoth steps (Rust and Python) can also be executed in Docker by running:
bash run.shA file named optimized_games.csv will be created on the root folder.
Run tests locally:
cargo testOr run tests in a Docker container:
bash test.shPull requests are welcome. Feel free to fork this repository and submit your changes.
May the odds be ever in your favor.