FAQ 
Calendar 


#1




Lottery and Ping Pong Balls  Truly Random?
Most, if not all, state lotteries use those ping pong ball machines for their televised drawings.
Just what degree of randomness can be acheived with these? I mean, the balls go into the bin in the same order every time, bounce around for a few seconds, and then the selections are made. It seems like an insufficient amount of time to really mix things up. Clearly, a properly constructed computer program could generate truly random numbers faster and better, and this is what is used when you do a "Quick Pick" at the lottery dealer. But my theory has always been that using a computer to do the actual drawing, while probably statistically more random and therefore fairer, would never be accepted by the average lottery purchaser, who would be suspicious of a process that cannot be seen (i.e., the balls are visible  the electrons are not). 
#2




Yes, I'm certain it's long enough to mix things up. If the rate of appearance in successive lotteries of each number, over a statistically representative period of time, appears to be random, then it surely is.
Incidentally, the British Premium Bonds, which are a lottery in all but name, have been selected by a computer random number generation for decades, without any quibbles that I'm aware of. 
#3




Quote:
example rn link  there's plenty of others (just google "computer generated random numbers") i don't know the details of lottery drawings, but bouncing ping pong balls seems like a good tactic to get randomness. it's the same idea as a roulette table. 
#4




The OP raises a very good point with regard to the randomness of ping pong balls; with all the factors affecting each ball (e.g. collisions with each other and with the sides of the container) how do we know that it is random at all? I tried bringing up this point in a GD thread about consciousness (trying to argue free will) but it never got answered.
In theory, if the balls were always initially laid out in exactly the same arrangement and spun at exactly the same rate for exactly the same amount of time, the results should come out the same every time. 


#5




Ping Pong balls have been tampered with, using whiteout/glue type materials injected into some of the balls. I believe PA had the most notorious case. But that involves cheating. If there is no cheating, i.e., the balls are carefully measured to make sure there is no sig. difference in weight, balls are randomly selected from different groups, etc., then no worries.
"Anyone who considers arithmetical methods* of producing random digits is, of course, in a state of sin." John von Neumann (1951). *That is, "computational methods" in today's terms. But there are very good sources of random noise that have been used to produce random bits as addon devices in computers. Extremely useful for generating random cryptographic keys. But since software can always be easily fiddled with, I wouldn't trust a lottery that used a computer. 
#6




Quote:

#7




Quote:
In reality, the balls are never laid out in exactly the same arrangement and are never spun at exactly the same rate for exactly the same amount of time. And not only that, but the environment in which the events occur are never exactly the same each time. The things you mention  "all the factors affecting each ball"  don't prevent randomness, they cause it. Just the sheer overwhelming number of changes that occur from every tiny little thing that happens, from the amount of humidity in the air to the tiny indentations to the cage that result from thousands of collisions, ensure that a statistical randomness ensues. We don't live in a clockwork universe, even in theory. Quantum mechanics takes care of that on the small scale and time takes care of that on the large scale. 
#8




Quote:
Vegas slot machines often use a computer to generate a random (or rather, psuedorandom) number. The wheels going around are all for show. Once you pull the lever your fate is sealed. The ROM chips in these computers are regulated to prevent cheating, and quite a bit of effort goes into the regulation. Someone has to pour through all of the code and make sure that the machine really does generate a random number. It's much easier to regulate ping pong balls than computer ROM chips. It is possible to generate random numbers electronically, just not with your typical desktop PC. What you need is a circuit called a "noise generator" and you connect this to the input of an A/D converter. A PC has no hardware of this sort, and therefore can't generate true random numbers. This type of number generation is very rare in computers, but is done on occasion. 
#9




FWIW, a popular fuel for noise generators is radioactive decay. Point your geiger counter at a chunk of uranium (or whatever) and count the time between decay events.



#10




I think Intel was going to build random number generators into its chipsets that used "thermal noise from a resistor". I don't know if anything ever came of it though.... the documentation on Intel's site appears to be somewhat outofdate.

#11




it sounds like the lotteries aren't just relying on the balls bouncing in an airstream. they also use different draw machines and different sets of balls, which themselves are selected randomly.
http://www.calottery.com/games/faq.asp#q6 http://www.megamillions.com/aboutus/game_security.asp 
#12




And they're not pingpong balls.
They're well matched hard rubber balls that cost about $100 apiece IIRC. 
#13




Quote:

#14




Note that it is possible to generate cryptographicstrength randomness with a standard PC, using a much stronger variant of GorillaMan's keypresses. Rather than use one interval as the random element, the idea is to generate a running average of the typical interval between events (keypresses, mouse movements, et cetera), calculate the difference between that and each new interval, and then take only a few of the least significant bits from that to add to your randomness pool. A similar technique used for network servers is to replace the interface input with highprecision timing info from the receipt of network packets, which will not be predictable from the remote network. Although these are generated numbers, if it's done right there's no predictable state that you can extract from a record of the randomness output by such an arrangement.



#15




Quote:

#16




Maybe someone can comment on something I heard once. That is, that a system with 3 or more degrees of freedom is essentially random. The lottery vacuum ball machine certainly has more than that. For instance, I had this thing called the "dancing man;" it was a stick figure with a weighted head and weighted arms and legs that could spin. If you spun the guy he'd do this really cool "dance" with the weights reinforcing or antagonizing each other at various times and was supposed to be an example of how three degrees of freedom (2 arms and a leg/hip) is enough to create randomness. Of course, the amount of force you apply in the spin is a variable as well. Anyone want to back this up or call bs?

#17




Quote:
Note that there are many levels of "quasirandom" depending on the application. Using low order bits of clocks and keyboard/mouse motion are good enough for very low level purposes such as initing PC games. But they are lousy for anything that requires real security. E.g., cryptography and lotteries. 
#18




[QUOTE=ftg]This is a major difference between "hard to predict" and "random". Systems with a several objects with several methods of motion are merely "hard to predict". Note: not "impossible to predict". Ping Pong ball lotteries work because the difficulty of prediction exceeds anyone's computational capabilities in the time required. (But Roulette wheels are a bit too close to feasible now.)]
To the contrary, this "dancing man" gets right to the heart of why a lottery is secure: chaos. In fact, the dancing man is more complicated than it really needs to be. A double pendulum is already plenty chaotic and sensitively dependant on initial conditions. In one sense, the motion of the balls in the lottery is entirely deterministic (ignore QM for the moment) and thus merely hard to predict. In another sense, you can only know the initial conditions just so accurately and within that little blob of error lie configurations with wildly different longterm behaviors, becoming effectively random as far as any observer can tell. 
#19




Quote:



#20




Quote:

#21




ERNIE, the machine used to select the UK premium bonds winning numbers, uses radioactive decay, I think, for the random factor.

#22




This is getting into the realm of metaphysics rather than physics, but my understanding is that Mathochist is physically incorrect.
There is no way  even in principle  to precisely predict the outcome of a chaotic situation, i.e. one in which small changes in the original parameters lead to large changes in the results. And the lottery example is a chaotic situation to an even greater extent than his pendulum example. No measurement can be made to sufficient precision to run a deterministic model of the events. And I don't see how QM can possibly be ignored. The precision needed to forecast the outcome would necessarily be such that QM uncertainty would confound the numbers. I can't see how what Mathochist is saying is different from: if you take out everything that makes it indeterminable, it becomes determinable. Can you try your explanation again? 
#23




Quote:
Let's say for the moment that classical mechanics is correct: Newton's deterministic models and all. If one could know the exact position and momentum of every particle in the lottery box (or the doublependulum), one could exactly predict the future behavior. The fact is, though, that one cannot get this precise information. How bad is this? Consider two pendula with slightly different starting conditions. Maybe both are started by dropping the bob from slightly different angles. For most choices of initial position and momentum for one pendulum, there is some (possibly very small) collection of "nearby" initial conditions whose future behavior stays close. That is, even if you don't know exactly the initial conditions, your close measurement will stay close enough as time goes by. Let's go back to the double pendulum: now the situation is radically different. Given any initial condition A and any "distance" (in an appropriate sense), there is another initial condition B within that distance that behaves radically differently. Thus if you took a measurement with a margin of error greater than the distance between A and B you wouldn't be able to tell which state the system started in, nor to predict how it would behave in the long run. This is the point that keeps getting lost in discussions of chaos: the systems themselves don't have to be that complicated or random. In principle, the lottery box is a perfectly wellbehaved deterministic system which has sensitive dependance on initial conditions. To a perfect observer it's merely computationally difficult (but in principle possible) to predict the future behavior from the inital conditions. To us imperfect observers it's impossible to predict because any error in measurement leads to huge differences in future behavior. 
#24




To carry further what ftg said: There's a big difference between being truly random, and being unpredictable. If you took any set of lotto balls, and ran them through the machine a zillion times, it's quite possible that a meaningful pattern would emerge. Minute differences in ball size, shape, weight, and surface roughness could bias the results in very subtle ways.
But what is important in Lotto is that the outcome is unpredictable, even if the ball set will not produce truly random results. To this end, the balls are only used once (or maybe a handful of times) before being retired. They are also carefully inspected after each drawing to make sure that they are within accepted tolerances for shape, size, etc. There are numerous sets of balls, and they are picked randomly. Therefore, the public never gets to see the ball set used enough time to draw any statistical conclusions of bias. In slot machines, roulette wheels, another mechanical devices that need to produce random results, a number of techniques are used. The first is to use a highquality RNG with a period large enough that it is almost impossible to statistically determine patterns that can be exploited. The second is to (sometimes) introduce a truly random seed through some physical process  the time delay between pulls of a handle, noise on the AC line that powers the machine, etc. A couple of fun stories about screwups in generating random numbers: The first involves an online poker site called "Planet Poker". Early versions of the software for that site used a stock random number generator from, I believe, Borland's C compiler. This particular RNG only had a period of 2^32, or about 4 billion. But the developers also initialized it with a call to Randomize(), which uses the number of milliseconds from midnight. That means there were only about 86 million possible decks (when the real number of possible decks is 52!, or about 2^226). 86 million possible decks is not that many. So some enterprising cheats wrote a program to pregenerate all 86 million possible decks and store them in a database (actually, due to some other flaws in the way the deck was shuffled, the true number of possibilities was only a few hundred thousand). Then, as the game starts and cards are shown, the program can start filtering out decks that don't match the pattern of cards seen. After seeing about five cards (the cheater's own two plus the three on the flop), the cheat program can almost always narrow the possible decks down to one, at which point it know which cards everyone else holds, and which cards will come up on the turn and river. Profit$$. Another interesting flaw occured at a Canadian casino. The casino owners purchased an electronic keno game from a reputable American supplier of such games to the casino industry. Unfortunately, this particular machine reset its seed every time it was powered up. This was never an issue in American casinos which are open 24 hours a day. But in Canada, the casinos at the time closed every night. So each day, the machine was powered on again, and started with the same seed. An enterprising math student who happened to be there at opening time happened to notice that the first game of the day always had the same result. He bet on it and won a fortune. Then he got greedy, and did it again. The odds on the same guy winning a keno jackpot were so astronomical that the game was shut down and an investigation ensued. The player was eventually charged with cheating and was told to give all the money back  however, he won in court. The court ruled that he had done nothing wrong. He had simply observed the game, and bet based on his observations. No manipulation or trickery was involved, and it was the casino's job to make sure their games were fair. Needless to say, the game was taken offline until the problem could be fixed. 


#25




Quote:
I suspect that most big lotteries employ statisticians to run tests on the winning numbers to make sure that they are random. Quote:
Although I remember my Statistics in Manufacturing professor in college pointing out that the United States' draft lottery during the Vietnam era has been subjected to statistical analysis and has been determined to have been biased. Apparently the balls or chips or whatever they used were not sufficiently mixed. 
#26




Quote:
If you drew the lotto by having some jumbotron spin the numbers up around animated rockets or something equally spectacular, I'll bet the public wouldn't care one bit that it was computer generated. 
#27




Quote:
But the uncertainty principle killed it absolutely dead 75 years ago. I'm still unclear why you would bring it up. There are no perfect observers and there can be even in theory no perfect observers. In practice, the computional impossibility is enough to provide statistical randomness without calculating QM effects. Your initial conditions are always and forever unknown to a sufficiently precise degree, so even a single outcome cannot in practice be calculable, let alone a succession of them. The underlying QM nature of the universe compounds this and makes the impossible more impossible. 
#28




Quote:
Quote:

#29




Quote:
Note that having a phase space dimension of three or greater doesn't guarantee chaos, though; you also need some nonlinearity in the system, and even then it's not certain. 


#30




Quote:
Anyhow, it's a great example of a perfectly simple classical mechanical system that still is completely unpredictable for certain parameter values. 
#31




Another reason they still use pingpong balls is because it's more fun than using computergenerated numbers. It's just a little more entertaining to see the balls bounce around, giving you short glimpses of "your" number, before the final number pops up into a hole. Nobody'd be amused by a camera zooming in to a computer screen as a hand reaches to the keyboard and presses "enter".
And, part of the draw for the lottery is entertainment. That's why most of the games, particularly the scratchoff games, have wild and wacky names and themes. They could just as easily print gray tickets that say "Win" or "Lose" on it. But, that wouldn't be as much fun. 
#32




lottery pingpong balls
I once made $800.00/mo. for 3 months using the nonrandomness o f a fantasy 5
daily lottery. I won't mention the state. Nothing is truly random. The balls aren't exactly the same precise weight, numbers with 2 numerals may have more ink weight than others and be heavier. Or, if the numbering is done with a laser, some numerals may be burned a little deeper than others and be lighter. Anyway, a sure way to tell is to take a page out of any college undergrad's statistics book and do a histogram on the winning numbers of about 200 drawings. In this particular lottery 4 numbers occurred 3 times as often as the others, 4 other numbers occurred 2 times as often, and 3 or 4 occurred half as mych as the norm. This went on for a while before it was fixed. Either somebody connected with the lottery was playing games with the balls, or just possibly sloppy management. Anyway , it got fixed and there went my easy money! 
#33




Just for the record:
Quote:

#34




Quote:



#35




Undead nature of the thread aside, some very simple googling will reveal measures that various lotteries use to guarantee randomness, including changing out the balls themselves and using different machines. For example, here's a page showing previous results from the Texas Lotto, which includes a code designating which particular machine and which set of balls was used for each drawing. There are also a set of pretests to ensure the balls are good and actually randomized.
As for the other point, with as few samples as 200 drawings, some numbers will naturally crop up more often than others. If there are 49 numbers, that's only an average of 4 appearances per number. It would not be surprising at all to see some numbers show up 3 or 4 times as often as others. For example, if a number only showed up twice (half the average) and another showed up 8 times (twice average), you already have the situation that one number shows up 4 times as often as the other. If, after 200 drawings, each number showed up pretty close to the average number of times, I would actually suspect a cheat. It's statistically unlikely. That would not be the case after 2000 drawings, though, when you get enough of a law of large numbers effect to really push things to the average. Winning $800 a month for 3 months? Also not surprising it happens to somebody through sheer luck. Confirmation bias is a dangerous bias. Think about flipping a coin 200 times. There are a couple things I can almost guarantee (vernacular "guarantee" rather than mathematical "guarantee"). 1) You will NEVER see exactly 100 heads and 100 tails. That is, some numbers showing more or less often than average is perfectly reasonable and to be expected. And, in fact, with fewer drawings, more variation from the average is to be expected. For example, with 8 flips, seeing 6 heads/ 2 tails (i.e. 3 to 1 ratio) is not very surprising. But with 80 flips, seeing 60 heads/20 tails is surprising. 2) You will see a run of at least 6 in a row (either heads or tails) at some point in those 200 flips*. That is short term variation in long term behavior that seems nonrandom is actually a pretty good indicator of randomness. If you don't see such behavior (i.e. you see, at most 2 or 3 heads/tails in a row), it's almost sure to be a cheat. *Aside: this is a good example of Benford's Law and a pretty neat way of physically demonstrating the seemingly paradoxical behavior of truly random events. Here's a recounting of that trick used to demonstrate that point to some college students. The same principle can be used to judge whether polling results have been faked, as Nate Silver has often demonstrated at 538. 
#36




Threads coming back to life is a random event.
Assuming,let's say, we are flipping a coin and in each iteration, there truly is a 5050 chance of heads or tails... Mathematically, there are 2^100 possible outcomes (2^10 ~ 10^3, so about 10^30). Only one of these is all heads, and only one of these is all tails. the odds of 50 heads and 50 tails is, if we don't care about order, 100!/(50! 50!) The odds of 49 heads 51 tails (or vice versa) is 100!/(49! 51!) The ratio of these is : (49! 51!) / (50! 50!) = 51/50  not too bad. But if we get to, say odds of 4654 tosses vs. 5050 : (46! 54!) / (50! 50!) which gives: (51x52x53x54)/(47x48x49x50) = 1.373, or about 7:5 the odds of 4555 (versus the odds of 5050) are about 1.64 the odds of 4456 are about 2:1 you cans see it falls off quickly away from the mean. (Assuming I'm right. Math was never my strong suit, and combinatorics was especially confusing). And so on... Last edited by md2000; 02292012 at 10:20 AM. 
#37




Your analysis is pretty much spot on.
Of course, with a coin flip, 50 heads/50 tails is still the most likely outcome. But getting EXACTLY the average of 50/50 is more rare. The probability is, as you noted, C(100,50)/2^100 = 7.96%. For 10 flips, getting exactly 5 heads is 24.6% In the example I gave (200 flips), getting EXACTLY 100/100 has a probability of 5.6%. That's not really impossible or even all that unlikely (about 1 in 15 or so) but it's not very likely either. On the other than, getting in a certain range (say 4060 heads) is very likely. This is leading to a law of large numbers discussion. If you have 10 flips, the probability of getting 46 heads (i.e. 4060% heads) is 65.6%. If you have 100 flips, the probability of getting 4060 heads (i.e. still 4060% heads) is even higher at 96.5%). So, with increasing flips, the probability of getting EXACTLY the average outcome (i.e. half heads and half tails) actually gets smaller. But the probability you fall within a small range about the mean (say between 45 and 55% heads) gets larger with more flips. But also notice that in that run of 200 flips, you are also still virtually guaranteed to see a run of 6 in a row. It seems paradoxical, but that's the math. Where does the law of large numbers come into play? Well, let's say you flip a coin 1000 times and it comes up heads 600 times. Now, let's say you flip the coin 999,000 more times (to give us a round million) but these flips comes up 10000 more heads than tails. For the 1000 flips, we have 200 more heads than tails (600 vs 400) and a heads/tails ratio of 60/40. For the 1 million flips, have 10,600 more heads than tails (505,300 vs 494700) and a heads/tails ratio of 50.53/49.47. So, even though there is now an even wider variation between the number of heads to tails, by percentage, things are much closer to the expected 50/50. That's basically the gist of the law of large numbers. The same is true for the lottery ball distribution. With only 3 months of drawings, it's not hugely surprising to see individual balls occasionally fall outside an expected distribution, even though the overall behavior remains consistent. But with several thousand more drawings, even if ball outcome variations increase, I would expected the overall percentage to come closer to the expected range. There are a ton of people who claim to have secret "systems" which use those discrepancies in actual versus expected behavior to "predict" that some balls will show up in the near future with higher probability. They're pretty much grifters taking advantage of the fact that most people don't understand the law of large numbers. The 3 month "artifact" mentioned above certainly has the feel of this. 
#38




The reality is that if there WAS a pattern to ball selection, someone would have already found it and would use it to get rich. Has this ever happened?

#39




Quote:
And there's always the very basic argument against why anybody would choose to come forward if they did find such a method  if they get rich based on some clever trick, they'd be a fool to announce the method and should do everything possible to avoid being caught. It would be better if they posed as just another lucky random winner. I doubt such a method exists, but the absence of evidence is not the same as the evidence of absence. Last edited by Great Antibob; 02292012 at 11:48 AM. 


#40




Quote:
Once the problem is fixed, there's no need to keep quiet any more. Heck, they could get a good book deal. More profit! 
Reply 
Thread Tools  
Display Modes  

