How can I calculate E[∑Xi=1I{Yi≤Yn+1}]\mathrm{E}\!\left[\sum _{i=1}^X I_{\{Y_i\leq Y_{n+1}\}}\right]?

Suppose that Y1,,Yn+1 is a random sample from a continuous distribution function F. LetXUniform{1,,n} be independent of the Yi‘s. How can I compute E[Xi=1I{YiYn+1}]?

Answer

Here is an alternative answer to @Lucas’ using the law of iterated expectations:

E[Xi=11(YiYn+1)]=E[E[Xi=11(YiYn+1)|X]]=E[Xi=1E[1(YiYn+1)|X]]=E[Xi=1E[1(YiYn+1)]]=E[Xi=1E[E[1(YiYn+1)|Yn+1]]]=E[Xi=1E[F(Yn+1)]]=E[X]E[F(Yn+1)]=n+12E[F(Yn+1)]

The third step follows from independence of Yi and Yn+1 from X; the fourth step is again an application of the law of iterated expectations; the last step is simply an application of the formula for the expectation of a discrete uniform random variable.

By inverting the order of integration, we derive the remaining expectation:

E[F(Yn+1)]=F(y)dF(y)=ydF(x)dF(y)=xdF(y)dF(x)=(1F(x))dF(x)=1E[F(Yn+1)]

which implies E[F(Yn+1)]=12. Hence:

E[Xi=11(YiYn+1)]=n+14

Attribution
Source : Link , Question Author : hadi , Answer Author : Daneel Olivaw

Leave a Comment