2 Repeated trials and simple random walks

2.1 Bernoulli processes

Definition 2.1.1.

Bernoulli trials are a sequence of independent experiments whose outcomes are:

either S (success) with probability p
or F (failure) with probability q=1-p

.

Definition 2.1.2.

A Bernoulli process, Bt is a stochastic process defined for t=1,2,3,, where each Bt is an iid Bernoulli random variable.

We can calculate the probability of any finite sequence of the trials such as SSFSFFS by ppqpqqp=p4q3, multiplying together a p for each S and a q for each F.

We will now look at calculating the expected time until we first observe either two successes in a row, or a failure immediately followed by a success using conditional expectation of the outcomes of the first few trials. If a success and a failure are equally likely, which will have the smaller expected time?

Intuitively it feels like these should have the same expected value; but we will see that this is not the case.

Example 2.1.3.

What is the expected time at which two successes in a row occur for the first time in Bernoulli trials? For example in the sequence SFSFFSFSS the time this occurs is trial 9.

Figure 2.1: Link, Caption: none provided

The ends of the branches correspond to distinct possiblities whose probabilities sum to 1. We label these by letting V be a rv with values

V = {123 if the sequence starts with {FSFSS with probability {qpqp2.

Now consider:

if V = {123 then T = {1+T2+T′′2 with probability {qpqp2

where T and T′′ are the further times (numbers of trials) needed to obtain the sequence SS in the first two cases. Of course in the third case we have just achieved SS which is why T = 2. Now we use Theorem 1.3.1 to write

E(T) = E{E(T|V)} (2.1)
= E(T|V=1)q+E(T|V=2)pq+E(T|V=3)p2
= {1+E(T)}q+{ 2+E(T′′)}pq+ 2p2

In the cases starting with F or SF, the further prospects of obtaining SS are exactly the same as starting over again. Therefore:

T, T and T′′ all have the same distribution

and these all have the same expectation which we call

e=E(T)=E(T)=E(T′′).

Substituting for these into (2.1) gives

e=(1+e)q+(2+e)pq+2p2

which simplifies to (1-q-pq)e=q+2pq+2p2 and further to p2e=1+p so that

e=1+pp2.

At this point the choice of tree diagram is seen to be such as to ensure that the branches terminate with an F of SS - the point is to avoid an S or an FS. Note also that the values given to V were only used to enumerate the possibilities; its precise values did not enter into the calculation.

Exercise 2.1.4.

Calculate the expected time at which a success first follows a failure in a Bernoulli process (that is FS). (Hint: You need to do two conditionings, one to find the expected time given you have just had a success, and one to find the expected time given you have just had a failure.)

Figure 2.2: Link, Caption: none provided

So if TF is the further time to FS given we have had an F, then

E(TF)=q(1+E(TF))+p(1)E(TF)=1p.

Hence

E(T)=q(1+1p)+p(1+E(T))E(T)=1p+1q=1pq.