Counting problem; $m, n (mThis is a counting problem. 
There are $m$ indistinguishable objects of type $1$ and $n$ indistinguishable objects of type $2$, where $m < n$. We choose $r$ objects with repetition. Then how many ways are there if the order of selection does not matter? 
My guess is, $C(m+n+r-1,r)$, since it is considered to choose $r$ objects from $m+n$ with repetition; however, this problem suggest that 'consider cases: $r < m$, $m \leq r < n$, $n \leq r$)', but I did not know how to solve it with that range. 
 A: We want to choose $i$ objects from the $m$, and $r-i$ from the $n$, where $i$ can be any number between 0 and $\min(r,m)$.
There are $\binom{m}{i}$ ways to choose $i$ from the $m$, and $\binom{n}{r-i}$ ways to choose $r-i$ from the $n$. Then there would be $\binom{m}{i} \binom{n}{r-i}$ ways to choose $i$ objects from the $m$, and $r-i$ from the $n$.
And we need to sum up the numbers of combinations for all possible $i$ values. The result would be
$$ \sum_{i=0}^{i\leq min(r,m)} \binom{m}{i} \binom{n}{r-i} $$
A: Let's rephrase the question this way:  
We have $m$ indistinguishable blue marbles and $n$ indistinguishable green marbles, with $m < n$.  In how many ways can we select $r$ of the $m + n$ marbles if the order of selection does not matter?
Case 1:  $r < m$.  
Since marbles of the same color are indistinguishable and the order of selection does not matter, a selection is completely determined by the number of blue marbles.  Since $r < m$, the number of blue marbles we can select varies from $0$ to $r$, so there are $r + 1$ distinguishable selections of $r$ marbles.
Notice that the same argument applies if $r = m$, in which case the number of distinguishable selections is $m + 1$.
Case 2:  $m \leq r < n$
Since $m \leq r < n$ and only $m$ blue marbles are available, we must select at least $r - m$ green marbles.  We can select at most $r$ green marbles.  Thus, the number of possible selections is 
$$r - (r - m - 1) = m + 1$$
Alternatively, observe that we can select between $0$ and $m$ blue marbles, with the remainder being green, giving us $m + 1$ choices.
Notice that the same argument applies if $r = n$, so we also have $m + 1$ distinguishable selections in that case.
Case 3:  $r \geq n$
Since $r \geq n$, we must select at least $r - n$ blue marbles.  We can select at most $m$ blue marbles.  Hence, the number of possible selections is $$m - (r - n - 1)$$  
Let's check the extreme cases.  
If we select all the marbles, then $r = m + n$, so 
$$m - (r - n - 1) = m - (m + n - n - 1) = m - (m - 1) = 1$$
which makes sense since there is only one way to select all the marbles.
If $r = n$, then 
$$m - (r - n - 1) = m - (n - n - 1) = m - (-1) = m + 1$$
which makes sense since we can select from $0$ to $m$ blue marbles when we select $n$ marbles from a collection of $m$ blue marbles and $n$ green marbles. 
