Convolution of discrete uniform random variables

466 Views Asked by At

Find the $pmf$ of $Z = X + Y$ for X and Y i.i.d discrete uniform over {1, 2, ..., N}

I know the convolution formula is

$$ f_Z(z) = \sum_n f_X(x)f_Y(z-x)$$

So $f_X(x) = 1/N$ and $f_Y(y) = 1/N$ too. $f_Y(z - x) = 1/N$ as well because in the discrete uniform, the probabilities are the same for every point in the sample space. So I get

$$ f_Z(z) = \sum_{2}^{2N} \frac{1}{N}\cdot \frac{1}{N} = \sum_{2}^{2N} \frac{1}{N^2} = ~~... $$

I think I'm doing something wrong but I don't know what it is, and I know the answer is

$$ f_Z(z) = \frac{N - |z - (N + 1)|}{N^2} $$

Note: I looked around MSE and while there are similar questions, they don't answer my question specifically.

2

There are 2 best solutions below

1
On

The convolution formula is $$f_Z(z) = \sum_{n=1}^{N} f_X(n)f_Y(z-n).$$ Now if $z\geq n$ that is $z= n,n+1, n+2,\cdots ,2n$ then $f_Y(z-n) = \frac{1}{N}.$ Otherwise it is equal to $0.$ Now consider different cases and observe that you will get the desired formula.

0
On

First, let me recommend using probability mass function notation, $\mathbb{P}(X=n)$ whenever dealing with discrete RVs $X$ over the probability density function notation $f_X(n)$. Note your notation right now does not make total sense $$f_Z(z)=\sum_n f_X(x) f_Y(z-x),$$ is summing over values of $n$ but the arguments of the summands are $x$ and $z-x$...

Next, the convolution formula must take into account where the mass function is defined. With $\mathbb{P}(X=n)$ defined on $n\in \{1,2\dotsc, N\}$, for $\mathbb{P}(Y=m-n)$ to be defined we need $m-n\in \{1,2,\dotsc, N\}$. Since $2 \leq m \leq 2N$ is fixed, in the expression $$\mathbb{P}(X+Y=m)=\sum_n \mathbb{P}(X=n)\mathbb{P}(Y=m-n),$$ where the sum is over all $n=1,2,\dotsc, N$ such that $m-n\in\{1,2,\dotsc, N\}$, all we have to do is find which values of $n$ (the mass functions are zero otherwise) to sum over.

That is, given $2\leq m \leq 2N$, we need $1\leq n \leq N$ such that $$1\leq m-n \leq N.$$ But this implies $$m-N \leq n \leq m-1$$ Now as @model_checker said, one can check the different cases of $m\geq N+1$ or $m \leq N$ to observe the resulting formula.