There are $6$ red balls, $6$ white balls and $6$ black balls.All balls of same colour are identical. These balls are distributed into two bags $A$ and $B.$ The number of ways of each bag getting equal number of balls accounting that all balls are distributed.
My attempt: Since all balls are distributed and each bag gets equal number, each bag gets $\frac{6+6+6}{3}=9$ balls. Now if we just decide the nine balls bag $A$ gets the left over $(18-9)=9$ balls will go to $B.$ Using multinomial theorem method to find the number of ways of selecting nine balls out of $6$ of one type, $6$ of second type and $6$ of third type.
Number of ways is coefficient of $x^9$ in
$(x^0+x^1+x^2+x^3+x^4+x^5+x^6) \cdot (x^0+x^1+x^2+x^3+x^4+x^5+x^6)\cdot(x^0+x^1+x^2+x^3+x^4+x^5+x^6)$
$=(x^0+x^1+x^2+x^3+x^4+x^5+x^6)^3$
$=\frac{1-x^7}{1-x}$
Solving i get $73$ but answer is $18\choose 9$.
You made a typo in your solution, but you still got that there will be $9$ balls in each bag, which is correct. You are also correct that the number of ways is the coefficient of $x^9$ in your polynomial. You made a mistake in your calculation. You should have gotten $\left(\dfrac{1-x^7}{1-x}\right)^3$ and not just$\left(\dfrac{1-x^7}{1-x}\right).$ So to find the coefficient of $x^9,$ the general term of the numerator is ${3\choose k}(-x^7)^{3-k}$ and the denominator $\dfrac{1}{(1-x)^3}$ is equal to $\displaystyle\sum_{n=0}^\infty{n+2\choose 2}x^n.$ Thus the coefficient of $x^9$ is precisely $-3\cdot 6+{11\choose 2}=37,$ so the given answer is wrong. Notice that once $9$ balls are chosen to go into a bag, there is only $1$ choice left for the rest of the $9$ balls.