I have been thinking for this problem and I found it harder than I expected:
Find de number of distributions of 1000 red balls, 1000 yellow balls and 1000 blue balls in 3 boxes with every box having 1000 balls.
Note: (Balls of the same colour are undistinguishable and boxes are distinguishable)
I would be grateful if someone could help me.
I think the best way is to use generating functions such that
Now, we should find the coefficient of $a^{1000}b^{1000}c^{1000}x^{1000}y^{1000}y^{1000}$ in the expansion of these $9$ generating functions..
As you remember your calculus class , $$\frac{1}{(1-ax)}=1+ax+a^2x^2+a^3x^3+..$$ When we find the product of these generating functions , their coefficient gives the number of all possible ways to construct the desired product,in our question it is $a^{1000}b^{1000}c^{1000}x^{1000}y^{1000}y^{1000}$
$\mathbf{\text{Pseudocode for solution:}}$
Step $1-)$ Write a code that turn the infinite serie such as $1/(1-ax)$ into a infinite polynomial such as $1+ax+a^2x^2+a^3x^3+..$ .Btw , you can also restrict your polynomial $1+ax+a^2x^2+a^3x^3+....+a^{1000}x^{1000}$ , because the number of balls and the capacity of boxes are up to $1000$.
Step $2-)$ Find the product of these nine polynomials , and write a code to pick the coefficient of $a^{1000}b^{1000}c^{1000}x^{1000}y^{1000}y^{1000}$ in this product.
Here is the mathematica code for solution , but because of my free trial time is over for mathematica , so i could not write the answer.However ,if you have mathematica in your computer this code will give you the exact answer: