Wednesday, February 20, 2013

Hortons Hazards

Each year around this time, Tim Hortons simplifies life for those who are enthusiasts of both coffee and gambling with their Roll Up the Rim to Win contest.  The premise of the contest is more or less evident from its title.  Each cup of size small or larger has a message printed under the rim of the cup.  When you're done your coffee (or tea or hot chocolate), you roll up the rim at a certain section, helpfully indicated by an arrow, to reveal the message.  Tim's either politely asks you to continue buying their products play again or delights you by giving you something for free, such as another coffee (or tea or hot chocolate) which you could probably have made two of for significantly less than the price of what you paid for the single cup [1]. This year, the chance of being delighted is 1 in 6.  Thus, the chance of a polite request is 5 in 6.

Each year around this time, there are also people who feel like the game is rigged, because they rolled up the rim 6 times but had yet to win.  One such person complained to me last year.  I nodded and agreed, though I thought to myself that his experience was not enough to prove conspiracy.

I had a worse losing run a few years back.  That year, the probability of winning was 1 in 9.  Over the course of about 2 weeks, I had bought something like 15 cups without winning once.  It seemed improbable.  Frustrated, I sent an email complaining to a friend who, though not a mathematician, is better versed in the probabilistic arts than I am.  In his reply, he stated that there was a 17% chance of run of losses that long.

I had been beaten by the odds, sure, but that probability was a lot higher than I was expecting.  Certainly it wasn't enough to prove that anything was amiss.  If just half of the country had bought as many cups of coffee as I had, I'd still be in the company of more than 2,500,000 people, enough to replace the population of the city of Toronto with perpetual losers [2].  Thus, although the sequence of events was quite a bit less probable than it was probable, it wasn't extremely unlikely.  It certainly wasn't unlikely enough to prove the prizes are distributed unfairly. And sure enough, a couple of cups of coffee later after, I won two in a row, resulting in a win-to-cup ratio that was pretty close to 1 to 9, the stated chance of winning.

Sometime after I got home, I decided to investigate the matter more in depth.  Since the probability of winning is 1 in 6, I decided look at the possible outcomes of buying 6 cups of coffee from Tim Hortons during their Roll Up the Rim promotion.  There are 7 possible outcomes, from winning 0 times to winning all 6 times (disregarding the order in which the prizes was won).  The calculations are pretty simple, but the explanation takes a bit more time, so I'll leave it out for now.  Here are the different possible outcomes, along with their probabilities.

  • 0 times: 33.49%
  • 1 time: 40.19%
  • 2 times: 20.09%
  • 3 times: 5.358%
  • 4 times: 0.8037%
  • 5 times: 0.0643%
  • 6 times: 0.002143%
Here are the probabilities from the olden days, when the chances of winning were 1 in 9.
  • 0 times: 34.64%
  • 1 time: 38.97%
  • 2 times: 19.49%
  • 3 times: 5.68%
  • 4 times: 1.06%
  • 5 times: 0.1332%
  • 6 times: 0.01110%
  • 7 times: 0.0005947%
  • 8 times: 0.00001858%
  • 9 times: 0.0000002581%
Remarkably, in the olden days, the probability of winning nothing wasn't much lower than the probability of winning exactly once.  If half the country bought 9 cups of coffee that year, there would have been been enough people who didn't win a thing to replace the population of the whole Greater Toronto Area. It's also close to twice the probability of winning exactly twice.  Even under the current rules, with a higher chance of winning, you're still quite a bit more likely to get nothing at all than win twice.  I suspect there are far fewer people who win something twice in short succession and feel like Tim Hortons is conspiring to favour them (or their local location, their city, their province, etc.).  In fact, I suspect the number of people who would feel that way is approximately zero.


This might seem surprising, as it was at first to me, because I only looked at my record and never thought to consider how unexpected my record was.  A few few moments of reflection, though, reveals that it shouldn't be surprisng.  The chance of winning something is only 1 in 6 anyway, which means that after 6 tries, you should only expect to win once.  Indeed, the most likely event is, unsurprisingly, exactly one win.  Winning 0 times is only one win different from one win.  So is winning twice, but since losing is 5 times more probable than winning, it's reasonable to expect that winning once less than expected is more likely than winning once more than expected.


Another question that might come up is, "How many cups of coffees should a person expect to buy before their first win?"  Again, I'll leave out the explanation for now, but the answer turns out to be exactly 6.  In the olden days it was 9.  In fact, if one out of every n cups is a winner, then it will take n cups on average before you win.  So if you don't win once in 6 tries, you're not that special.  It's not even enough to show that you're much different from the average.

Unfortunately, these arguments alone are not enough to prove decisively that there is no conspiracy.  It's only enough to prove that you don't have enough evidence to prove that there is a conspiracy.  For that, you'd need to collect a random sample of your rim-rolling compatriots who bought exactly 6 cups of coffee.  If the percentages of people who won 0 times, 1 time, 2 times, etc. are significantly different from those given above, then you might have a case.  If the percentages are similar, you should probably give up on your conspiracy theory and satisfy yourself with consuming the exact quantity of Tim Horton's product that you paid for [3].


----------------

Explanations

How do we calculate the percentages given above?

Consider the rules for the current year.  The probabilities of winning or losing are 1/6 and 5/6 respectively.  Assuming the winning and losing cups are distributed evenly, whether or not you win from one cup has no bearing on whether or not you win from the next one.  The two events, winning from the first and winning from the second, are said to be independent.  The probabilities of losing on the first and second cup are 5/6 in both cases, and since the events are independent, the probability of losing two in a row is 5/69 x 5/6.  The probability of losing three times in a row is 5/6 x 5/6 x 5/6, and so forth.  Thus the probability of losing 6 times straight is 5/6 multiplied by itself 6 times, or 5/6 to the power of 6, which is the number given above for the probability of 0 wins, expressed as a percentage and rounded to two decimal places

The probability of winning exactly once is 5/6 to the power of 5 (for the eight losses) times 1/6 (for the one win).  But there are 6 different ways that the one win could have happened: on the first cup, on the second cup, etc.  So we multiply this probability by 6 to get the probability given above for 1 win.

The probability of winning twice is 5/6 to the power of 4 (for the four losses) times 1/6 to the power of 2 (for the two wins).  There are 15 different ways that the two wins could have happened: on the first and second cup, on the first and third, ...,  on the second and third, on the second and fourth, ..., etc.  So we multiply this probability by 15 to get the probability given above for 2 wins.

The remaining probabilities under both the old rules and new rules are obtained similarly.  For the interested reader, and the already initiated, the probabilities follow a binomial distribution.

How do we calculate the average number of tries needed for a win?

There is a mathematical way to calculate this exactly, but an intuitive justification will suffice.  On average, one will win 1 prize for every 6 cups.  This means that in the long run, there is an average gap of 6 cups between wins.  But since whether or not you win on the next cup does not depend on whether or not you won on the last cup nor even whether you bought a cup at all, the gap between wins is the same as the gap between the last cup and the next win.  In particular, the gap between having bought zero cups and the first win is 6.

[1] In fact, you could probably spring for the expensive beans for your home brew and still come out ahead financially, while enjoying a better cup of coffee.


[2] Which currently only occupy the arena at the Air Canada Centre.

[3] I should point out that the big prizes are not distributed evenly.  Any Tim's customer living outside of Ontario has a better chance of winning a Rav4 than an Ontarian does.  Even though Tim Hortons is open about this, and claims that the smaller prizes, such as coffee and doughnuts, are distributed evenly, I suspect that some would see their favouritism for the big prizes and conclude, despite the chain's claims, that it extends to all prizes.

Tuesday, February 05, 2013

The Phase Out and the Stunned

Now that it's penny is being phased out, I offer the following get rich quick scheme. Every time you go shopping, bring a calculator (or use the one in your phone). Before you check out, calculate how much the total purchase will cost. Determine whether the price will be rounded up or down with chart below from the Canadian Mint. If it will be rounded up, pay with your credit card to avoid paying the extra 1 or 2 cents. If it will be rounded down, use cash to save 1 or 2 cents. At the end of the year, go out and buy yourself a coffee, a doughnut, and maybe, if you're some kind of shopaholic, a Timbit, with all the money you saved.