# Finding Marginal pmf

I am studying for an exam and have come across this problem:

Let the random variables $X$ and $Y$ have the joint pmf:

$f_{XY}(x,y)={2\over{n(n+1)}}$ for $y=1, . . . , x$; $x=1, . . . , n$

Find the marginal pmf of $f_Y(y)$.

Normally I have no problem finding these, but this seems to have a dependence in the support that wreaks havoc on my finding the marginal distribution. I tried this, but this leaves $x$ in the marginal distribution's support, so I know it's not right.

$f_Y(y)=\sum_{x=1}^{n}f(x,y)={2n\over{n(n+1)}}={n\over{n(n+1)}}$ for $y=1, . . . , x$

I know this isn't write since the support now contains, $x$. The solution is shown in my notes as:

$f_Y(y)={2(n-y+1)\over{n(n+1)}}$ for $y=1, . . . , n$

Can someone help me understand how this solution was derived?

Thank you.

References Roussas, George G. An introduction to probability and statistical inference. 2nd ed. San Diego, CA: Elsevier/Academic Press, 2015. (p. 151, exercise 2.6)

• Do you mean x=1,...,n rather than y=1,...,n? May 6, 2017 at 1:25
• Did you try drawing a picture? May 6, 2017 at 1:41
• $X$ and $Y$ don't have a joint pdf in the usual sense of the term; they are discrete random variables and have a joint pmf. Draw a $n\times n$ table with columns labeled $x=1$ through $x=n$ and rows labeled $y=1$ through $y=n$. Fill in $P\{X=x, Y=y\}$ in the $x$-$y$th entry remembering that the probability is nonzero only if the selected value of $y$ is between $1$ and the selected value of $x$ and so it is not the case that all the entries are nonzero. Does this help any? May 6, 2017 at 1:59
• Hi, @Dilip Sarwate. That really helped and I was able to figure it out now! I was very close to getting this earlier, but didn't go to the trouble of filling out all the values in the table and recognizing the zero entries and the general pattern showing the decreasing summed items as y increased. This was a tremendous help. Thank you! May 6, 2017 at 2:40
• Sorry, I mentally had automatically translated your formula to be defined on $(x,y)\in\{1:n\}^2$, putting an $[y\leq{x}]$ Iverson bracket factor in the PMF ... but didn't make that explicit :) May 6, 2017 at 3:18

The joint pmf is $$f_{X,Y}(x,y) = \frac{2}{n(n+1)} \times I_{\{1,\dots,n\}}(x) \times I_{\{1,\dots,x\}}(y).$$ Draw a figure to check that $$I_{\{1,\dots,n\}}(x) \times I_{\{1,\dots,x\}}(y) = I_{\{1,\dots,n\}}(y) \times I_{\{y,y+1,\dots,n\}}(x).$$ Hence, \begin{align*} f_Y(y) &= \sum_{x=1}^n f_{X,Y}(x,y) = \frac{2}{n(n+1)} \times I_{\{1,\dots,n\}}(y) \times \sum_{x=1}^n I_{\{y,y+1,\dots,n\}}(x) \\ &= \frac{2(n-y+1)}{n(n+1)} \times I_{\{1,\dots,n\}}(y). \end{align*}

If you try to plot a table of joint probabilities of $f_{XY}$ you will notice that only the upper triangular part of the table has non-zero values, and notice also that: $$P(y=1)=\sum_{i=1}^{n} \frac{2}{n(n+1)}$$ $$P(y=2)=\sum_{i=2}^{n} \frac{2}{n(n+1)}$$ and so on. So, $$P(Y=y)=\sum_{i=y}^{n} \frac{2}{n(n+1)}=\frac{2(n-y+1)}{n(n+1)}$$

And $P(Y=y)$ is just the PMF of $Y$

I will post an answer to my own question to add to @Zen's, but @Philip Sarwate's comment helped me the most. I just took an arbitrary $n$, in this case WLOG, I set $n=5$ and created a $x-y$ table as he suggested and filled in the values:

I noticed the general upper triangular pattern. and noticed that as $y$ increased, the number of constant terms summed (see the values in parentheses at in the last column) to form $f_Y(y)$ decreased and followed the pattern ($n-y+1$). So, the final answer is simply:

$f_Y(y)=(n-y+1){2\over{n(n+1)}}$ for $y=1, 2, ..., n$ and $0$ otherwise.

Thank you again for everyone's assistance. This really is a great community.

• BTW for future reference, note that the normalization factor in the joint PMF is a (reciprocal) triangular number. This makes sense, as the uniform PMF must sum to 1 over the domain. May 6, 2017 at 3:19
• Thank, @GeoMatt22. I really appreciate it. It does, indeed, make sense. May 6, 2017 at 3:23