Saturday, February 13, 2016

Good Poker Players Don't Drink Tim Hortons Coffee

If you are someone who:
  1. Purchases caffeinated beverages on a regular basis, and
  2. Gets inordinately excited about injecting gambling into your everyday life,
then you've just hit one of the most wonderful times of the year: Roll Up The Rim To Win season at Tim Hortons. Roll Up The Rim To Win (henceforth RRTW because I'm too lazy to capitalize that many words consecutively) is an annual contest lasting from early February through late March/early April. It gives Canadians (and some Americans) an opportunity to win prizes for doing exactly what they do the rest of the year: buying coffee. Cars, TVs and cold hard cash are this year's big ticket offerings to aid in swallowing the cold coffees and hard muffins purchased from your local Tim Hortons.
It's hard to overstate the relevance of RRTW and Tim Hortons in general to Canadian culture. Today, while reflecting on this, I cracked a joke on Facebook about how this promotion proves that I'd rather enjoy a chance at small stakes gambling than a chance at a good coffee. That got me to thinking: just what are the odds of winning on RRTW, and what do they mean to me as a degenerate gambler? I embarked on a mathematical quest to find the answer to that question, and I intend to share the journey with you, my dear reader.


Caffienating Kenny Rogers
To begin, I decided to look at a popular method of calculating expected return from a bet known as expected value (eV). The concept of eV is best known to poker players, although anybody who's fortunate/unfortunate enough to make a living gambling is intimately familiar with its concept and calculation. The numerical eV of a proposition is described by the following equation:
eV = Probability of winning * Return on a winning bet – Probability of losing * Cost of making the bet
Now, since I'm a STEMbro with a dust-collecting degree in math, I find that concept pretty elementary. However, since not everyone spent their fourth year of university constructing BIBDs and applying combinatorial models to mundane situations, I'll explain the above by way of an unrealistic but simple example. 
Suppose you have a rather dim friend. You offer this friend—let's call him something overtly Canadian, like Moose—a proposition gambling on a series of coin flips. Every time you win, he pays you $12. Every time he wins, you pay him $10.
You are not a very good friend.
More importantly, we can calculate your eV as follows:
Probability of winning = 1/2 = 0.5 (You may be ripping Moose off, but at least you're using a fair coin. You always have 1/2 chance to win a fair coin flip)
Return on a winning bet = $12
Probability of losing = 1/2 (That's the probability of losing the coin flip. Your probability of losing friends may be even greater, you manipulative fuck)
Cost of making the bet = $10
eV = Pwin * Rwin – Ploss * Closs
eV = 12 * 0.5 – 10 * 0.5
eV = +$1.00
In short, your expected value on this bet is a dollar per flip—if you flip 10 coins, you expect to win 5 bets and make a $10 profit, giving the stated average of $1 per flip. Of course, actual results might be as extreme as Moose winning $100 or you winning $120, but in the land of probabilities, it's all about what you can infer before the coin is flipped. Expected value is about what should happen, not what could happen. 

Note that, intuitively, Moose's eV for the game is opposite yours: -$1.00. You quickly find yourself unwelcome in Riverdale.



I Don't Want To Flip My Coins, I Want To Spend Them On Coffee!
Coming back to reality, let's set a baseline before we delve into the eV of RRTW. McDonald's runs a promotion year-round where they offer a free medium coffee after drinking 7 McDonald's coffees. While this isn't gambling, this promotion still has a calculable value. I'll cover some bases here where the numbers are simple (like Moose) rather than repeated divisions by hundreds of millions.
I want to know the value of McDonalds' coffee promotion. Well, after 7 coffees, my next one is free, so I'd be inclined to guess that the value of the promotion is 1/7 the price of a coffee. However, that free coffee also has a redeemable customer loyalty reward sticker. In other words, I always start with one sticker of the seven I need, and I'll only have to pay for six more coffees to get my second free coffee. This cycle repeats in perpetuity with the third free coffee, fourth free coffee, etc as long as I drink McDonald's coffee. Thus, the more coffee I drink, the more that the value of McDonald's customer loyalty program approaches 1/6 the price of a medium coffee ($1.82 tax in), or 30.333¢. This isn't an expected value because there are no probabilities, and we're not gambling. This 30ish cents is just straight up added value from that promotion.
Now, let's get back to Timmie's. They're kind enough (read: legally bound) to have a very long rules sheet explaining exactly the kinds of things we need to know for our calculations, namely, number of game cups, number of prizes and retail value of prizes. That can be found here. I'll snip the relevant information:
They're giving away 40 cars valued at $24990 each.
They're giving away 120 TVs valued at $5000 each.
They're giving away 25000 $100 gift cards. The value of those is left as an exercise for the reader.
They're giving away 100 $5000 CIBC cash cards.
Finally, they're giving away 45428910 prizes of food/drink. They even mention that the split is around 70% coffee and 30% donut, so we can quickly calculate that there are 31800237 coffees valued at $1.80 each (medium, tax in) and 13628673 donuts valued at $1.12 each (again, that's with Trudeau's rake included). Prices vary from province to province; I'm using my local costs for all calculations.
Meanwhile, I'm going to restate an assumption made in my preamble: you're buying coffee anyway. It costs you nothing extra to play roll up, so Closs = 0. Conveniently, when Closs = 0, it doesn't matter what your Ploss is, because it's multiplied out. I could explain and calculate it, but I don't need to for this exercise and I'm already tackling some hefty topics without delving into that. The point: if you were buying coffee anyway, RRTW represents only +eV for you. Same with McDonald's: if you're buying coffee anyway, you're getting something (a free coffee! eventually) for nothing. Added value.
Now we've got some grinding to do. Feel free to skip this if you're willing to take my word on the math.
eV = Pwin * Rwin – Ploss * Closs
eV = Pwin * Rwin
This isn't quite as simple as the coin-flipping scenario above. There are multiple prizes each with different chances to win and different values. Since I'm a mathist, you'll take my word that we take the sum of all Pwin * Rwin:
eV = [(40/272598720) * $24990] + [(120/272598720) * $5000] + [(25000/272598720) * $100] + [(100/272598720) * $5000] + [(13628673/272598720) * $1.12] + [(31800237/272598720) * $1.80]
eV = 0.367 + 0.220 + 0.183 + 0.917 + 5.599 + 20.998 

eV = +28.284¢
In other words, your average cup of coffee during RRTW adds an expected value of a whopping 28 cents and change. Any poker player who had as much spare time on her hands as I do would quickly conclude that, long term, she should drink McDonald's coffee because it adds a value that exceeds the expected value of Tims' coffee. An interesting finding, and bad news for any aspiring professional rim rollers.
It's worth pointing out that the bulk of the +eV in RRTW comes from the commonly found coffee/donut win. 40 cars is a lot of cars, but you could still buy 40 cars much cheaper than you could buy 31.8 million coffees or 13.6 million donuts. (At that point, I'd hope they'd give you a bulk discount, but I digress)


But I Want A Pint of Coffee!
This leads to the obvious criticism of these calculations: anyone who cared enough to consider and abide by the eV of their morning coffee gamble would likely try to maximize the values of their wins. My above calculations are assuming all wins are a donut and a medium coffee. What if someone wants a muffin ($1.46 total) and the biggest, most expensive drink allowed under the contest rules (a large chocolate mocha at $4.40)? Well, that's their John A. MacDonald given right, damn it! 

In fact, the benevolent lord of donuts set forth in the tablets of testimony that someone can have exactly that. The odds and prices of the other loot remains static, but if we adjust our calculations for a min/maxing gambler:
eV = Pwin * Rwin – Ploss * Closs
eV = Pwin * Rwin
eV = [(40/272598720) * $24990] + [(120/272598720) * $5000] + [(25000/272598720) * $100] + [(100/272598720) * $5000] + [(13628673/272598720) * $1.46] + [(31800237/272598720) * $4.40]
eV = 0.367 + 0.220 + 0.183 + 0.917 + 7.299 + 51.329
eV = +60.315¢
Which presents Tims' promotion as twice as worthwhile as McDonalds' promotion... until one then considers Mickey D's rules for customer rewards redemption. The most expensive drink available for free there is a medium cappucino or latte, coming in at a tidy $3.78 with tax. Multiplying this by 1/6 as earlier, the value of McDonalds' promotion rises to a more comparable 63¢... still beating the new mark set by the proprietors of RRTW. Long story short, an optimizer still couldn't make RRTW have a higher +eV than the value found at McDonald's, even if said optimizer was willing to contract chocolate-flavored diabetes in the name of expected value.
Interestingly, if you check Tims' estimation of the total prizes they'll be giving out, they assume the cheapest small drink and the cheapest baked good in their calculations, and while I'll spare you another number sprawl, that works out to an +eV of +23.236¢... so, in their own opinion, your +eV from participating in their promotion is beaten by almost 7¢ per coffee as compared to the inherent value in a McDonald's coffee.
Regardless of all this definition stretching, my original point stands. Practically, even if you're going out of your way to get more expensive drinks and foods for free when you do win, Tims' promotion isn't even as good as what the crowd across the road are running all year. (Pro tip: Neither is their coffee)
This statement finds its logical conclusion in this final point: we've been running under the assumption all this time that our gambler is buying coffee anyway. The frugal and astute gambler probably makes his coffee at home like a sensible goddamned human, and all of a sudden the values of each chain's coffee drop as follows:
McDonalds' value: 30.333¢ - $1.82 = -$1.51667 per coffee bought
Tims' value: 28.284¢ - $1.80 = -$1.51716 per coffee bought
Grinding your own beans: I don't know. I don't care. Much less than above numbers. Read CBC pontificate about that if you're not sick of price-of-coffee ramblings yet.


Con-brew-sion
Really, at the end of the day, this whole thing is an exercise in futility: the smartest person makes their coffee at home, saving their twonies for dice in an alley. Thing is, those of us who enjoy gambling couldn't care less about a couple cents here and a dollar there; that's a small price to pay for the rampant excitement of the next cup definitely hiding a car under the rim rather than another invitation politely asking us to play again. With that settled, that's all I have for today. Join me next time as I explain how much I love my freshly won 2016 Honda Civic. 

Note: This post originally stated McDonalds' most expensive medium hot beverage as a hot chocolate, but as my friend Amanda kindly pointed out on twitter, this isn't the case. Numbers have been reshuffled accordingly and now I'm even more right than before!