Logo Lanfrica

emezac/LottoAnalysis

Type de record:

dataset
Créateur:
eme
Hôte:
I have always had a sneaking suspicion that there is an optimum number of lottory tickets to buy such that minor wins consistently cover the ticket prices. I analyzed historical data for the South African Lottery to find out. data # LottoAnalysis I have always had a sneaking suspicion that there is an optimum number of lottery tickets to buy such that minor wins consistently cover the ticket prices and maybe allow a little profit over a period of time. In other words, instead of hoping to win the big jackpot, one could buy number of tickets at a time hoping that the wins of R100 here or R200 there could pay for all the non-winning tickets, and maybe allow some profit. I analyzed historical data for the South African Lottery to find out. The python script in this repo pulls data from the 51 most recent lottery results from www.lottonumbers.com. Then, it chooses random numbers for tickets and sees how much we would have won. This code will run 30 hypothetical scenarios, wherein we buy 1, 2, 3, ..., up to 30 tickets for each draw (each with unique random numbers), and then see how many of those ticket would have won money. The results are plotted on a bar plot (see below) with each scenario represented by a bar in the bar plot. The results indicate a trend: in geneal, buying a greater number of tickets for a draw will result in losing more money. Running the code again will yield a different number set (due to random numbers being selected for each draw). It is noteworthy that, sometimes, a moderate number of small wins will offset the cost of the tickets. However, as the number of tickets bought (and thus the cost) increases, the likelihood of this happening decreases. Repeatedly running this model shows that - with a few lucky exceptions - only scenarios that even came close to having an overall positive profit were those with a relatively small amount of money spent on tickets Thus, if one does play the lottery, one should see this money as part of one's entertainment budget - and thus not a loss so much as a price paid for an entertainment experience. If one wanted to maximize any chance of winning anything at all, then it is best to keep the number of purchased tickets small. Say, less t …