If 10 items were chosen at random (with replacement) how many combinations are there to draw exactly x of the n items? I'm sure this has been asked in this forum before but I don't even know where to begin wording the question to find it. Here's what I'm trying to do:
We have n number of items of one color and m number of items of another color. If y items are chosen at random (with replacement) how many combinations are there to draw exactly x of the n items? x < y.
I found the formula for combinations with replacement is (+−1 choose ) but how does this formula apply if, for example, x = 3 and y = 10? Because 10 items are chosen out of n+m total items, but we only care about the combinations of the 3 items, not of the other 7.
 A: For the example where x = 3 and y = 10, we are looking for how many possible ways of picking out 3 items of color 1 and 7 items of color 2. To do this we can consider two seperate problems:

*

*How many combinations of 3 items from the n items colored the first color can we pick? (Note we did allow for replacement, so this could be all 3 of the same item)

*How many combinations of 7 items from the m items colored in the second color can we pick?

The answer for the first problem would be n(n-1)(n-2) + (n)(n-1) + n, we get this because there are 3 cases:

*

*the 3 items are different which gives n(n-1)(n-2) possibilities.

*Two of the items are the same item but the third is different, giving n(n-1) possibilities

*All the items are the same which gives n possibilites.

So when we sum this up we get n(n-1)(n-2) + n(n-1) + n possibilities for the 3 items of color 1. If we were to express this in the general case for x (not just when x = 3). We would formulate it as:
$$\frac{n!}{(n-x)!}+\frac{n!}{(n-(x-1))!}+...+\frac{n!}{(n-1)!}$$
here the first term represents having all x items different, the second equations having x-1 items different, but two items the same, and this continues across all cases until we get to the last term which is just the case where all items are the same. (this last term of the sum just equals n)
For the second problem the calculation is the exact same as the first problem except x is replaced with y-x and the n is replaced with m. This gives the following equation:
$$\frac{m!}{(m-(y-x))!}+\frac{m!}{(m-((y-x)-1))!}+...+\frac{m!}{(m-1)!}$$
Now that we have the solutions for each problem, to find the TOTAl number of possible ways of picking x of the y items in color 1, we just multiply these two equations together:
$$\left (\frac{n!}{(n-x)!}+\frac{n!}{(n-(x-1))!}+...+\frac{n!}{(n-1)!} \right)×\left(\frac{m!}{(m-(y-x))!}+\frac{m!}{(m-((y-x)-1))!}+...+\frac{m!}{(m-1)!}\right)$$
In the case with x = 3 and y = 10, this would be:
$$\left(n(n-1)(n-2)+n(n-1)+n\right)×\left([m(m-1)...(m-6)]+[m(m-1)...(m-5)] +... +m\right)$$
I'm sorry if this wasn't helpful, I may have overcomplicated things.
