What is the probability of of drawing at least 1 queen, 2 kings and 3 aces in a 9 card draw of a standard 52 card deck? 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 originally asked a simpler version of the problem here: What is the probability of of drawing at least one king and one ace in a five card poker hand?
This led me to conclusion that inclusion-exclusion is the way to go here.  I think seeing the answer to the title problem (without any reductions) will help me design my algorithm for the general case.  This is what I have so far:
$D := $ the set of all 9-card hands
$$|D| = {\binom{52}{9}}.$$
$Q := $ the set of all 9-card hands containing zero Queens:
$$|Q| = {\binom{4}{0}\binom{48}{9}}.$$
$Q_a := $ the set of all 9-card hands containing at least one Queen:
$$|Q_a| = {|D|-|Q|}$$
$K := $ the set of all 9-card hands containing zero or one King:
$$|K| = {\binom{4}{0}\binom{48}{9}+\binom{4}{1}\binom{48}{8}}$$
$K_a := $ the set of all 9-card hands containing at least two Kings:
$$|K_a| = {|D|-|K|}$$
$A := $ the set of all 9-card hands containing zero, one or two Aces:
$$|A| = {\binom{4}{0}\binom{48}{9}+\binom{4}{1}\binom{48}{8}+\binom{4}{2}\binom{48}{7}}$$
$A_a := $ the set of all 9-card hands containing at least three Aces:
$$|A_a| = {|D|-|A|}$$
$X := $ the set of all 9-card hands containing at least 1 Queen, 2 Kings and 3 Aces:
$$|X| = |D|-[|Q|+|K|+|A|-|Q\cap K|-|K\cap A|-|Q\cap A|+|Q\cap K\cap A|]$$
And of course, the probability of drawing one such hand is just:
$$\frac{|X|}{|D|}$$
Is that correct so far?  This is where I feel it's getting complicated.  How do you calculate for example $|K\cap A|$?  What does it mean to be a hand with "(zero or one King) AND (zero, one or two Aces)"?  This smells like we would need to find all valid sets of $k$ Kings and $a$ Aces and add their cardinalities together.
$S(k,a) := $ the set of 9-card hands containing exactly $k$ Kings and $a$ Aces
$S(q,k,a) := $ the set of 9-card hands containing exactly $q$ Queens, $k$ Kings and $a$ Aces
First, are the following correct?
$$|S(k,a)| = \binom{4}{k}\binom{4}{a}\binom{44}{9-k-a}$$
$$|S(q,k,a)| = \binom{4}{q}\binom{4}{k}\binom{4}{a}\binom{40}{9-q-k-a}$$
If so, are the following true?
$$|K\cap A| = \sum\limits_{a=0}^{2}\sum\limits_{k=0}^{1} |S(k,a)|$$
$$|Q\cap K\cap A| = \sum\limits_{a=0}^{2}\sum\limits_{k=0}^{1}\sum\limits_{q=0}^{0} |S(q,k,a)|$$
Is there a simplication that perhaps I'm missing?  I feel like I've over-complicated this problem (or at least I hope I have).
Any help is appreciated.  Feel free to reference in your response any sets or functions defined here.
 A: I would work this problem forward, not backward. Still messy.
Case 1: hand contains three non-{q,k,a} cards.
Case 2: Hand contains two non-{q,k,a} cards.  Subcases: extra q, extra k, extra a
Case 3: Hand contains one non-{q,k,a} card.  Subcases: 2 extra q, extra q+extra k, etc.
Case 4: All cards are q,k,a.
A: Here is a generating function approach.  
There are $\binom{52}{9}$ 9-card hands, each of which we assume is equally likely. We want to count the hands which have at least one queen, at least two kings, and at least three aces.  Let's say $a_r$ is the number of acceptable r-card  hands, and let $f(x) = \sum_{r=0}^{\infty} a_r x^r$.  Then it's easy to see that
$$f(x) = p_1(x) \; p_2(x) \; p_3(x) \; p_4(x)$$
where we define
$$p_1(x) = \binom{4}{1}x + \binom{4}{2}x^2 +\binom{4}{3}x^3 +\binom{4}{4}x^4$$
$$p_2(x) = \binom{4}{2}x^2 +\binom{4}{3}x^3 +\binom{4}{4}x^4$$
$$p_3(x) = \binom{4}{3}x^3 +\binom{4}{4}x^4$$
$$p_4(x) = (1+x)^{40}$$
Expanding $f(x)$ with a computer algebra system, we find the coefficient of $x^9$ is 1,140,004.  So the probability of an acceptable hand is 
$$1,140,004 / \binom{52}{9} \approx 0.000309862$$
Note: Although I used a computer, I wouldn't rule out the possibility of a pencil and paper solution.  One could multiply $p_1(x) \; p_2(x) \; p_3(x)$ out by hand, up to powers of $x^9$, and then combine this product with $(1+x)^{40}$, expanded by the Binomial Theorem, in order to extract the coefficient of $x^9$ in $f(x)$.
