Understanding $\sum_{x = 0}^y x = \frac{y(y + 1)}{2}$ in a step of a proof

49 Views Asked by At

I have the following problem:

Suppose that $Y \sim \text{Poi}(1)$. Let $y \ge 0$ be an integer. Given that $Y = y$, suppose that $X$ has the discrete uniform law on $\{ 0, 1, \dots, y \}$.

(a) Show that $E[X \vert Y] = \dfrac{1}{2}Y$, and use this to find $E[X]$.

The provided solution is as follows:

We are given that $P(X = x \vert Y = y) = (y + 1)^{-1}$ for $x \in \{ 0, 1, \dots, y \}$, and $P(X = x \vert Y = y) = 0$ otherwise.

(a) From the conditional PMF, we can compute the conditional expectation of $X$ given $Y = y$:

$$\begin{align} E[X \vert Y = y] &= \sum_{x = 0}^y xP(X = x \vert Y = y) \\ &= (y + 1)^{-1} \sum_{x = 0}^y x \\ &= (y + 1)^{-1} \left[ \dfrac{y(y + 1)}{2} \right] \\ &= \dfrac{y}{2}. \end{align}$$

Therefore, $E[X \vert Y] = \dfrac{Y}{2}$. Now, since $Y \sim \text{Poi}(1)$, we know that $E[Y] = 1$. We now compute $E[X]$ using the law of total expectation:

$$\begin{align} E[X] &= E[E[X \vert Y]] \\ &= E \left[ \dfrac{Y}{2} \right] \\ &= \dfrac{1}{2} E[Y] \\ &= \left( \dfrac{1}{2} \right) (1) \\ &= \dfrac{1}{2}. \end{align}$$

How is it that $\sum\limits_{x = 0}^y x = \dfrac{y(y + 1)}{2}$?

I would appreciate it if someone would please take the time to explain this.

2

There are 2 best solutions below

0
On

You can think of $1+2+\ldots+y$ as a 'staircase' whose upper column has height $y$. Double it and lay it on itself. Then you get a $y\times y$ square, with the diagonal counted twice. So $2\sum_{x=0}^y x = y^2+y%$.

enter image description here

enter image description here

1
On

Just for giggles, here are two more ways to see it. This trick is allegedly due to Gauss, age $7$. $$ S = 1+ 2 +\ldots +y-1 + y $$ $$ S = y + y-1 +\ldots + 2 + 1 $$ $$ 2S = (y+1) + (y+1) + \ldots + (y+1) + (y+1) = y\cdot (y+1);\qquad S = \frac{y(y+1)}{2} $$ Or another geometric proof (I'd encourage you to check out Proof Without Words for more great pictures). If you squint hard enough, each staircase looks like an $n\times n$ triangle. The overhang is $n$ $1\times 1$ triangles, so $\displaystyle{S= \frac{n^2}{2}+\frac{n}{2}}$.

enter image description here