How to solve using random variables Eighteen balls are placed at random in seven boxes that are labeled $B_1 , . . . , B_7$ .
Find the probability that boxes with labels $B_1 , B_2$ and $B_3$ all together contain six
balls.
I solved the problem using generation functions. A: no of cases 6 balls can be placed in 3 boxes.

coefficient of $x^6$ in 
  $(1+x+x^2+\dots)(1+x+x^2+\dots)(1+x+x^2+\dots)$
coefficient of $x^6$ in $(1-x)^{-3}$ equals to $\binom{8}{6}$ = 28

B: no of cases 12 balls can be placed in 4 boxes.

same way we can get $N(B)=\binom{15}{3}=420$

C: no of cases 18 balls can be placed in 7 boxes.

we can get $\binom{24}{18}$

final answer of question will be$\frac{N(A)N(B)}{N(C)}$
I want do same problem using random variables but I am not getting how to solve using random variables.
A: We need to make a probability model of the situation. Assume that balls are placed one at a time, with all boxes equally likely, and that the placements are independent. 
Call a placement of a  particular ball a success if the ball ends up in $B_1$, $B_2$, or $B_3$. The probability of success is $\dfrac{3}{7}$. 
We want the probability of exactly $6$ successes in $18$ trials. This is a straight binomial distribution problem. The required probability is
$$\binom{18}{6}\left(\frac{3}{7}\right)^6 \left(\frac{4}{7}\right)^{12}.$$
Remark: We get a different answer if we assume instead that all $7$-tuples $(x_1,\dots,x_7)$ such that $x_1+\cdots+x_7=18$ are equally likely. But that assumption, unless explicitly specified in the problem, is not a reasonable one. 
