Friday, July 10, 2009

Two Coins Revisited


Last time we looked at the classic two coins problem, which (as a reminder) goes like this:

The host flips two coins. If both are heads, he flips again; if at least one is tails, he announces this fact. The contestant has to guess whether the other coin is heads or tails.


Without getting into the details, the contestant has a 2/3 chance of guessing correctly if he picks heads. The probability argument is simple, but nobody believes it anyways, so I won't repeat it here.


Clearly this is exploitable, since we can offer just above 50/50 odds to our mark as long as we can get them to play the host.


What I'm thinking about now: is it possible to very slightly alter the game so that we could let the mark play the contestant, at the same odds, and still make money? In other words, what is the minimal modification that actually turns this into a 50/50 game?


My proposal is that instead of canceling the game and re-flipping if we hit two heads, the host now gets to pick whether he tells the contestant about a head, or a tail, and we play each round.


Huh? WTF am I on, right? Isn't the game completely symmetrical, and we're just flipping it around so that we don't have to discard any tosses?


Au contraire. Let's enumerate the possibilities, assuming that if HT or TH comes up my choice of which to announce is completely random:


  • (25%) HH - announce heads
  • (12.5%) TH - announce heads
  • (12.5%) TH - announce tails
  • (12.5%) HT - announce heads
  • (12.5%) HT - announce tails
  • (25%) TT - announce tails


No big surprises there.


But let's start our arithmetic. Suppose I've announced heads. Out of a total 50% probability for that case, 25% comes from HH, 12.5% comes from TH, and 12.5% comes from HT. In other words, given that I've announced heads, there's exactly a 50/50 shot that the other coin is heads!


So what happened to the 2/3 from the correct answer to the previous problem? It's gone, plain and simple, and we're back to a fair even gamble again. You can figure out where it went by looking at that table above: now instead of being forced to announce heads in both the TH and HT case, we can split our call 50/50, and the bias is gone.


If you ever try this in real life, the way to do it is to first take the mark's money for a while as the contestant, and then when they're starting to get the sense that they've been had, suggest that you for expediency's sake you just start playing every flip, and that they can choose whether to call heads or tails when they flip. Only let this go for a round or two, though, because you're now playing a slightly losing bet. Soon thereafter, suggest that maybe they'd have better luck on the other side of the table, and let them play the contestant. Pull it off right, and they'll never even suspect that you slipped in a rule change that tilted the game in your favor; as long as you then proceed to play longer as the host under the new rules than you did as the contestant, the ruse has decidedly positive expected value, and the additional bonus that you leave the mark feeling as if they had a fair shot the whole time.


I'd wager some pretty good bank that you could even sucker quite a few people that understand the original problem into this version...

Taking People's Money


By now pretty much everybody has heard of the Monty Hall Problem, even if they generally don't know the right answer. It has a long history of pissing people off, and ranks right up there with the airplane on a treadmill as being one of the most hotly contested thought experiments ever.


My current concern is using this problem (and people's insistence on misunderstanding the answer) in order to trick people out of their money, because that's just how I roll.


First, just in case you're not familiar with the details, we'll re-cast the problem as something you can screw people over with in real life, where you hopefully would have some trouble coming up with a goat on short notice:


  1. Obtain a napkin, two pennies, and a quarter.
  2. Tear the napkin up into three pieces.
  3. The "host" places each of the coins under a separate napkin, making sure that the "contestant" cannot see where each one is.
  4. The contestant picks a napkin, aiming for the quarter.
  5. The host uncovers one of the pennies, without telling the contestant whether he's picked correctly or not.
  6. The contestant has a final opportunity to switch his choice.


The problem is, it's a little difficult to exploit the game as it stands. People intuitively think that the contestant has a 1/3 chance of winning, whether or not they switch sides. They assume that they would be completely indifferent to switching, and if you offered them what they would perceive as "fair" 1/3 odds, you'd lose money in the long run because they will occasionally switch. If you offer something closer to the true fair odds (1/2), they're not going to play because they see it as extremely weighted in your favor.


So let's switch things up. Allow the mark to play the host. Now we can take the role of the contestant, and assuming our mark is a good target, they will feel like they are getting a "good deal" when you offer to put up $5 for every $6 that they throw into the pot. After all, they should win "2/3" of the time, right?


And now you're +10% expected value each time you play the game. Only real problem now is finding someone sober enough to sit down and listen to the rules of the game and think about it enough to "realize" that 5:6 are odds that they should take.


Perhaps even simpler is the two coins game. Here's the way this one works:


  1. Host flips two coins, hides the results from the contestant.
  2. If both coins are heads, host shows the coins (so contestant knows the host isn't lying) and starts over.
  3. If at least one is tails, the host announces this fact.
  4. Contestant guesses what the other coin is.
  5. Contestant wins if his guess is correct.


Now, the scam here is that most people think "fair" odds for this game are 50/50. Obviously, right?


Well, that's wrong. In reality there's a 2/3 shot that the other coin will be heads. See Jeff Atwood's blog for a lot of discussion. Many people won't believe this even after it's been explained to them.


The nice thing about this version of the problem is that people have a real affinity for 50/50. Flip a coin? Even bet, obviously. A lot simpler than having to think about an ostensible 2/3 bet and decide whether 6:5 odds is giving them value or not.


With this one, we again want to take the contestant side. We can play the host as well, but it's harder to explain and sell the extra conditions we need to add to make this a +EV play (these changes will (correctly, for once!) make the mark think the game is tilted against them), so it's simpler to stick with playing the contestant. It also puts the coins in the mark's hands (let them use their own!), so they feel more comfortable that they're not being swindled.


Offer them odds slightly better than 50/50, but don't go further than 2:1, that's your break even point. $6 of yours to every $5 of theirs should do the trick, though $11 to $10 is even better, if you can sell it. You always go for heads, and you're set.


A tip: try to specify the number of rounds you're going to play beforehand. A lot of marks will stop once they've lost a little bit, and this option has value. That won't hurt you in the long run, so you won't end up in the red if you don't do this (the ability to stop playing is more like a stop loss order in the stock market; it is only worth anything in this case because the game has -EV for the mark), but if you can lock someone in to 10 rounds, go for it!


A bit of advice: people that feel confident about probability estimates can often make great marks here, because once they've arrived at the wrong answer they are absolutely certain that it is correct. Think poker players, mathematicians, etc. - overall they tend to be only slightly better than average at figuring out the right answer, but they end up far more committed to their answers, so they'll really dig in and chalk the losses up to "variance."


And that's what we refer to as "getting our lulz."

Tuesday, April 21, 2009

Logarithm, The Bastard Monomial

I haven't done a mathnerd post yet. I think it's about time, but alas, I lack the time to write a fresh one right now; this is migrated from my now defunct math blog, and should prove beyond a shadow of a doubt that I'm a total weenie. This series will move into some fun stuff soon (if you're a loser like me), so stay tuned...

So you think you understand elementary calculus, eh? Good for you, but let's go slow at first, just to be sure. We're going to start at the beginning: finding the integral of a power of x.



Or as an indefinite integral



Of course, this is not the case for n=-1; indeed, if n=-1 then the denominator becomes zero. The indefinite integral in that case is



Something seems fishy here, though. After all, the difference between and is just about nil for a specific value of x; can it really be the case that the antiderivative is so different that we actually need a different functional form?

No! Miraculous as it may seem, the natural log function is, to some extent, the magical in-between value between the powers of x that blow up at x=0 and remain zero there. Huh? Let's look further...

If we didn't happen to know that the antiderivative of 1/x is the ln function, we might inquire as to what happens in the limit as n -> -1 in the expression for the antiderivative of a power of x. An excellent question is, from which side? Well, we should look at both, as a rule. From above, we get, for small epsilon approaching zero



whereas from below we get



Just for fun, let's look at the value x = e. Using the Taylor series for e^x = 1 + x + x^2/2! + ... we see that the first expression becomes



Interesting - in the limit as epsilon approaches zero, the 1/epsilon will diverge to infinity, and the rest approaches 1 (each term except epsilon/epsilon goes to zero). Perhaps we can absorb that 1/epsilon into the constant of integration and declare that this is equal to 1? [In which case we have verified, at least for this particular case, that this limit appears to match what we'd expect of the ln function]

This seems a shady - it smacks of the renormalization tricks that physicists love to play, haphazardly discarding infinities whenever they are inconvenient. In this case, it's not nearly as sinister as it looks; I'm just saving a bit of time by working with the indefinite integral instead of the definite one, where that infinity would never crop up in the first place - I encourage you to try it yourself.

And we have a bonus: as it turns out, both the "from above" and "from below" expressions turn out to be equal in the limit, as long as we remove those infinite terms in the appropriate way (or work with the definite integrals instead).

Without further ado, the punchline: a few lines of algebra will quite easily confirm that the limit expression



serves quite nicely as a definition of the natural logarithm function, at least over the positive real numbers; when we move to the complex plane, things become a little trickier because one must specify quite precisely what is meant by that limit and by the raising of x to that power (recall that complex roots may be multivalued).

So to make a long story short, the logarithm function is not a special case at all, nor do we have to resort to its status as the inverse of the exponential function to define it naturally. It's simply what we get if we look at a series of monomials normalized so that their derivatives are pure monomials (w/o constant factors) and push through zero. Modulo normalization and a shift, the logarithm is "merely" a non-constant power of x with zero exponent, which is pretty cool.

In fact, recalling that the inverse of the x^n function is x^(1/n), we see that the exponential function is, in a sense, a power of x with infinite exponent (again modulo normalization and a shift). From the expression for the ln function shown above, you can even derive the usual limit expression (the product one) for the exponential function (exercise!).

Next time: we're going to start with the first of many "proofs" that 0 = infinity, 0 = 1, and 0 = just about anything you want it to equal. Amusingly enough, a couple of these "proofs" are arguably correct and even (gasp!) useful, as long as you know what you're talking about when you write down the symbols!