convolution, trapezoidal distribution pdf $X$ and $Y$ are independent random variables.


*

*$X$ is equal likely to be any value of $\{0,1,2,\ldots,m\}$.

*$Y$ is equal likely to be any value of $\{0,1,2,\ldots,n\}$.


Define $Z=X+Y$. What's the pmf of $Z$? (Assume $m<n$)
The solution given on the handout is:
$P(Z=i)=\frac{i+1}{(m+1)(n+1))}, 0\leqslant i\leqslant m\tag{1}$
$P(Z=i)=\frac{m+1}{(m+1)(n+1)}, m+1\leqslant i\leqslant n\tag{2}$
$P(Z=i)=\frac{m+n-i}{(m+1)(n+1)}, n+1\leqslant i\leqslant n+m\tag{3}$
My question is why the numerator in (2) is not $n-(m+1)+1=n-m$.
The reason why I think it should be $n-m$ is because there are $n-m$ numbers between $m+1$ and $n$. Similar reasoning that the the numerator in (3) should be $n+m-(n+1)+1=m$.
Could any one help me this out? Thanks a lot!
 A: Using

$$
P\left(X+Y=k\right){}={}\sum\limits_{y}P\left(X=k-y\,\,\bigg|\,Y=y\right)P\left(Y=y\right){}={}\sum\limits_{y}P\left(X=k-y\right)P\left(Y=y\right),
$$

there are 3 cases:
(i) For $\,\,\,0\le i\le m$,
$$
P(X=i-y)P(Y=y){}={}\left\{\begin{array}{cc} \dfrac{1}{(m+1)(n+1)},&\,\,\mbox{for }\,\,0\le y\le i\\0,&\,\,\mbox{otherwise} \end{array}\right.
$$
(ii) For $\,\,\,m+1\le i\le n$,
$$
P(X=i-y)P(Y=y){}={}\left\{\begin{array}{cc} \dfrac{1}{(m+1)(n+1)},&\,\,\mbox{for }\,\,\,i-m\le y\le i\\0,&\,\,\mbox{otherwise} \end{array}\right.
$$
(iii) For $\,\,\,n+1\le i\le n+m$,
$$
P(X=i-y)P(Y=y){}={}\left\{\begin{array}{cc} \dfrac{1}{(m+1)(n+1)},&\,\,\mbox{for }\,\,i-m\le y\le n\\0,&\,\,\mbox{otherwise} \end{array}\right.
$$
These suggest that the probabilities should be:

(i) For $\,\,\,0\le i\le m$,
$$
P(X+Y=i){}={}\dfrac{i+1}{(m+1)(n+1)}\,.
$$

(ii) For $\,\,\,m+1\le i\le n$,
$$
P(X+Y=i){}={}\dfrac{m+1}{(m+1)(n+1)}\,.
$$

(iii) For $\,\,\,n+1\le i\le n+m$,
$$
P(X+Y=i){}={}\dfrac{n+m-i+1}{(m+1)(n+1)}\,.
$$

