Is the apparent randomness of the scratch ticket just a facade, a mathematical lie?

The call came around 3 a.m. Toronto time, which was midnight in Nevada where Doug Hartzell was sleeping. It was his old friend, Mohan Srivastava, phoning from Canada.

"He called me and said, 'Man, I think I'm losing it. But I see a pattern in scratch lottery tickets,' " said Hartzell, recalling that 2003 conversation.

"My reaction almost instantly was like: I'm sure he's right."

Over their three decades of friendship, Hartzell has come to accept that Srivastava is simply smarter than most people. So when the 52-year-old geological statistician told him he could identify a winning scratch lottery ticket — without the use of pennies or fingernails — Hartzell believed him.

"There's been so many things he's done that after the fact, people go, 'Oh yeah, why didn't I see that?' " Hartzell said. "But Mo has one of those rare minds."

Most people see a random jumble of numbers when they look at a scratch lottery ticket like Ontario's "Tic Tac Toe" game. But for Srivastava, he saw that certain numbers appeared only once in the grids — and when these "singletons" lined up three in a row, chances were the ticket was a winner.

He calculated this held true 95 per cent of the time and notified the Ontario Lottery and Gaming Corp. Within days, they pulled the game — the first time in OLG history a recall was prompted by a customer-identified flaw.

At the time, Srivastava's discovery went largely unnoticed but today, the reserved but genial scientist is enjoying a brief moment in the spotlight after appearing in this month's issue ofWired magazine. In the article, Srivastava discusses what he considers flaws in the lottery industry and, at the magazine's request, conducts another test of his code-busting logic. He chose 20 tickets currently on sale in Ontario, predicting six would be winners. Four of them had payouts.

The odds of this happening are about one in 50, Srivastava told the Star, which is "pretty unusual."

"I think there is still a problem," he said.

As Srivastava's name now makes the rounds in the blogosphere, he is being touted as the statistician who outsmarted the government, the game and the multi-billion dollar lottery industry.

Srivastava insists others could have arrived at the same discovery he did, and chances are others have. But for Hartzell, his friend is the one who pulled it off — and tried to fix the problem to boot.

"Theoretically, someone else could have figured it out but the short answer is, Mo's the one that did," Hartzell said. "He's a numbers theory guy, he likes puzzles . . . (and) when he stumbles across these things, he can't put it down."

The son of a Scottish homemaker and an electrical engineer from India, Srivastava admits he was a nerd growing up. As a high school student in Elmira, Srivastava spent many a lunch hour upside down in his locker, stuffed there by the bigger boys.

"I was a geek," he says cheerfully.

After receiving degrees from MIT and Stanford University, Srivastava began a career as a geostatistical consultant, helping international mining companies determine where to point their drills.

His job entails using data to extrapolate how much wealth might be buried underground. For Srivastava, the skills he uses for work are the same ones he applied to cracking the Tic Tac Toe game.

But it was also "a happy coalescence" of other experiences that helped Srivastava arrive at his lottery epiphany. First of all, there was the computer class he took in high school; one of his assignments was to write a computer program for none other than tic tac toe.

Curious by nature, Srivastava also had a natural interest in cryptology, one further reinforced by his friendship with mathematician William Tutte, a British codebreaker who cracked a high-level Nazi code during World War II.

"I had a way of thinking about (the lottery ticket) like a message," he explained. "And whether it's a winner or not — that was the message."

All these factors came into play in June 2003, when Srivastava scratched his first lottery ticket, given to him as a gag gift.

He won $3. After a momentary wave of "child-like joy" subsided, the gears in his brain began to click.

"I started wondering how they're produced," he said. "By the time I got to the Petro-Canada (to redeem the prize), I knew how I would write the computer program."

Srivastava thought this was the end to his ponderings. But later, walking past the same Petro-Canada, he heard a voice in his head: "But if you do it that way, if you program it that way, there will be a flaw in the game," he said. "After that, I knew the trick."

Srivastava bought a few more tickets and saw that the computer program behind these Tic Tac Toe games also produced the same flaw. He bought 25 more tickets over the next few days, all from different stores, to reassure his inner statistician that this was more than just a fluke. It was.

Naturally, Srivastava spent some time at this point determining how he could profit from his newfound insight. A quick calculation showed this would be more hassle than it was worth.

"I realized this wasn't going to be a big payout," he said. "Once I realized that this wasn't a pot of gold at the end of the rainbow, I was like, 'Who do I report this too?' "

Srivastava eventually connected with the OLG but they kept brushing off his concerns. So he decided he would show them the problem in a "live test."

Srivastava bought 20 tickets and tied them, unscratched, into two bundles — the winners and losers. Just in case the rubber bands broke and the tickets got mixed up, he wrote a cover letter listing the serial numbers of each ticket and what his prediction was for it.

He couriered the package to the OLG. At this point, he finally felt free of the obsession that had gripped his imagination for days.

"I remember dropping them off and actually feeling that sense of this whole thing bleeding away," he laughed. "I was like, let it go. This is about as crazy as it gets."

But two hours later, he got a phone call. It was a member of the OLG's security team.

"The first thing he says is, 'We need to talk,' " Srivastava recalled.

Within days, the OLG pulled the game from their 10,000 retailers. Srivastava spent the next few months testing other lottery tickets from around North America, inputting data into spreadsheets and trying to determine how systemic the problem was. In 2007, he notified the OLG of a second scratch ticket that was possibly flawed, the popular Super Bingo game. The ticket was recalled as a "precautionary measure" and an independent audit was unable to prove it could be broken, said OLG spokesman Tony Bitonti.

In the end, he said, none of the lottery corporations or ticket printers were interested in fixing the problem he identified. The issue was brushed off as a "fluke" and one American ticket printer even threatened him with litigation, he said.

Today, Srivastava says it's quite likely flawed tickets are still on store shelves. He sees potential for greater consequences —evidence suggests flawed lottery tickets are being exploited for money laundering — and is confused by the lack of will to remedy a problem he helped identify.

"If there are some people that are skimming winners, or more able to skim winners, what that means for everyone else is they're getting more losers," he said. "There's kind of a cruel unfairness for the people left over who weren't in on the trick."

(Click to display full-size in gallery) Mohan Srivastava, a geological statistician living in Toronto, realized that the logic he used to find gold deposits could also crack lottery cards.

(Click to display in gallery) Step 1: Look over the card. You’ll be hunting for so-called singletons — numbers on the visible tic-tac-toe grid that appear only once on the whole card.

(Click to display in gallery) Step 2: Make a plot of the card, marking each cell with a number that indicates how many times the numeral in the cell occurs on the whole card. If, for example, a cell has a 26 in it and the number 26 occurs one other time somewhere on the card, mark that cell with a 2.

(Click to display in gallery) Step 3: All the singletons will now be marked with a 1. If any of the singletons appear in a tic-tac-toe then the ticket is almost certainly a winner: The numbers in these cells will appear under the latex coating at the left side of the ticket. Keep the ticket.