Change in expected value by repeating an experiment I made this question myself which I think is a question on the conceptual level of expected values which can be solved only by logic. However being a beginner at expectancy, I am unable to solve this. I would greatly appreciate if anyone helps me in this. 
Suppose the random variable associated to an experiment be X. Let the expected value of X be E. Now consider another event F which has probability p of happening. After the experiment, it is checked whether the event F occurs or not. If it does, the experiment is repeated. If it does not, the process in terminated.  
My question is, by doing this process, does the expected value of the total experiment change or does it remain the same? Please give your reasoning, I prefer proper reasoning/useful hints rather than just the answer.
Thanks! 
 A: Formalizing what seems to be the setting the OP has in mind, we consider some i.i.d. random variables $X$ and $(X_n)_{n\geqslant1}$, and a random time $T$, independent of $(X_n)_{n\geqslant1}$, with geometric distribution of parameter $p$, that is, such that $P(T=n)=p(1-p)^{n-1}$ for every $n\geqslant1$. 
The sample before $T$ is $(X_n)_{1\leqslant n\leqslant T-1}$. Its empirical mean is 
$$
M'=\frac1{T-1}\sum\limits_{n=1}^{T-1}X_n,
$$
which is undefined when $T=1$. Instead one might want to consider the sample $(X_n)_{1\leqslant n\leqslant T}$ up to time $T$ and its empirical mean 
$$
M=\frac1T\sum\limits_{n=1}^{T}X_n.
$$
If $P(X\in F)\ne0$, then $T$ is almost surely finite and $M$ is well defined. Furthermore,
$$
M=\frac1T\sum\limits_{n=1}^\infty X_n\mathbf 1_{n\leqslant T},
$$ and each $X_n$ is independent of $T$, hence
$$
E[M]=E\left[\frac1T\sum\limits_{n=1}^{\infty}\mathbf 1_{T\geqslant n}\right]\,E[X].
$$
Noting that $\sum\limits_{n=1}^{\infty}\mathbf 1_{T\geqslant n}=T$ almost surely, one sees that 
$$
E[M]=E[X],
$$
thus, the stopping procedure does not modify the empirical mean.
All this assumes that $T$ is independent of $(X_n)_{n\geqslant1}$. Beware though that other stopping rules, such as $T=\inf\{n\geqslant 1\mid X_n\in B\}$ for some fixed $B$, might change $E[M]$.
A: Consider flipping a coin. Our experiment will give us $+1$ if we get a Head, and a $0$ if we get a Tail.
The expected value of a flip is $\frac{1}{2}$.
Let the stopping condition be getting a Tail. 
Then, we know that the expected number of flips is 2, of which only the last coin flip is a tail in each experiment, and hence the 'expected value' of the experiment is 1.

If the expected value of a trial is 0, and your stopping condition only depends on the value of the previous trials, then you can show that the 'expected value' of the experiment is 0. This follows by applying the linearity of expectation to the expected value of each trial. This is also known as a martingale (with no drift).
