Here’s a trick question for those who find the Monty Hall Problem too easy.

Suppose you have two five-card poker hands dealt from separate decks. You are told that the first hand contains at least one ace, and that the second hand contains the ace of spades. Which hand is more likely to contain at least one more ace?

(Problem courtesy of the Quantum Pontiff, with the solution found here.)

People’s guesses over at the Quantum Pontiff site typically were that the probabilities would be the same, or that the first hand would be more likely to contain one more ace. Typical reasoning is something like this:

In the first hand, we’re told that it contains an ace, but not which one. So it could be the ace of spades: the answer for the first hand includes the answer for the second, so must be bigger.

Intuitively obvious, but incorrect.

One commentator makes an excellent point:

Here’s my general rule that I also try to get my students to use (especially the pre-med folks I teach in my intro. class).

Rule #1 (I have others): Don’t overthink the problem!! Note this is really just a variation on K.I.S.S. (keep it simple, stupid)
[…]
Before asking the question, I try to get my students to learn Rule #2: Make sure you ask the right question.

Ask the right question, and you find that the actual answer is the opposite of intuition: the second hand is more likely to contain another ace.

Unintuitive, but if you do the maths, it is absolutely correct. I’m not going to reproduce the maths here — follow the links for it. And remember: this is why ordinary blokes will never beat the casino in the long term: they hire mathematicians to work this stuff out, we try to guess.

If you’re still not convinced, I created a little quick-and-dirty simulation in Python. Here are the results:
Total of 10000 trials.
Number of trials where an ace was drawn: 3412
Given there is an ace in the hand, what is the probability of another ace? 0.124853458382
Given there is the Ace of Spades in the hand, what is the probability of another ace? 0.228758169935

Sure enough, the second hand is more likely to contain another ace.

(Note that the probabilities found in that run of the program are not the same as the exact probabilities. The program calculates the probability based on a random sample, not an exact value based on every possible result.)

For those interested in this sort of thing, after the cut I have included the source code of the program so you can play with it yourself.

Python code:

from __future__ import division

import randomtrials_with_ace = 0

count_with_ace = 0

trials_with_ace_spades = 0

count_with_ace_spades = 0

suits = "HDSC"  # Hearts Diamonds Spades Clubs

values = "A234567890JQK"  # Ace, 2-10, Jack, Queen King

aces = ["A"+s for s in suits]

assert len(aces) == 4

cards = [v+s for v in values for s in suits]

assert len(cards) == 4*13

def draw_hand():

    deck = cards[:]

    random.shuffle(deck)

    return deck[0:5]

def count_aces(hand):

    """Returns the number of aces in a hand."""

    n = 0

    for card in aces:

        if card in hand: n += 1

    return n

N = 10000

for i in xrange(N):

    hand = draw_hand()

    # Does the hand have *any* Ace?

    n = count_aces(hand)

    if n > 0:

        trials_with_ace += 1

        if n > 1:

            count_with_ace += 1

        if "AS" in hand:

            trials_with_ace_spades += 1

            if n > 1:

                count_with_ace_spades += 1

print "Total of %d trials." % N

print "Number of trials where an ace was drawn: %d" % trials_with_ace

print "Given there is an ace in the hand, what is the probability of another ace?", \

    count_with_ace/trials_with_ace

print "Given there is the Ace of Spades in the hand, what is the probability of another ace?", \

    count_with_ace_spades/trials_with_ace_spades
Advertisements