How Random are Scratch-Off Lotto Tickets?

I'm not a lottery player -- I don't like throwing my money down a statistical hole in the ground -- but I'll admit that on occasion I have been the recipient of a scratch-off lottery ticket, and I have scratched it, and haven't won anything. What a bummer. But I recall one occasion as a kid when a friend of mine received 20 scratch-off tickets ($1 each) as a birthday present. He "won" $15 and was very excited about the affair. Two things about this bothered me: first, that his total birthday gift was actually less money than had been spent to give it to him; and second, that he actually sat there, scratching away and trying to figure out whether each card was a winner. "Why not just hand the tickets back to the cashier and have 'em scanned, to see if they're winners?" I asked. "Because it's fun!" he answered -- and this, apparently, is the answer to both of my objections. There are people (apparently many people) for whom the scratching off, and the thrill of winning little monetary rewards, is really enjoyable. So my friend was actually pleased that he got both his $15, as well as the exciting experience of scratching off 20 cards. I still don't get it, though I see it every day. (See the HBO documentary Lucky for a good overall look at lottery systems, winners, and losers.)

Yesterday, Jonah Lehrer posted a fascinated Wired story called Cracking the Scratch Lottery Code in which an MIT-trained statistician finds mathematical flaws in a particular scratch-off card in the Ontario Lottery, allowing him to predict winning cards about 90% of the time. Here's a snippet:

[After winning $3 on a scratch-off ticket, Mohan Srivastava] decided to take a lunchtime walk to the gas station to cash in his ticket. "On my way, I start looking at the tic-tac-toe game, and I begin to wonder how they make these things," Srivastava says. "The tickets are clearly mass-produced, which means there must be some computer program that lays down the numbers. Of course, it would be really nice if the computer could just spit out random digits. But that's not possible, since the lottery corporation needs to control the number of winning tickets. The game can't be truly random. Instead, it has to generate the illusion of randomness while actually being carefully determined." ... That afternoon, he went back to work. The thrill of winning had worn off; he forgot about his lunchtime adventure. But then, as he walked by the gas station later that evening, something strange happened. "I swear I'm not the kind of guy who hears voices," Srivastava says. "But that night, as I passed the station, I heard a little voice coming from the back of my head. I'll never forget what it said: 'If you do it that way, if you use that algorithm, there will be a flaw. The game will be flawed. You will be able to crack the ticket. You will be able to plunder the lottery.'"

What happens next is actually very surprising.

(Photo courtesy of Chris Winters, who writes: "Breakdown was: $58 in cash (left), 15 free tickets (center, not yet redeemed), the remainder losers (right)." Photo used under Creative Commons license.)