KITCHENER -- An Ontario statistician says he has cracked the code to winning the virtual installment of Tim Hortons' Roll Up the Rim to Win contest.

Michael Wallace is an assistant professor at the University of Waterloo. When the coffee chain announced last month that it would be holding this year's contest online to help curb the spread of COVID-19, he began researching the new rules for an article he was working on.

It was during that research that he saw an opportunity to use the new rules to his advantage.

In the traditional contest where each cup has a prize printed on it, it didn't matter how many people bought cups, Wallace explains—players always had the same odds of winning.

With the digital rolling system, though, that wasn't the case. Instead of being available the moment you bought the cup, the digital prizes are only available the moment you play your roll.

"They pulled this off by distributing the prizes across the contest period into things called 'winning timeframes,'" Wallace explains.

"These were short intervals of time (0.1-1 second) during which a prize was available to be claimed. If you were the first player to tap the screen during that window, you won the prize. If no-one tapped the screen during the window, the prize went unclaimed."

He says when he read the rules of the game, he found that an unclaimed prize wouldn't be lost: it would be re-randomized for another time later in the game.

An unclaimed prize would get assigned a new winning timeframe until somebody won it.

In a statement, a spokesperson for Tim Hortons says they made that decision to give people more chances to win.

"Knowing the digital integration was a new portion of the contest, we assumed user adoption in the early days would be slower," the statement reads.

"Any prizes that were unclaimed each day rolled forward to the next, maximizing the amount of prizes available for our guests to win as the contest went on."

Finding how the numbers could work for him

"What I figured out was that this made a big difference to the game, because if fewer people played, if sales were low—and we had good reason to think that sales would be low this year—there would be a lot of these unclaimed prizes," Wallace explains.

He also thought that, because the prizes were assigned randomly, many of the prizes would be scheduled to be won in the middle of the night when fewer people would be trying to use their rolls.

The other factor that stood out to the statistician: the digital rolls could be played until two weeks after the contest had ended in stores.

"It would also mean about a third of the prizes would be randomized to the last two weeks of the contest. That seemed crucial to me," he says. That meant that a third of the prizes would be available in a timeframe when presumably fewer people would be playing.

He thought that if he saved all of his rolls for the last day of the contest, he would have the best chance at winning because of all of the prizes that would have carried over.

Wallace says he didn't know if that was how Tim Hortons had arranged their prize rules, but that appeared to be the most statistically "fair" way of distributing them.

It seems he was right.

Wallace says he spent about $50 to collect a total of 96 spins for this year's virtual edition of the contest. Though the advertised odds of winning a prize are 1-in-9 (about 11 per cent), he won on 94 spins. That's about a 98 per cent win rate.

Free Coffee notification on Tim Hortons app

As for his prizes: he won up to $500 worth of coffee and donuts, though he notes that you need to figure out how to order a coffee that costs $5.89 to claim the full amount.

"Prof. Wallace was able to strategically capitalize on prizes being rolled over," Tim Hortons confirms.

"We’re proud of him for reading all the contest rules and that math is alive and well in Canadian universities!"

Michael Wallace admits that his method isn't going to get you rich—it doesn't help decide which prize you're going to win, just that you'll win something—nor was he trying to take advantage of the system.

"That was exactly what I expected, because when you look at the prizes of these things, and I'm a statistician, I know how these numbers work, I knew that my chances of winning anything other than those things was going to be really, really small," he says.

"I was just happy that my theory worked."

Can you use this method to increase your odds?

This ended up working out for Wallace as he tried it on his own during a global pandemic. What if sales had been steady?

He has a theory that it would work, but probably not to the same extent.

While he believes that lower sales helped his theory succeed, he says there are other aspects to the game that may have still made it possible.

"There are aspects of the game where, unless they were very clever in exactly how they distributed those prizes, I think there would still be the chance for this kind of strategy to work," he says.

If thousands of people had tried this strategy, he says he wouldn't have been nearly as successful because only the first person to tap the prize in the prize window wins.

Wallace says he has been trying to get in touch with Tim Hortons to find out how he can donate his winnings to hospital staff in Montreal where he is on sabbatical.

"It will be up to the professor to donate his winnings, as they are in his account, however, we are working to match his winnings with donations of coffee and donuts on his behalf to the hospital of his choice," the Tim Hortons spokesperson says.

Wallace's final piece of advice to consumers is that of a true statistician.

"Do be skeptical, look into these rules and try and understand exactly how these games work before you play them."