Home page for accesible maths 5 Models for discrete random variables

Style control - access keys in brackets

Font (2 3) - + Letter spacing (4 5) - + Word spacing (6 7) - + Line spacing (8 9) - +

5.5 Geometric random variables

Consider an experiment based on independent Bernoulli trials, each with the probability of a success being θ. Now define the variable of interest, R, to be the number of trials up to BUT NOT including the first success. Here the induced sample space is 𝒮={0,1,2,}, and is infinite, corresponding to outcomes in the original sample space

Ω={S,FS,FFS,FFFS,}.

If, for example, the sequence FFFFS occurs then random variable R(FFFFS)=4.

Such a random variable is called a Geometric random variable, examples of which include:

  • the number of heads of a coin toss before the first tail,

  • the number of boys born before the first girl,

  • the number of black cars passed before a red car,

  • the number of years to pass before the Scotland football team qualify for anything.

We say RGeometric(θ).

Exercise 5.14.

Use the independence of the Bernoulli random variables to derive the pmf of the geometric random variable. Hint: R=4 corresponds to the sample point FFFFS.

Solution.
pR(r) = P(R=r)=P({FFFrS})
= P(F)P(F)P(F)P(S)indep
= (1-θ)rθ for r=0,1,2,
Exercise 5.15.

The rv RGeometric(0.3). Use R to evaluate and plot the pmf of R for r=0,1,2,,5, with the commands

dgeom(0:5,prob=0.3)
dgeom(0:5,prob=0.4)
            # Note how the probabilities change
barplot( dgeom(0:5,prob=0.4),names.arg=c(0:5) )

Repeat with θ=0.4 and plot.

Exercise 5.16.

Verify that r=0pR(r)=1 for the geometric pmf. This requires the mathematical formulae for sums of geometric type series given at the start of this chapter.

Solution.
r=0pR(r) = r=0(1-θ)rθ
= θr=0(1-θ)r
= θ11-(1-θ)=1.
Example 5.17.

For a general RGeometric(θ), find P(Rr).

Solution.
P(Rr) = s=rpR(s)
= s=r(1-θ)sθ
= (1-θ)rθs=r(1-θ)s-r
= (1-θ)rθs=0(1-θ)ssetting s=s-r
= (1-θ)rθ11-(1-θ)
= (1-θ)r

Note that this is simply the probability that the first r Bernoulli trials are all F.

Example 5.18.

Find E(R) and Var(R) for a geometric random variable.

We need to use the basic identities from Section 5.1 on page 5.1.

Solution.
E(R) = r=0rpR(r)
= 0+r=1r(1-θ)rθ
= (1-θ)θr=1r(1-θ)r-1
= (1-θ)θ[(1-(1-θ))-2]
= 1-θθ.

Now to find Var(R) we begin by calculating E[R(R-1)]:

E[R(R-1)] = r=0r(r-1)pR(r)
= r=0r(r-1)(1-θ)rθ
= (1-θ)2θr=2r(r-1)(1-θ)r-2
= (1-θ)2θ2(1-(1-θ))-3
= 2(1-θ)2θ2

This is then plugged in to get

Var(R) = E[R(R-1)]+E[R]-(E[R])2
= 2(1-θ)2θ2+1-θθ-(1-θθ)2
= (1-θ)2+(1-θ)θθ2
= 1-θθ2

Yuck!

Note that as the Bernoulli probability θ0 then the expected number of trials (and the variance) goes to . To summarise

For a geometric random variable RGeometric(θ) pR(r) = (1-θ)rθ for r=0,1,2,, pR(r) = 0otherwise E(R) = 1-θθ Var(R) = 1-θθ2