Stuart’s MATLAB Videos

Watch and Learn

Puzzler: Running it twice

As with many math geeks, I am fascinated with games of “probability theory and applied psychology” (also known as Poker!). At a recent game this debate came out: “Does running it twice change your expected value?” What does this question mean in plain English?

Let’s give an example: Two more cards will be dealt from the remaining 45. If either or both of them are one of the four remaining Kings, the underdog will win 100 dollars. So, to LOSE the hand he will have to NOT get a King (41/45) and then he will have to NOT get a King (40/44) on the second card too. Multiplying this out, 82.82% of the time he will lose, or 17.17% time he will win. This means that on average this hand is worth 17.17 dollars. Since we are going to only do this once, his variance from expectation will be quite large since his two possible outcomes are either $0 (82.82%) or 100 dollars(17.17%). However if he were in this same exact situation twice for half the amount of winnings for each time, his outcomes will be either 0 (68.59%), 50 (28.44%) or 100 (2.94%). The more times it is dealt out, the lower the variance. There is no question that if the deck were shuffled between the two trials, the math above holds. However, if two cards are dealt and NOT replaced then two more cards are dealt from the remaining 43 does the above math hold?

I was distracted at the table for the rest of the night puzzling this out. It turns out that “running it twice” does not change the average return, though it changes the variance. My buddy Jesse was kind enough to write some MATLAB code to ‘prove’ this. I did the same, only in a a Monte Carlo simulation way. Rather than work out the closed form solution, I figure just run through half a million iterations and see!

It always amazes me the many different ways that people use MATLAB to ‘prove’ their point on simple problems like this. Just like the Frisbee flipping puzzler, send your most interesting case, made in MATLAB and I will send out a MATLAB t-shirt to the most interesting entry.

Image by dupo-x-y on CC

  • print
  • send email


To leave a comment, please click here to sign in to your MathWorks Account or create a new one.