Login
📚 Statistical Inference for Everyone
Chapters ▾

4.2 The High/Low Deck Game

In this example we use a simple card game as a platform for discussing model comparison in general. We start with two atypical decks of cards called the High Deck and the Low Deck (Figures 4.1 on page 96 and 4.2 on page 96 respectively). The game goes as follows.

The 55-card High Deck laid out in ten columns of clubs: one Ace, two 2s, three 3s, four 4s, five 5s, six 6s, seven 7s, eight 8s, nine 9s and ten 10s — the higher the value, the more copies it has.
Figure 4.1. High Deck - 55 Cards with ten 10's, nine 9's, etc... down to one Ace. Aces are equivalent to the value 1.
The 55-card Low Deck laid out in ten columns of clubs: ten Aces, nine 2s, eight 3s, seven 4s, six 5s, five 6s, four 7s, three 8s, two 9s and one 10 — the lower the value, the more copies it has.
Figure 4.2. Low Deck - 55 Cards with ten Aces, nine 2's, etc... up to one 10. Aces are equivalent to the value 1.

What does our intuition say?

We start by exploring our intuitions, before we do anything mathematically. Thus, we are in a position to check to see if the math is reasonable before we use the same math in areas where our intuition is not as strong. Imagine we draw only one card, and it is a 9. Intuition suggests that this constitutes reasonably strong evidence toward the belief that we're holding the High Deck. If we then (as the procedure states) place the 9 back in the deck, reshuffle and then draw a 7 we can be more strongly convinced that we are holding the High Deck. Repeating the reshuffle, and then drawing a 3 would make us a little less confident in this conclusion, but still quite certain. In this way we can sense how drawing different cards pushes our belief around, depending on how often that card comes up in the different decks.

Before the data - the prior

Before we take any data, we need to quantify our state of knowledge concerning all of the models that we are considering. In this case it is quite simple, because there are two models (High Deck and Low Deck), and we have been given no information about whether either is more common. With no such information, it is equivalent to a coin flip - we assign equal probabilities to both models before we see data, also known as the prior probabilities.

P ( H ) = 0.5 P ( L ) = 0.5

Surely this assessment will change after we see data, but that is the rest of the problem.

The “easy” question - the likelihood

Although our ultimate goal is to infer the type of deck from the cards that we draw from it, we can start looking at an easier part of this question which serves as a first step toward the more challenging, and interesting goal. That question is the following,

Applying the Bayes' recipe

Here we introduce for the first time a recipe we will follow for all model comparison examples.

Now that we have our intuition, and we have the likelihoods, we can address the math. The two models are:

H ``We're holding the High Deck'' L ``We're holding the Low Deck''

and the initial data is

d a t a ``We've drawn one card, and it is a 9''

According to Equation 4.1 on page 95 we are looking for the two probabilities:

P ( H | d a t a = 9 ) P ( L | d a t a = 9 )

which are related to the prior and the likelihood via Bayes' Rule (Equation 1.14):

P ( H | d a t a = 9 ) = P ( d a t a = 9 | H ) P ( H ) P ( d a t a = 9 ) P ( L | d a t a = 9 ) = P ( d a t a = 9 | L ) P ( L ) P ( d a t a = 9 )

To calculate actual numbers, we apply the Bayes' Recipe to this problem,

  1. Specify the prior probabilities for the models being considered

    P(H)=0.5P(L)=0.5

  2. Write the top of Bayes' Rule for all models being considered

    P(H|data=9)P(data=9|H)P(H)P(L|data=9)P(data=9|L)P(L)

    where we are using the symbol to denote proportionality or related to. Essentially, by calculating the top of Bayes' Rule first, the numbers are not equal to the final (i.e. posterior) probabilities but must be rescaled to make sure that they add up to 1. This is done in the final step. Up until that rescaling, we use the symbol and think of it as related to.

  3. Put in the likelihood and prior values

    P(H|data=9)955×0.5=0.082P(L|data=9)255×0.5=0.018

  4. Add these values for all models

    K=0.082+0.018=0.1

  5. Divide each of the values by this sum, K, to get the final probabilities

    P(H|data)=0.082/0.1=0.82P(L|data)=0.018/0.1=0.18

From which we can conclude that drawing a 9 does indeed constitute reasonably strong evidence toward the belief that we're holding the High Deck - the probability of us holding the High Deck, given the data, is 0.82.

Drawing the next card

So, when we draw a 7 next (after reshuffling), our intuition suggests that we'd be more confident that we're holding the High Deck. Repeating our recipe we have

The two models are:

H ``We're holding the High Deck'' L ``We're holding the Low Deck''

and data is

d a t a { ``We've drawn one card, and it is a 9, replaced and reshuffled, and then drawn a 7''

According to Equation 4.1 we are looking for the two probabilities:

P ( H | d a t a = 9  then a  7 ) P ( L | d a t a = 9  then a 7 )

which are related to the prior and the likelihood via Bayes' Rule (Equation 1.14):

P ( H | d a t a = 9  then a  7 ) = P ( d a t a = 9  then a  7 | H ) P ( H ) P ( d a t a = 9  then a  7 ) P ( L | d a t a = 9  then a  7 ) = P ( d a t a = 9  then a  7 | L ) P ( L ) P ( d a t a = 9  then a  7 )

To calculate actual numbers, we apply the Bayes' recipe to this problem,

  1. Specify the prior probabilities for the models being considered

    P(H)=0.5P(L)=0.5

  2. Write the top of Bayes' Rule for all models being considered

    P(H|data=9 then a 7)P(data=9 then a 7|H)P(H)P(L|data=9 then a 7)P(data=9 then a 7|L)P(L)

  3. Put in the likelihood and prior values

    P(H|data=9 then a 7)955×755×0.5=0.0104P(L|data=9 then a 7)255×455×0.5=0.0013

  4. Add these values for all models

    K=0.0104+0.0013=0.0117

  5. Divide each of the values by this sum, K, to get the final probabilities

    P(H|data=9 then a 7)=0.0104/0.0117=0.889P(L|data=9 then a 7)=0.0013/0.0117=0.111

which again matches our intuition - we're more confident that we're holding the High Deck, now with probability 0.889 increased from 0.82 when we just observed the 9.

Prior information or not?

In the above example, we started with a prior probability of holding the High Deck at P(H)=0.5, because we had no information other than that there were two possibilities. We then observed a 9, and updated the probability to 0.82, and then observed a 7, and further updated the probability to 0.889 - making it more likely that we were holding the High Deck. One of the basic tenets of probability theory is that if there is more than one way to arrive at an answer, one should arrive at the same answer. In the above, we calculated the probability of holding the High Deck given the observed data

d a t a { ``We've drawn one card, and it is a 9, replaced and reshuffled, and then drawn a 7''

and prior information

p r i o r ``We know there are only two decks.''

An equivalent situation is found after our first draw, after we've observed the 9, and we're about to draw our second card. In this case we have the prior information:

p r i o r { ``We know there are only two decks, and then we draw one card and it is a 9, replace it and reshuffle.''

and observed data:

d a t a ``We've drawn one card and it is a 7''

Mathematically, we apply the Bayes' recipe, but with the different prior information

  1. Specify the prior probabilities for the models being considered

    P(H,9)=0.82P(L,9)=0.18

  2. Write the top of Bayes' Rule for all models being considered

    P(H|data=9 then a 7)P(data=7|H)P(H,9)P(L|data=9 then a 7)P(data=7|L)P(L,9)

  3. Put in the likelihood and prior values

    P(H|data=9 then a 7)755×0.82=0.104P(L|data=9 then a 7)455×0.18=0.013

  4. Add these values for all models

    K=0.104+0.013=0.117

  5. Divide each of the values by this sum, K, to get the final probabilities

    P(H|data=9 then a 7)=0.104/0.117=0.889P(L|data=9 then a 7)=0.013/0.117=0.111

yielding the same result.

In other words our updated probabilities from the first draw can be seen as our prior probabilities for the subsequent draws. Thus, Bayes' Rule describes how we update our knowledge with new evidence, or in other words, learning.

Adapted from Statistical Inference for Everyone, by Brian Blais (Bryant University), licensed under CC BY-SA 4.0 (dual-licensed under the GNU FDL 1.2 or later; this adaptation uses the CC BY-SA grant). Changes were made; this adaptation is distributed under the same license. License: CC-BY-SA-4.0.