Using Python and Statistics to pick random numbers for Texas Lottery
The odds of winning matching six numbers from 54 balls is 1 in 25+ million. Basically, there are over 25 million six-number combinations. You can use the following formula to get the actual number: (which is 25,827,165)
The five-number combinations are much better with 1:3,162,510 odds. Still rough. Four-number combinations will be 1:316,251.
There may be many approaches to finding higher probability combinations. After trying different methods, my most recent model will select a distribution from the lowest number selected to the highest. The graph below shows the overlapping normal distribution for each number - segmented by the lowest to the highest. As you can see, each drawn number overlaps. The blue graph shows the lowest numbers of each draw. It clearly overlaps with the orange. However, most balls drawn from the machine are lower, while the orange has higher values.
So, what if we can randomly pick each number based on the weight of the distribution. Based on the first number picked, we can use variances to generate weights for other picks. As you can see from the graph below, you can see how the distributions are laid out based on each number of variances.
I'm still working on this, but more will come as I update it.
The following codes are a part of the ways to create the distributions:
Comments
Post a Comment