Calculating Odds/Probability with Overlapping Type
I'm making a game where cards can have 1-2 types. Think pokemon types, where a 1-type pokemon is "normal" type and a two type pokemon is "normal/flying".
I'm trying to calculate odds of achieving certain hands given specific types. Something like: what are the odds of pulling 1 normal type in a draw of 5 cards, with a deck size of 50 and 4 normal types? Is relatively easy.
Where I'm running into trouble is where the types overlap. I'm trying to calculate something like:
What are the odds of pulling 2 normal types and 2 flying types in a draw of 5 cards with a deck size of 50, given 4 normal types, 3 flying types, and 4 normal/flying types (where normal/flying can count as a draw toward EITHER, but not BOTH, in other words, 1 normal/flying = 1 normal OR 1 flying, not 1 normal AND 1 flying).
Does anyone know where I could look for formulas or calculators that take into account the above scenario? Thank you.
I know you are looking for a more general approach but you could do a case analysis for your stated example, and then perhaps use it to solve similar ones.
There are $\binom{50}{5}$ possible hands you can have. For the specific hand you're trying to create (two normal cards, two flying cards, and a fifth card that can be anything), we can enumerate the type selections. Let "P" stand for pure, "M" for mixed, "N" for normal, and "F" for flying. We then have for the four specific cards, the following ways they can be drawn from the normal or mixed sets along with the number of ways of occurrence.
$\{$PN, PN, PF, PF $\}$: $\binom{4}{2} \times \binom{3}{2} = 18$
$\{$PN, MN, PF, PF$\}$: $\binom{4}{1} \times \binom{4}{1} \times \binom{3}{2} = 48$
$\{$PN, MN, PF, MF$\}$: $\binom{4}{1} \times \binom{4}{2} \times \binom{3}{1} = 72$
$\{$PN, PN, PF, MF$\}$: $\binom{4}{2} \times \binom{3}{1} \times \binom{4}{1} = 72$
$\{$PN, MN, MF, MF$\}$: $\binom{4}{1} \times \binom{4}{3} = 16$
$\{$PN, PN, MF, MF$\}$: $\binom{4}{2} \times \binom{4}{2} = 36$
$\{$MN, MN, PF, PF$\}$: $\binom{4}{2} \times \binom{3}{2} = 18$
$\{$MN, MN, MF, PF$\}$: $\binom{4}{3} \times \binom{3}{1} = 12$
$\{$MN, MN, MF, MF$\}$: $\binom{4}{4} = 1$
After choosing four cards we have 46 cards to choose from for our final card. Thus the probability of getting two normal cards and two flying cards in a hand with five cards (given the type breakdown you gave) is \begin{align} \text{Prob} & = \frac{1}{\binom{50}{5}}\left[\cdots \text{sum of terms}\cdots\right]\times 46\\ & = \frac{293}{46 060} \simeq 0.0064. \end{align}