MATLAB Lottery number generator

33 views (last 30 days)
Jimmy Joseph
Jimmy Joseph on 29 May 2014
Answered: Image Analyst on 31 May 2014
Hello guys,
So I'm looking to build a lottery number generator script. Sounds simple but I want it to do some other things before the number is shown as the answer.
I will use a database of past winning numbers which, in which the the generated number will not resemble. Also takes into account of time eg - Last weeks lottery number is highly unlikely, but the lottery numbers from 2007 might be more plausible.
Also never generate specific numbers such as consecutive numbers, and other numbers with a pattern.
Also takes into account of the frequency of how numbers come up, more likely numbers come up more often, thus higher probability.
Is this easily to implement, would like to see if it works remotely well. Makes lottery a bit more fun.
  4 Comments
Image Analyst
Image Analyst on 31 May 2014
OK fine. So just program up your Monte Carlo experiment and prove it one way or the other.
John D'Errico
John D'Errico on 31 May 2014
Edited: John D'Errico on 31 May 2014
NO. NO. NO.
There is NO reason that last week's numbers will not reappear today, and with equal probability over any other set of numbers. You are simply FLAT OUT WRONG there. If you think there is a difference, you need to go back to basic probability theory. Do not pass go, do not collect $200. In fact, skip over Chance too, if you don't understand probability.
Too often people look at random sets of numbers and believe they see a pattern. The fact is, that pattern is made up by their own mind. As a human or not, there is NO educated guess. But my guess is that you won't believe me.
So return to probability 101. Do not pass go...

Sign in to comment.

Answers (1)

Image Analyst
Image Analyst on 31 May 2014
John's always telling people to play around, dabble in, and try new things in MATLAB so I'm sure he'd agree that you should go ahead and program it up. Everyone knows that you learn more by doing rather than listening or watching. It will be a good learning experience for you in both probablity and in concepts of Monte Carlo simulation and programming. Feel free to report your code and learnings back here.
For fun, I've attached a Monte Carlo simulation of the Monty Hall problem that I wrote. Maybe it will give you some ideas or guidance.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!