# Probability that a random 13-card hand contains at least 3 cards of every suit?

A random 13-card hand is dealt from a standard deck of cards. What is the probability that the hand contains at least 3 cards of every suit? (Introduction to Probability, p.36)

My solution:

• There are $\binom{52}{13}$ possible hands.
• Because there are 13 cards for the hand, to obtain at least three cards of one suit per hand, we need to have exactly three cards of one suit per hand plus one additional card of any suit, thus $\binom{13}{3}^4 * 4 \binom{10}{1}$
• Result: $\frac{40*\binom{13}{3}^4}{\binom{52}{13}} = 0.4214$

However, simulating it in R yields:

deck <- rep(1:4, 13)
out <- replicate(1e5,{
hand <- sample(deck, size=13, replace=FALSE)
all(table(hand) >= 3)
})
mean(out)
> 0.14387


Can anybody tell me what is wrong?

EDIT

I'm afraid, the correct code should be.

deck <- rep(1:4, 13)
out <- replicate(1e5,{
hand <- sample(deck, size=13, replace=FALSE)
length(table(hand))==4 & all(table(hand) >= 3 )
})
mean(out)
> 0.10639

• The correct result is about $0.105$, yet the R simulation yields $0.14387$. This is the second R simulation you've posted today that gives a result significantly different from the theoretical result. There must be something wrong with the R code (up to and including the possibility that R's randomization is insufficiently random for your purpose) but I still don't know what the error is. You might want expert advice on this so that you aren't misled by an incorrect simulation in the future. Dec 7, 2014 at 17:17
• @DavidK R is completely fine, the idiot is me. As you mentioned, I posted two times simulations along with my questions and both of them were wrong, because I didn't give enought thought to the special cases. I'm sorry for the confusion I caused. Motivation for the code was that I didn't just want to ask for whether correct or not, but give some justification for my doubt and demonstrate previous work on the problem. Dec 7, 2014 at 17:32
• Good for you for finding that correction to the R code. The error was sufficiently subtle for me to miss it entirely, even knowing that something must be wrong. Dec 7, 2014 at 17:47

Dominik, your answer was off by a factor of 4. This happened because you counted a hand containing J,K,Q,A of spades (for example) 4 times: (JQK)(A), (QKA)(J), (KAJ)(Q), and (JAQ)(K)

• The answer above is a correct description of the basic issue that led to the overcount. Dec 7, 2014 at 15:40

We count the "favourables," the 4-3-3-3 hands. The suit in which we have $4$ cards can be chosen in $\binom{4}{1}$ ways. For each of these ways, the actual $4$ cards in that suit can be chosen in $\binom{13}{4}$ ways. For each of these ways, the cards in the other three suits can be chosen in $\binom{13}{3}^3$ ways, for a total of $\binom{4}{1}\binom{13}{4}\binom{13}{3}^3$.

Remark: Your counting procedure results in multiple counting. Think, for example, of the 4-3-3-3 hand that has the K, Q, J, 10 of hearts, and some specific cards for the rest of the hand. Your calculation views, for example, K, Q, J of hearts, and later 10 of hearts, as different from K, J, 10 of hearts, and then Q of hearts.

• As @judith pointed out above, it seems that $\binom{4}{1} \binom{13}{4} \binom{13}{3}^3 = \binom{13}{3}^4 \binom{10}{1}$. However, I still don't understand what I am overcounting. What do you mean by "the 4-3-3-3 hand that has the K, Q, J, 10 of hearts"? Could you rephrase/eleborate on your remark please? Dec 7, 2014 at 15:18
• You counted the $12$-card 3-3-3-3 hands and then added a card in one of the suits. Each 4-3-3-3 hand comes up in $4$ ways, so you are overcounting by a factor of $4$. Here is a simpler example. How many $3$ card hands have $2$ hearts and $1$ diamond? The obvious answer is $\binom{13}{2}\binom{13}{1}$. (Cont) Dec 7, 2014 at 15:33
• (Cont) Here is a wrong way of counting. Pick a heart and a diamond, $\binom{13}{1}^2$ ways. Then add a heart, The wrong way counts twice the hand that has K, Q of hearts, and 5 of diamonds, once as K of hearts, 5 of diamonds, then Q of hearts, and also as Q of hearts, 5 of diamonds, and then K of hearts. Dec 7, 2014 at 15:35
• Thank you for elaborating on it. I think I understand my error now. Dec 7, 2014 at 16:18
• You are welcome. This sort of inadvertent multiple counting happens fairly often, until one gets sensitized to it. Dec 7, 2014 at 16:21

I doubt, that it is still interesting for you, but I want to check myself.I think either you or I misunderstand the question. Because it asks to find the probability of the hand contains AT LEAST 3 cards of every suit and you calculated the probability of EXACTLY 3 cards of every suit. From my point of view answer must be:

1. for 0 cards of every suit there is no point to calculate, since nothing happened

2. for 1 cards of every suit (choose from 13-1)^3(choose from 13-remainig 10)(choose from 4-1) and divide all this to (choose from 52-13)

3. for 2 cards of every suit (choose from 13-2)^3(choose from 13-remainig 7)(choose from 4-1) and divide all this to (choose from 52-13)

Then just substract from 1 the calculated probability and you will get P(>=3)

• OP is definitely not calculating exactly three cards of every suit. Because there are 13 cards in a hand, the only distribution(s) that have at least three cards in every suit have three suits with three cards in them and one suit with four; this is what OP attempts to calculate (with the overcounting mentioned in other answers). The hand size is fixed, so the notion of '1 card of every suit' doesn't make sense; it's an impossible configuration. Jul 9, 2021 at 3:11

Another solution that's more mechanical and generalizable to other arrangements like two pair or full house:

We know we must have a 4-3-3-3 hand. You can pick any card for the first suit: 52. The next three cards must match the suit of the first so there are 12 x 11 x 10 possibilities for those. Now for the 4th card, we can pick any card not in the 1st suit: 39. Using the same reasoning as before, for the next two cards there are 12 x 11 possibilities. We continue until we have picked all cards:

$$X = (52 \times 12 \times 11 \times 10) \times (39 \times 12 \times 11) \times (26 \times 12 \times 11) \times (13 \times 12 \times 11)$$

$$X$$ gives us all arrangements of the pattern WWWW XXX YYY ZZZ, as such we overcount all the internal arrangements of W, X, Y, and Z ($$4!3!^3$$). We also overcount that X, Y, and Z can be interchanged ($$3!$$).

So the answer is $$X /(4!3!^4) / {52 \choose 13}$$.