# Hypergeometric card question

I have a set of 60 things. Of those things, 24 belong to one type, 8 to another type, and 4 to a third type. If you select 7 things from the set, what's the probability of getting at least one of each together?

-

What do you mean by 24/60 8/60 etc?  How many cards do you have in your deck?  Do they have suits?  How are they marked/numbered? – Michael Chernick Jul 16 '12 at 23:10
srry, changed it to make it easier to understand. – Harrison Cho Jul 16 '12 at 23:15
Are these two separate questions? In the first question, are the sets of 24, 8 and 4 overlapping? Also, is this homework? – Macro Jul 16 '12 at 23:16
no its not hw, its an argument with a frend. 2 diff questions xD sorry. and its a probability for a game. – Harrison Cho Jul 16 '12 at 23:19
Do you want the probability of getting exactly one of each type or at least one of each type? – Macro Jul 16 '12 at 23:21
show 2 more comments

## 1 Answer

One way to solve this is with inclusion-exclusion. It is easy to count the $7$-tuples which definitely miss some set of types, which might or might not miss any of the others. This means we can evaluate the terms of the following:

$\#$ ways to include all types

$$= \sum_{S \subset \lbrace 1,2,3 \rbrace} (-1)^{|S|} (\# 7-\text{tuples missing types in}~ S)$$

$= {60 \choose 7}$

$-{60-24 \choose 7}-{60 - 8 \choose 7} -{60-4 \choose 7}$

$+{60-24-8 \choose 7}+{60-24-4 \choose 7}+{60-8-4 \choose 7}$

$-{60-24-8-4 \choose 7}$

$= 386,206,920 - 8,347680-...+73,629,072-346,104$

$= 89,990,144$

````Mathematica code:
b[vec_] := Binomial[60 - Total[vec], 7] * (-1)^Length[vec]
Total[Map[b,Subsets[{24,8,4}]]

89990144
````

So about $90$ million out of $386$ million ($23.3\%$) of the combinations contain at least one of each type. If all $7$-tuples are equally likely, then the probability of getting one of each is $23.3\%$.

There are other methods. You can determine the number of ways to split $7$ types among the $4$ so that the first $3$ types have a multiplicity of at least $1$. For example, there could be $3$ of type $1$, $1$ of type $2$, $1$ of type $3$, and $2$ others, and the number of $7$-tuples with this multiplicity of types is ${24 \choose 3}{8 \choose 1}{4 \choose 1}{60-24-8-4 \choose 2}$. The number of terms you get here is ${7 \choose 3} = 35$ instead of $8$, and each term would be a product of $4$ binomial coefficients, so I think it would be more complicated, but it should give the same answer.

-
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 29, "mathjax_display_tex": 1, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "english_confidence": 0.9484473466873169, "perplexity_flag": "head"}