Question on Conditional Expectation. with sum of Bernouli random variables.

41 Views Asked by At

X is a uniform random variable on $[n]=\{1,2,\dots ,n\}$ and for every $i\in[n]$ We define$ Y_i \sim Ber(\frac{1}{2})$ ,such that all The variables are independent(all The Y's and X). now we have to calculate the following expectations: $$a_{1}=\mathbb{E}[\sum_{i\le X}Y_{i}|Y_{1}=Y_{2}=\dots=Y_{X}=1]$$ and $$a_{2}=\mathbb{E}[\sum_{i\le X}Y_{i}]$$ And after you calculate the expected values, you have to explain why for large $n$ we get that $a_{1}$ is much smaller than $a_{2}$.
The problem is that I got that $a_1>a_2$, always, like this: $$a_{1}=\mathbb{E}[\sum_{i\le X}Y_{i}|Y_{1}=Y_{2}=\dots=Y_{X}=1]\stackrel{\text{adds 1 X times}}{=}\mathbb{E}[X]=\frac{n+1}{2}$$ $$a_{2}=\mathbb{E}[\sum_{i\le X}Y_{i}]=\sum_{k=1}^{n}\mathbb{E}[\sum_{i\le X}Y_{i}\vert X=k]\cdot\mathbb{P}(X=k)=\sum_{k=1}^{n}\mathbb{E}[\sum_{i\le k}Y_{i}]\cdot\mathbb{P}(X=k)$$ $$=\frac{1}{n}\cdot\sum_{k=1}^{n}\sum_{i=1}^{k}\mathbb{E}[Y_{i}]=\frac{1}{n}\cdot\sum_{k=1}^{n}\frac{k}{2}=\frac{1}{2n}\cdot\frac{n(n+1)}{2}=\frac{n+1}{4}$$ And $\frac{n+1}{2}>\frac{n+1}{4}$, always. Does anyone have any idea what I am doing wrong? Thanks in advance.


This question was given as homework.
1

There are 1 best solutions below

9
On BEST ANSWER

Your error is in $a_{1}=\mathbb{E}[\sum_{i\le X}Y_{i}\mid Y_{1}=Y_{2}=\dots=Y_{X}=1]\stackrel{\text{adds 1 X times}}{=}\mathbb{E}[X]$ as you are taking the conditional expectations in the wrong order. Assuming independence:

  • The event $X=x$ has probability $\frac1n$
  • The joint event $(X=x) \cap (Y_{1}=Y_{2}=\dots=Y_{x}=1)$ has probability $\frac1{n2^x}$
  • so $\mathbb{E}\left[\sum\limits_{i\le X}Y_{i}\mid Y_{1}=Y_{2}=\dots=Y_{X}=1\right] =\dfrac{\sum\limits_{x=1}^n \frac x{n2^x} }{\sum\limits_{x=1}^n \frac 1{n2^x}}=2-\dfrac{n}{2^n-1}$
  • which is less than $\frac{n+1}{4}$ for $n\ge 7$ and, since it is bounded above by $2$, a lot less for large $n$.

As an illustration when $n=2$, you have

  • $\mathbb P(X=1, Y_1=1)=\frac14$
  • $\mathbb P(X=2, Y_1=Y_2=1)=\frac18$
  • so $\mathbb{E}\left[\sum\limits_{i\le X}Y_{i}\mid Y_{1}=Y_{2}=\dots=Y_{X}=1\right] = \frac{1\times \frac14+2\times\frac18}{\frac14+\frac18}=\frac43$

which is not your $\frac{n+1}{2}=\frac32$