finding expected value and variance using conditional expected value and variance

25 Views Asked by At

Let $X \sim G(p)$ and $Y|X \sim B(j,p)$, I need to express $E[Y]$ and $Var(Y)$ using $p$

first I tried expressing $E[Y]$:

$$E[Y|X=j]=\sum_{i=0}^{j}i\cdot\binom{j}{i}p^i(1-p)^{j-i}=\sum_{i=0}^{j}i\frac{j!}{i!(j-i)!}p^i(1-p)^{j-i}=jp\sum_{i=0}^j\frac{(j-1)!}{(i-1)!(j-i)!}p^{i-1}(1-p)^{j-i}=jp\sum_{i=0}^{j}\binom{j-1}{i-1}p^{i-1}(1-p)^{j-i}=jp(p+1-p)^{j-1}=jp$$ hence $$E[Y]=E[E[Y|X]]=\sum_{j=0}E[Y|X=j]p_x(j)=\sum_{j=0}jp(1-p)^{j-1}p=p^2\sum_{j=0}j(1-p)^{j-1}$$ But I don't know how to reach a solution for this last series, and get an answer for $E[Y]$


I then tried expressing $Var(Y)$

Let $Y_i$ be an indicator, therefore $Y=\sum Y_i$ so $$Var(Y|X)=Var(\sum_{i=1}^{j}Y_i|X=j)=\sum_{i=1}^j Var(Y_i)=jp(1-p)$$ I already know that $E[Y|X]=jp$ so all I need is to calculate $$Var(Y)=E[Var(Y|X)]+Var(E[Y|X])=E[jp(1-p)]+Var(jp)$$ but I have no idea how I can calculate this either

In both cases I followed the same steps that were in the examples I got, so I fail to understand what did I do wrong, this is an introduction exercise so it shouldn't be too complicated, yet I am at a complete loss

1

There are 1 best solutions below

2
On BEST ANSWER

First question

But I don't know how to reach a solution for this last series

$$\sum_{j=0} j(1-p)^{j-1}$$

set $(1-p)=q$ and observe that

$$jq^{j-1}=\frac{d}{dq}q^j$$

...the sum of the derivative is the derivative of the sum...the resulting sum is easy because it is a geometric series....and the solution easy follows


Second question

Your text is the following

$X\sim G(p)$ and $Y|X=j\sim Bin (j,p)$

Thus using the variance decomposition you get, as you found

$$\mathbb{V}[Y]=\mathbb{V}[jp]+\mathbb{E}[jpq]=p^2\cdot\frac{q}{p^2}+pq\frac{1}{p}=2(1-p)$$


EDIT: I think it is easy for you to rewrite the text in the following way

$X\sim G(p)$

$Y|X\sim Bin(x,p)$

Thus it is easy to realize that, i.e.

$$E(x pq)=pqE[X]=pq\frac{1}{p}=q$$