1888 CHAPTER 59. BASIC PROBABILITY

=∫Fp2

∫Fp1

xdλ X|y (x)dλ Y (y) =∫Fp1×Fp2

xdλ (X,Y)

=∫Fp1

∫Fp2

xdλ Y|x (y)dλ X (x) =∫Fp2

xdλ X (x) = E (X).

Definition 59.10.3 Let {Xn} be any sequence, finite or infinite, of random variables withvalues in R which are defined on some probability space, (Ω,S ,P). We say {Xn} is aMartingale if

E (Xn|xn−1, · · ·,x1) = xn−1

and we say {Xn} is a submartingale if

E (Xn|xn−1, · · ·,x1)≥ xn−1.

Next we define what is meant by an upcrossing.

Definition 59.10.4 Let {xi}Ii=1 be any sequence of real numbers, I ≤∞. Define an increas-

ing sequence of integers {mk} as follows. m1 is the first integer ≥ 1 such that xm1 ≤ a, m2is the first integer larger than m1 such that xm2 ≥ b, m3 is the first integer larger than m2such that xm3 ≤ a, etc. Then each sequence,

{xm2k−1 , · · ·,xm2k

}, is called an upcrossing of

[a,b].

Proposition 59.10.5 Let {Xi}ni=1 be a finite sequence of real random variables defined on

Ω where (Ω,S ,P) is a probability space. Let U[a,b] (ω) denote the number of upcrossingsof Xi (ω) of the interval [a,b]. Then U[a,b] is a random variable.

Proof: Let X0 (ω)≡ a+1, let Y0 (ω)≡ 0, and let Yk (ω) remain 0 for k = 0, · · ·, l untilXl (ω) ≤ a. When this happens (if ever), Yl+1 (ω) ≡ 1. Then let Yi (ω) remain 1 for i =l + 1, · · ·,r until Xr (ω) ≥ b when Yr+1 (ω) ≡ 0. Let Yk (ω) remain 0 for k ≥ r + 1 untilXk (ω) ≤ a when Yk (ω) ≡ 1 and continue in this way. Thus the upcrossings of Xi (ω) areidentified as unbroken strings of ones with a zero at each end, with the possible exceptionof the last string of ones which may be missing the zero at the upper end and may or maynot be an upcrossing.

Note also that Y0 is measurable because it is identically equal to 0 and that if Yk ismeasurable, then Yk+1 is measurable because the only change in going from k to k+1 is achange from 0 to 1 or from 1 to 0 on a measurable set determined by Xk. Now let

Zk (ω) =

{1 if Yk (ω) = 1 and Yk+1 (ω) = 0,0 otherwise,

if k < n and

Zn (ω) =

{1 if Yn (ω) = 1 and Xn (ω)≥ b,0 otherwise.

Thus Zk (ω) = 1 exactly when an upcrossing has been completed and each Zi is a randomvariable.

U[a,b] (ω) =n

∑k=1

Zk (ω)

so U[a,b] is a random variable as claimed.The following corollary collects some key observations found in the above construction.