}-valued random variables. For every let be the σ-algebra generated by and define when is the first random variable taking the value . Note that , hence by the ratio test. The assumptions (), () and (), hence () and () with , (), (), and () hold, hence also (), and () and Wald's equation applies. However, () does not hold, because is defined in terms of the sequence . Intuitively, one might expect to have in this example, because the summation stops right after a one, thereby apparently creating a positive bias. However, Wald's equation shows that this intuition is misleading. Counterexamples A counterexample illustrating the necessity of assumption () Consider a sequence of i.i.d. (Independent and identically distributed random variables) random variables, taking each of the two values 0 and 1 with probability (actually, only is needed in the following). Define . Then is identically equal to zero, hence , but and and therefore Wald's equation does not hold. Indeed, the assumptions (), (), () and () are satisfied, however, the equation in assumption () holds for all except for . A counterexample illustrating the necessity of assumption () Very similar to the second example above, let be a sequence of independent, symmetric random variables, where takes each of the values and with probability . Let be the first such that . Then, as above, has finite expectation, hence assumption () holds. Since for all , assumptions () and () hold. However, since almost surely, Wald's equation cannot hold. Since is a stopping time with respect to the filtration generated by , assumption () holds, see above. Therefore, only assumption () can fail, and indeed, since and therefore for every , it follows that A proof using the optional stopping theorem Assume (), (), (), (), () and (). Using assumption (), define the sequence of random variables Assumption () implies that the conditional expectation of given equals almost surely for every , hence is a martingale with respect to the filtration by assumption (). Assumptions (), () and () make sure that we can apply the optional stopping theorem, hence is integrable and Due to assumption (), and due to assumption () this upper bound is integrable. Hence we can add the expectation of to both sides of Equation () and obtain by linearity Remark: Note that this proof does not cover the above example with