San José State University
Department of Economics

applet-magic.com
Thayer Watkins
Silicon Valley
& Tornado Alley
USA

Expected Lengths of Runs

Let S be a set of events and let px be the probability of an event x occurring in one period. The probability of a run of n x's is pxn(1−px) for n≥1. (Runs of length zero are excluded because their inclusion would constitute double counting. A run of length zero for x is simultaneously the beginning of a run of a non-x.)

It must be verified that the set of probabilities pxn(1−px) constitute a proper set of probabilities for the set of run lengths; i.e., that they sum to unity.


Σn=1pxn(1−px) = px(1-pxn=1pxn-1 = px(1-px)(1/(1-px)) = px
 

Therefore the probabilities pxn(1−px) must be divided by px to get a proper set of probilities; i.e., the proper probability of a run of n x's is pxn-1(1−px).

The expected run length is then


E{n} = Σn=1npxn-1(1−px) = (1−pxn=1npxn-1
 

The sum Σn=1npxn-1 is equal to 1/(1−px)² and therefore


E{n} = (1−px)/(1−px)² = 1/(1−px)
 

The expected length of a run is then


Σx∈S px/(1−px)
 

This formula tends to give dominance to the largest values of px.

For example, if S={a, b, c} and pa=pb=pc=1/3 then E{na}=E{nb}=E{nc}=1/(1-1/3) = 1/(2/3) = 3/2 and E{n} = 3(1/3)(3/2) = 3/2.

If pa=1/4, pb=1/2 and pc=1/4 then E{na}=E{nc=1/(1-1/4)=4/3 and E{nb}=1/(1-1/2) = 2. Thus E{n} = (1/4)(4/3) + (1/2)(2) + (1/4)(4/3) = (1/3) + 1 + (1/3) = 5/3.

(To be continued.)


HOME PAGE OF applet-magic
HOME PAGE OF Thayer Watkins