What is the probability of drawing at least 1 ace, at least 1 king, and at least 1 queen, in a 5 card poker hand from a standard 52 card deck? I use the following terms to define the different events:


*

*A = draw at least 1 ace

*B = draw at least 1 king 

*C = draw at least 1 queen


I use the following expression to define the problem:


*

*P(A∩B∩C) = P(A)P(B|A)P(C|A∩B)


Using Google spreadsheet's HYPGEOMDIST formula:


*

*HYPGEOMDIST(num_successes, num_draws, successes_in_pop, pop_size)


I represent the expression above with the following HYPGEOMDIST formulas:


*

*P(A) = 1 - HYPGEOMDIST(0, 5, 4, 52) ≈ 34.1%

*P(B|A) = 1 - HYPGEOMDIST(0, 4, 4, 51) ≈ 28.6%

*P(C|A&B) = 1 - HYPGEOMDIST(0, 3, 4, 50) ≈ 22.6%


P(A∩B∩C) = P(A)P(B|A)P(C|A∩B) ≈ 2.2%
I'm using https://deckulator.appspot.com/ to double check my output and it uses a multivariate hypergeometric approach for this problem. This is the website output for the presented scenario:
Deck-u-lator Output.
I believe my mistake should be in the P(B|A) or P(C|A&B) terms but I'm not sure what it might be. Can anybody help me with this? 
My goal is to eventually be able to apply the formula to a deck of cards with a variable number of cards. E.g. Instead of 4 of each card, a deck might have 5 Aces, 3 Kings, 2 Queens, etc. and I could just change the numbers in the HYPGEOMDIST formula to get the desired probability.
 A: I did a quick computer simulation and am getting about 2.39%.  I will try to solve it using combinatorics but I am "rusty".
There are 3 cards we are looking for and at least one of each so the pattern for the 3 cards is as follows:
(1,1,1), (1,1,2), (1,1,3), (1,2,1), (1,2,2), (1,3,1), (2,1,1), (2,1,2), (2,2,1), (3,1,1).
10 cases.  You could count up the hands of each case happening and sum them.  For example, case 1, getting exactly 1 of each card has 4 * 4 * 4 * $40 \choose 2$.  Case 2 has 4 * 4 * $4 \choose 2$ * 40...
Take that sum and divide by $52 \choose 5$).
I summed them up and got 62,064 so when divided by 2,598,960 I got 0.02388... = $2.388$%
My answer doesn't directly "mesh" with your method, but it may help you understand the problem better.
A: You seek the probability for drawing at least one ace, at least one king, and at least one queen when selecting five cards from fifty-two in a standard deck.
Your error is that $\mathsf P(B\mid A)$ is not $1-\operatorname{HYPERGEODIST}(0,4,4,51)$ .  You need to use the principle of inclusion and exclusion, along with the definition for conditional probability.
$\mathsf P(B\mid A)=\dfrac{\mathsf P(A,B)}{\mathsf P(A)}=\dfrac{1-2\,HGD(0,5,4,52)+HGD(0,5,8,52)}{1-HGD(0,5,4,52)}$
And similarly for $P(C\mid B,A)$, but this is more effort than it is worth.  Notice that when multiplying out each denominator will be the numerator of the previous term, and thus cancel much of the work.  So you just need the last numerator.
It will be much less hassle to calculate $\mathsf P(A,B,C)$ directly.

Rather, let us use $A,K,Q$ to be the count for aces, kings, and queens, and use the principle of Inclusion and Exclusion. 
$${\mathsf P(A{>}0,B{>}0,C{>}0)=}~{1{-~\mathsf P(A{=}0)-\mathsf P(K{=}0)-\mathsf P(Q{=}0)}\\{+~\mathsf P(A{=}0,K{=}0)+\mathsf P(A{=}0,Q{=}0)+\mathsf P(K{=}0,Q{=}0)}\\{-~\mathsf P(A{=}0,K{=}0,Q{=}0)}}$$
Where: $~~~~\mathsf P(A{=}0)~{=\mathsf P(K{=}0)\\=\mathsf P(Q{=}0)\\=\left.\tbinom 40\tbinom{52-4}5\middle/\tbinom{52}{5}\right.\\=\operatorname{HYPERGEOMDIST}(0,5,4,52)}$
Similarly: $\mathsf P(A{=}0,K{=}0)~{=\mathsf P(A{=}0,Q{=}0)\\=\mathsf P(K{=}0,Q{=}0)\\=\left.\tbinom 80\tbinom{52-8}5\middle/\tbinom{52}{5}\right.\\=\operatorname{HYPERGEOMDIST}(0,5,8,52)}$
Finally: $~~~~\mathsf P(A{=}0,K{=}0,Q{=}0)~{=\left.\tbinom{12}{0}\tbinom{52-12}{5}\middle/\tbinom{52}{5}\right.\\=\operatorname{HYPERGEOMDIST}(0,5,12,52)}$
