I wrote a probability question I can't solve $\newcommand{\nCk}[2]{{}^{#1}C_{#2}}$
I wrote this question to prep my students for their midterm, and I realized when I sat down to solve it that I can't figure out the right way to think about it.
A costume shop has $7$ costumes available to rent, $4$ of each. You and $9$ friends go to the costume shop independently and each pick a costume. What is the probability you arrive at the party and there are exactly $5$ distinct costumes? (You are the only 10 guests)
I know from simulation that the solution should be something like $0.232402$, perhaps it is $\nCk{7}{5}\cdot 48\cdot\frac{\nCk{15}{5}}{\nCk{28}{10}}$. I can justify the $\nCk{7}{5}$ and the $\nCk{15}{5}$ in the numerator, but not the $48$. $\nCk{7}{5}$ because of the $7$ costumes $5$ are chosen. We need to ensure that $1$ of each are worn by $5$ guests, but the other $5$ are free to choose from the $15$ (hence $\nCk{15}{5}$). But I'm sure I'm thinking about this not quite right. I'd love any explanations. Thanks!
 A: Begin by computing the quantities
$$
    x_5 = \binom 75 \binom{20}{10}, \; x_4 = \binom 74 \binom{16}{10}, \; x_3 = \binom 73 \binom{12}{10}.
$$
These are a naive way to try to compute the number of ways to have exactly $5$, $4$, or $3$ costumes present at the party (fewer is impossible). In each case, we choose which costumes they are, then choose which $10$ "instances" of those costumes were actually bought. (This will be out of a total of $\binom{28}{10}$ possibilities, since there are $28$ "instances" of costumes at the store.)
However, there's some complicated overcounting going on. If only $4$ costumes are present, $x_5$ counts that outcome $3$ times: once for each set of $5$ costumes containing those $4$. If only $3$ costumes are preset, $x_5$ counts that outcome $6$ times: once for each set of $5$ costumes containing those $3$. Similarly, if only $3$ costumes are present, $x_4$ counts that outcome $4$ times.
By this reasoning, we have
$$
    \begin{cases}
       x_5 = y_5 + 3 y_4 + 6 y_3 \\
       x_4 = \phantom{y_5 + 1}y_4 + 4 y_3 \\
       x_3 = \phantom{y_5 + 0y_4 + 1}y_3
    \end{cases}
$$
where $y_5, y_4, y_3$ are the actual number of ways to have exactly $5$, exactly $4$, and exactly $3$ costumes at the party.
Solving for $y_5$, we get $y_5 = x_5 - 3x_4 + 6x_3$. Dividing this by $\binom{28}{10}$, we get our final probability of
$$
    \frac{\binom 75 \binom{20}{10} - 3 \binom 74 \binom{16}{10} + 6  \binom 73 \binom{12}{10}}{\binom{28}{10}} = \frac{6608}{28405} \approx 0.232635.
$$

We can confirm this result by brute-forcing it in Mathematica.
costumes = Join[Range[7], Range[7], Range[7], Range[7]];
outcomes = Subsets[costumes, {10}];
good = Select[outcomes, Length@DeleteDuplicates[#] == 5 &];
Length[good]/Length[outcomes]

The output of this code (which just finds all possible ways to buy $10$ costumes, and then counts the ones in which exactly $5$ distinct costumes appear) is, again, $\frac{6608}{28405}$.
A: You can count cases, assigning unidentified people to the costumes... In total there are 7*4 = 28 costumes. Represent them as in the following table (each box of the table corresponds to a costume).




costume type
exemplar 1
exemplar 2
exemplar 3
exemplar 4




1






2






3






4






5






6






7








Represent the event that a costume is rented by somebody by putting an asterisk in its box. For example the 10 people could be renting the following costumes.




costume type
exemplar 1
exemplar 2
exemplar 3
exemplar 4




1
*

*



2

*




3
*


*


4

*
*



5






6






7
*

*
*




Since each costume has the same probability of being rented, each distribution of 10 asterisks inside of the 28 boxes has the same probability. There is a total of $\binom{28}{10}$.
possible ways to put the 10 asterisk in the 28 boxes. You are interested in all cases where the 10 asterisks fall in exactly 5 lines. Let's count them.
There are $\binom{7}{5}$ different ways to pick the $5$ lines out of the $7$. Once the $5$ lines have been picked, we want to count how many distributions of 10 asterisks within the $20 = 5\cdot 4$ cases of the $5$ lines satisfy our requirements, i.e. have at least an asterisk each line. That is
(nr. all distributions of $10$ asterisks in the $5$ lines) - (nr. distributions of $10$ asterisks in only $4$ out of the $5$ lines) + (nr. distributions of $10$ asterisks in only $3$ out of the $5$ lines)
which evaluates to:
$$\dbinom{20}{10} - \dbinom{5}{1} 
\cdot \dbinom{16}{10} + \dbinom{5}{2} \cdot \dbinom{12}{10}$$
So the probability (favorable cases divided by total cases) is:
$$\dfrac{ \left( \binom{20}{10} - \binom{5}{1} \cdot \binom{16}{10} + \binom{5}{2} \cdot \binom{12}{10} \right) }{\binom{28}{10}} = 0.23263509945432142228480901...$$
With Bin(x,y) of course I mean the binomial coefficient. Sorry for the bad formatting, it's the first time I write here!
A: I find it easier to think of this in terms of cards. Suppose I have a partial deck of cards with all 4 aces, all 4 twos, and so on, up until all 4 sevens. I shuffle these 28 cards and then look at the top 10. What is the probability that exactly 5 ranks are presents among these 10 cards.
The denominator is $\binom{28}{10}$. For the numerator, we must first choose the 5 ranks that will be present, giving a factor of $\binom{7}{5}$. Once these are chosen, we must choose the partition of 10, as Alan noted, that these cards will form. From Alan's answer, they are
43111, 42211, 33211, 32221, 22222
We first count the number of ways of selecting cards according to the first partition. We must choose the rank that will have 4 cards, the rank that will have 3, and the three ranks that will have 1. There are
$$
\binom{5}{1,1,3} = \frac{5!}{1!1!3!} = 20
$$
ways to do that. Once that selection is made, we must actually choose the cards. There are
$$
\binom{4}{4}\binom{4}{3}\binom{4}{1}^3
$$
ways to do that. Continuing with this reasoning for the other four partitions, our final answer will be
$$
\frac{\binom{7}{5}}{\binom{28}{10}}\left(
\binom{5}{1,1,3}\binom{4}{4}\binom{4}{3}\binom{4}{1}^3
+ \binom{5}{1,2,2}\binom{4}{4}\binom{4}{2}^2\binom{4}{1}^2
+ \binom{5}{2,1,2}\binom{4}{3}^2\binom{4}{2}\binom{4}{1}^2
+ \binom{5}{1,3,1}\binom{4}{3}\binom{4}{2}^3\binom{4}{1}
+ \binom{5}{5}\binom{4}{2}^5
\right).
$$
If my calculations are correct, this should be
$$
\frac{6608}{28405} \approx 0.232635.
$$
