Random Musings of Brian A. Thomas. Love for Ari and Sidd.
My Lottery Program
While checking out the USA Mega site yesterday, which I mentioned in my lottery post, I was browsing around I and found their Mega Millions Statistics. It seems some numbers come up more often than others, a statistical anomaly one would suppose, but one that is there none the less. For example, 25 has came up 28 times in the last 195 drawings, 07 and 36 27 times, while 47 has appeared only 9 times with 19 having been pulled only 7 times. This got me thinking that it would be interesting to take a program that allows the user to filter certain numbers out of a list when it generates a the lottery number, further the user would be able to make a list of numbers they wanted to either be weighed more heavily, or a short list of numbers that they wanted to pick from. Say they picked a short list of 8 numbers, the program then would generate numbers just from that list.
As I researched further, I learned about lottery wheels, a way of putting those numbers on the slip as to guarantee a win if any X number of those 8 numbers are drawn. Let’s say you want to guarantee a win with the Mega Millions, short of matching the Mega Ball, the easiest way to do this is get 3 of the 5 numbers right. So if your list is 8 numbers big, you will want at least 3 to be drawn, (excepting California, or Texas if you use the Megaplier option) a 3 number draw without matching the Mega Ball will net you $7, a 4 number draw without the matching Mega Ball will net $150, with pay dirt hitting at 4 number and matching the Mega Ball giving you $10,000, getting 5 without matching the Mega Ball will get you $250,000, and of course all 5 with the matching Mega Ball get you the jackpot (so long as you match the Mega Ball, it doesn’t matter how many of the numbers you hit, you win something). Anyhow, back to our wheel. You have 8 numbers you like to play, and you want a guarantee that you will have at least 4. Just playing those 8 numbers randomly will not guarantee you a winning wheel. You could play every combination of those 8, but that would mean playing 28 tickets, on a 6/49 lottery, that is where 6 numbers are drawn from a single set of 49 numbers, it gets longer on the Mega Millions which would basally be a 5/56 + 1/46 as the first 5 are drawn from one set while the Mega Ball is drawn from another set. Anyhow, a full wheel of 28 tickets is a bit much to spend, then again it guarantees you the jackpot as well. By playing an abbreviated wheel, you drop that to just 4 tickets and win if 5 of the numbers drawn match your 8. Playing those 8 randomly on 4 tickets doesn’t not guarantee a win, even if 5 of the numbers drawn match your 8 since you might have some left off, or in the wrong ticket and so on. And so my program evolved to cover wheels as well. Note of course, even the 28 ticket wheel I mentioned above doesn’t guarantee a win if none of those 8 numbers come up, so even a full wheel doesn’t guarantee a win overall, just a win if a certain number of your numbers come up.
Then I figured, there are probably already programs like that out there, and indeed there are.
Ranging in price from about $30 all the way up to $150. Of course if we go back to the prize levels on Mega Millions, you win back that $150 with just a single 4 number match. However, I have decided to go on with making my own program anyhow it will be a great and very educational experience. I’ll have to learn to parse text files or web pages made by the lottery providers to get the numbers drawn, I’ll finally have a program that needs a database made for it (I could just make my own text file and parse it each time, but a database would be far more efficient) and a host of other things that will be a good experience for me and my hopeful programing career. As a bonus, if I do well, it may become the first program I could sell. (Outside of the games I want to make, none of the other stuff on the development slate can be sold, except perhaps The Daily Word, which I wouldn’t sell, though the customization service that I plan on having with it would cost some.) I can tell this one is going to take awhile…
Meanwhile, I still am thinking of changing the name of my software company from Neutron Software to something else. Tokey’s Happy Critters is the leading choice, after one of the games I want to make, because Tokey himself makes such a great mascot. I also though about BAT Software seeing that my initials are BAT, which oddly enough isn’t used, Blind Bat, and Fruit Bat, but not just BAT Software. That could have a cool logo as well, and could initially be made myself to a degree, unlike Tokey which requires a graphics designer from the start. To truly make them work the way I want though, even the bat would need a computer animation person who could make the design for the bat character work the way I want… Of course that could be well down the line anyhow. I have also added a kids educational game to the planned development slate as well, and as funny and cute as Tokey may be, the Tokey game itself would not be intended for kids and wouldn’t want to encourage the kids to play Tokey. Besides, of the stuff on the planned development slate, Tokey is the least likely to ever see the light of day seeing how complex it would be to program and the amount of external help I would need in making it. So I guess that settles it, BAT Software it is.
| Print article | This entry was posted by Brian A. Thomas on 06 May 2007 at 8:28 am, and is filed under CSharp, Programming. Follow any responses to this post through RSS 2.0. You can leave a response or trackback from your own site. |





