Multiple distinct objects inserted together into distinct bins Suppose there are $9$ distinct apples, $7$ distinct bananas and $6$ identical bins.
How many possible configurations in which exactly one bin will hold 5 apples, exactly one bin will hold 3 bananas, and the remaining 4 bins will hold 1 apple and 1 banana are there? (regardless of the bin order)
Items can be inserted into the bins in any combination (for example, the bin which will hold 5 apples can have inside it apples number $1, 2, 4, 7, 9$; the bin which will hold 3 bananas can have inside it bananas number $(1, 5, 6)$.
Are there any generalization formulas for this type of problems?
 A: For this type of problem you can calculate the number of ways to split up the apples first. In your example this means simply choosing $5$ apples from $9$ i.e. $\begin{pmatrix}9\\5\\\end{pmatrix}$ ways.
What remains is a problem equivalent to putting the bananas into distinct bins. In your example this means $\begin{pmatrix}7\\3\\\end{pmatrix}4!$ ways .
Finally multiply the two partial answers.
A: 
"Are there any generalization formulas for this type of problems?"

I do not know any specific formula , maybe generating functions can be used to find a formula. Nonetheless, we have a useful approach for it such that when it is asked for "identical" bins , we firstly solve the question as if the bins are distinct from one another. After that , we convert these "distinct " bins into identical bins again by using division rule.Then , let's start :
$\color{green}{\text{$1$.Step-)}}$ Clustering the balls :

*

*Select $5$ apples among $9$ , this can be done by $\binom{9}{5}$


*Select $3$ bananas among $7$ , this can be done by $\binom{7}{3}$


*Select $1$ apple and $1$ banana among $4$ apples and $4$ bananas by $\binom{4}{1}\binom{4}{1}$


*Select $1$ apple and $1$ banana among $3$ apples and $3$ bananas by $\binom{3}{1}\binom{3}{1}$


*Select $1$ apple and $1$ banana among $2$ apples and $2$ bananas by $\binom{2}{1}\binom{2}{1}$


*Select $1$ apple and $1$ banana among $1$ apples and $1$ bananas by $\binom{1}{1}\binom{1}{1}$
So , there are  $$\binom{9}{5}\binom{7}{3}(4!)^2$$ ways to cluster these fruits in desired amounts.
$\color{green}{\text{$2$.Step-)}}$ Decide which bin will take which cluster :
According to the question ,

*

*one bin will take the cluster which contains $5$ apples , we can choose it $\binom{6}{1}$ ways.


*one bin will take the cluster which contains $3$ bananas , we can choose it $\binom{5}{1}$ ways.


*the rest will have the same type of cluster ,i.e the cluster which contains one apple and one bananas , so because of they are same type objects (clusters) ,we can distribute them in only one way ,i.e $\binom{4}{4}$
So , there are  $$\binom{6}{1}\binom{5}{1}\binom{4}{4}= \frac{6!}{4!}$$ ways to distribute these clusters into $6$ distinct bins.
$\color{green}{\text{$3$.Step-)}}$ Now , we should multiply the first and second step by multiplication rule , then $$\binom{9}{5}\binom{7}{3}(4!)^2\times\frac{6!}{4!}$$
This is the answer if the bins were distinct
$\color{green}{\text{$4$.Step-)}}$ Converting the distinct bins into identical :
By division rule , if you divide your result in step $3$ by $6!$ , you can prevent overcounting and obtain the result for identical bins , so $$\frac{\binom{9}{5}\binom{7}{3}(4!)^2\times\frac{6!}{4!}}{6!}=105,840$$
A: Generalized Formula
A generalized formula can be arrived at using the concept of teams
Suppose you are to choose $4$ teams of $3$ each from $12$ players

*

*If the teams are labeled, eg Lions, Tigers, Panthers, etc  
the answer is $\binom{12}3\binom93\binom63\binom33$


*If the teams are unlabeled, we shall have to divide by $4!$, to remove permutations between identical teams


*An important point to note is that unlabeled teams in effect become labeled if sizes differ, or composition differs (eg boys' team or girls' team)
To come to this particular problem, although the bins are identical, two of the teams become labelled (only apples, only bananas) while four remain unlabeled (equal size and composition)
Putting the pieces together, the formula yields
$\binom 95\binom 73 \times\left (\binom41\binom41\binom31\binom31\binom21\binom21\binom11\binom11\right)\large/4! = 105840$
Of course, the formula can be condensed in various ways, 
but has been written out in full using the

unified concept of labeled and unlabeled teams
