The title problem is just one specific example of a more generalized problem that I'm trying to solve. I'm trying to write an efficient algorithm for calculating the probability of at least k occurrences each of several dependent events occurring in a particular sample space. It is the presence of wildcards and multiple types of events here that is making the problem difficult for me.

I found this post partially helpful in guiding me: probability of hand with at least 2 kings

I can't figure out how to modify it to accommodate for different card types. I tried subtracting from 1 the sum of the probabilities of drawing a hand containing each proper subset of the minimal set of cards and adding those together. Note that 44 is the number of non-Kings and non-Aces in the deck:

1 -


Pr(0K and 0A) : 4C0 * 4C0 * 44C5 +

Pr(1K and 0A) : 4C1 * 4C0 * 44C4 +

Pr(0K and 1A) : 4C0 * 4C1 * 44C4


But this of course omits the possibility of getting 2-4 Kings (if and only if none of the other cards is an Ace) and getting 2-4 Aces (if and only if none of the other cards is a King). I need a little push in the right direction to help me develop a generalized solution to this problem.

BTW, I'm looking for a method that is more efficient than enumerating all valid combinations, and summing their probabilities. Assume that the method should work somewhat efficiently such that instead of a five card poker hand, it's a billion card poker hand drawn from millions of decks shuffled together.

  • ${48 \choose 5}/{52 \choose 5}$ is probability of no Aces
  • ${48 \choose 5}/{52 \choose 5}$ is probability of no Kings
  • ${44 \choose 5}/{52 \choose 5}$ is probability of no Aces or Kings

so by inclusion-exclusion, the probability of at least one Ace and at least one King is

$$\dfrac{ \displaystyle{52 \choose 5} - 2{48 \choose 5} + {44 \choose 5}}{ \displaystyle{52 \choose 5} }$$

which is close to $10\%$.

  • $\begingroup$ I think I might have over-simplified my example problem, since I'm still having a bit of difficulty. The given response does correctly answer the original question, but perhaps I should have asked a more complicated question like "The probability of getting at least 1 Queen, 2 Kings and 3 Aces in a 7 card hand." This might help demonstrate how to correctly apply the inclusion-exclusion principle. I can accept your answer and start a new question if that would be more appropriate. $\endgroup$
    – tgpaul
    Oct 28 '13 at 1:19
  • $\begingroup$ I posted a new question: math.stackexchange.com/questions/543400/…. Thanks for your help Henry. $\endgroup$
    – tgpaul
    Oct 28 '13 at 22:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.