# Probability of selecting 4 cards that add up to 5 from a deck of 40 cards

Let's say we have a deck of cards excluding face cards, so cards from Ace to 10.

Which of these is the correct way of computing the probability that the sum of 4 randomly chosen cards is equal to 5?

Method #1:

$$P(X=5)=\frac{8}{40}\cdot\frac{7}{39}\cdot\frac{6}{38}\cdot\frac{4}{37}$$

My logic is that for the first card, there are 8 possibilities. 4 Aces and 4 Two's. For the second card, if the first card was an Ace, there are, 7 possibilities. 3 Aces and 4 Two's. If the second card was an Ace, the third card can be chosen from 2 Aces and 4 Two's. Finally, if the third card was an Ace, the fourth card has to be a Two, so its sample space is just 4 Two's.

Method #2:

$$P(X=5) = \frac{8}{40}\cdot\frac{4}{39}\cdot\frac{3}{38}\cdot\frac{2}{37}$$

Like Method #1, the first card can be chosen from 4 Aces and 4 Two's. This time however, we will assume that the first card turned out to be a Two. By definition, all the remaining cards have to be Aces.

Method #3:

$$P(X=5)=\frac{4}{40}\cdot\frac{4}{39}\cdot\frac{3}{38}\cdot\frac{2}{37}$$

We know that in order to have a sum of 5, we specifically need 1 Two card and 3 Ace cards. The first fraction represents the probability of choosing a Two, and the rest pertain to Aces.

I think Method #3 is the most plausible of them all, but I still feel that they're all wrong and that I should just use the hypergeometric formula to find out the probability.

• How many 4-subsets of the deck contain exactly three aces and one two? (Easy method: count the number of ways in which one of the four aces can be replaced by one of the four twos.) Divide by the total number of 4-subsets.
– whuber
Commented Jun 2 at 17:05

Quick solution (based on combinations). There are four ways to exclude one Ace from the hand and, independently of those, four ways to include a Two, giving $$4\times 4 = 16$$ possible hands. Since all $$\binom{40}{4} = 40\times39\times38\times37 / 4! = 91\,390$$ hands are equally likely, the probability is

$$\frac{4\times 4}{\binom{40}{4}} = \frac{16}{40\times39\times38\times37/24} = \frac{16}{91\,390}\ \approx\ 0.000175.$$

Alternative solution (based on permutations). Your methods attempt to keep track of cards drawn as they are selected, but they all make various errors. Use a tree to analyze all possibilities reliably.

This tree tracks the selection by starting at the empty hand (red, bottom left) and pointing at selected cards with arrows. The terminus of each arrow labels the card selected. The numbers on the arrows count the number of possibilities with each selection. Each path through the tree represents ways to obtain four cards summing to $$5$$ and these are all the possible ways to do so. (It should now be apparent that the paths correspond to the step at which the lone Two is selected.)

The total number of selections represented by any path through the tree is the product of the counts along its arrows, because all those choices are independent. Evidently, that number is the same in each path, equal to $$4\times 4\times 3\times 2$$ (reflecting four ways to choose a Two and $$4\times3\times2$$ sequences of three Aces). Because the paths are disjoint, their counts sum to the total, equal to $$4\times(4\times 4\times3\times2) = 16\times 24.$$

The total number of distinct sequences is $$40\times39\times38\times37$$ because the number of possibilities decreases by one with each card drawn. This gives

$$\frac{16\times 24}{40\times39\times38\times37}$$

for the probability.

• Dear whuber, would you please also share the r script corresponding to the graphical output? Alternatively if you can reference a source that allows to replicate this. many thanks. Commented Jun 4 at 8:12