A deck of cards naturally has the structure of a product set and thus can be modeled mathematically by

$$D=\{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, j, q, k\}\times \{, , , \}$$where the first coordinate represents the denomination or kind (ace, two through 10, jack, queen, king) and where the second coordinate represents the suit (clubs, diamond, hearts, spades). Sometimes we represent a card as a *string* rather than an ordered pair (for example
$(q)$).

There are many different poker games, but we will be interested in standard draw poker, which consists of dealing 5 cards at random from the deck $D$. The $\mathrm{order}$ of the cards does not matter in draw poker, so we will record the outcome of our random experiment as the random set (hand)

$$X=\{X_{1}, X_{2}, X_{3}, X_{4}, X_{5}\}$$where $X_{i}=\left(\begin{array}{c}Y_{i}\\ Z_{i}\end{array}\right)\in D$ for each $i$ and $X_{i}\neq X_{j}$ for $i\neq j$. Thus, the sample space consists of all possible poker hands:

$$S=\{\{x_{1}, x_{2}, x_{3}, x_{4}, x_{5}\}\colon \forall i\colon x_{i}\in D\land \forall i\neq j\colon x_{i}\neq x_{j}\}$$Our basic modeling assumption (and the meaning of the term *at random*) is that all poker hands are equally likely. Thus, the random variable
$X$ is uniformly distributed over the set of possible poker hands
$S$.

In statistical terms, a poker hand is a random sample of size 5 drawn without replacement and without regard to order from the population $D$. For more on this topic, see the chapter on Finite Sampling Models.

There are nine different types of poker hands in terms of value. We will use the numbers 0 to 8 to denote the value of the hand, where 0 is the type of least value (actually no value) and 8 the type of most value. Thus, the hand value $V$ is a random variable taking values 0 through 8, and is defined as follows:

- No Value. The hand is of none of the other types.
- One Pair. The hand has 2 cards of one kind, and one card each of three other kinds.
- Two Pair. The hand has 2 cards of one kind, 2 cards of another kind, and one card of a third kind.
- Three of a Kind. The hand has 3 cards of one kind and one card in each of two other kinds.
- Straight. The kinds of cards in the hand form a consecutive sequence but the cards are not all in the same suit. An ace can be considered the smallest denomination or the largest denomination.
- Flush. The cards are all in the same suit, but the kinds of the cards do not form a consecutive sequence..
- Full House. The hand has 3 cards of one kind and 2 cards of another kind.
- Four of a Kind. The hand has 4 cards of one kind, and 1 card of another kind.
- Straight Flush. The cards are all in the same suit and the kinds form a consecutive sequence.

Run the poker experiment 10 times in single-step mode. For each outcome, note that the value of the random variable corresponds to the type of hand, as given above.

Computing the probability density function of $V$ is a good exercise in combinatorial probability. In the following exercises, you will need to use the two fundamental rules of combinatorics to count the number of poker hands of a given type: the multiplication rule and the addition rule. You will also need to remember some basic combinatorial structures, particularly combinations. We give some hints on constructing an algorithm for generating the poker hands of the given type.

Show that the number of different poker hands is

$$|S|=(52, 5)=2598960$$Show that $(V=1)=1098240/2598960\approx 0.422569$.

- Select a kind of card.
- Select 2 cards of the kind in part (a).
- Select 3 kinds of cards, different than the kind in (a).
- Select a card of each of the kinds in part (c).

Show that $(V=2)=123552/2598960\approx 0.047539$.

- Select two kinds of cards.
- Select two cards of each of the kinds in (a).
- Select a kind of card different from the kinds in (a).
- Select a card of the kind in (c).

Show that $(V=3)=54912/2598960\approx 0.021129$.

- Select a kind of card.
- Select 3 cards of the kind in (a).
- Select 2 kinds of cards, different than the kind in (a).
- Select one card of each of the kinds in (c).

Show that $(V=8)=40/2598960\approx 0.000015$.

- Select the kind of the lowest card in the sequence.
- Select a suit.

Show that $(V=4)=10200/2598960\approx 0.003925$.

- Select the kind of the lowest card in the sequence.
- Select a card of each kind in the sequence.
- After counting the hands generated by steps (a) and (b), subtract the number of straight flushes in Exercise 6.

Show that $(V=5)=5108/2598960\approx 0.001965$.

- Select a suit.
- Select 5 cards of the suit in (a).
- After counting the hands generated by steps (a) and (b), subtract the number of straight flushes in Exercise 6.

Show that $(V=6)=3744/2598960\approx 0.001441$.

- Select a kind of card.
- Select 3 cards of the kind in (a).
- Select another kind of card.
- Select 2 cards of the kind in (c).

Show that $(V=7)=624/2598960\approx 0.000240$.

- Select a kind of card.
- Select 4 cards of the kind in (a).
- Select another kind of card.
- Select a card of the kind in (c).

Show that $(V=0)=1302540/2598960\approx 0.501177$.

- The hand has no value if and only if it is none of the other types.
- Use the addition rule.

Note that the density function of
$V$ is decreasing; the more valuable the type of hand, the less likely the type of hand is to occur. Note also that *no value* and *one pair* account for more than 92% of all poker hands.

In the poker experiment, note the shape of the density graph. Note that some of the probabilities are so small that they are essentially invisible in the graph. Now run the poker hand 1000 times, updating every 10 runs. Note the apparent convergence of the relative frequency function to the density function.

In the poker experiment, set the update frequency to 100 and set the stop criterion to the value of $V$ given below. Note the number of poker hands required.

- $V=3$
- $V=4$
- $V=5$
- $V=6$
- $V=7$
- $V=8$

In the movie The Parent Trap (1998), both twins get straight flushes on the same poker deal. Find the probability of this event.

Classify
$V$ in terms of level of measurement: *nominal*, *ordinal*, *interval*, or *ratio*. Is the expected value of
$V$ meaningful?

A hand with a pair of aces and a pair of eights (and a fifth card of a different type) is called a dead man's hand. The name is in honor of Wild Bill Hickok, who held such a hand at the time of his murder in 1876. Find the probability of getting a dead man's hand.

In draw poker, each player is dealt a poker hand and there is an initial round of betting. Typically, each player then gets to discard up to 3 cards and is dealt that number of cards from the remaining deck.

Suppose that Fred's hand is $\{(4), (5), (7), (q), (1)\}$ Fred discards the $(q)$ and $(1)$ and draws two new cards, hoping to complete the straight. Note that Fred must get a 6 and either a 3 or an 8. Since he is missing a middle denomination (6), Fred is drawing to an inside straight. Find the probability that Fred is successful.

Suppose that Wilma's hand is $\{(4), (5), (6), (q), (1)\}$ Wilma discards $(q)$ and $(1)$ and draws two new cards, hoping to complete the straight. Note that Wilma must get a 2 and a 3, or a 7 and an 8, or a 3 and a 7. Find the probability that Wilma is successful. Clearly, Wilma has a better chance than Fred.