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,F⁢S,F⁢F⁢S,F⁢F⁢F⁢S,…}.

If, for example, the sequence F⁢F⁢F⁢F⁢S occurs then random variable R⁢(F⁢F⁢F⁢F⁢S)=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 R∼Geometric⁢(θ).

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 F⁢F⁢F⁢F⁢S.

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

The rv R∼Geometric⁢(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=0∞pR⁢(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=0∞pR⁢(r) = ∑r=0∞(1-θ)r⁢θ
= θ⁢∑r=0∞(1-θ)r
= θ⁢11-(1-θ)=1.
Example 5.17.

For a general R∼Geometric⁢(θ), find P(R≥r).

Solution.
P(R≥r) = ∑s=r∞pR⁢(s)
= ∑s=r∞(1-θ)s⁢θ
= (1-θ)r⁢θ⁢∑s=r∞(1-θ)s-r
= (1-θ)r⁢θ⁢∑s′=0∞(1-θ)s′ setting 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=0∞r⁢pR⁢(r)
= 0+∑r=1∞r⁢(1-θ)r⁢θ
= (1-θ)⁢θ⁢∑r=1∞r⁢(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=0∞r⁢(r-1)⁢pR⁢(r)
= ∑r=0∞r⁢(r-1)⁢(1-θ)r⁢θ
= (1-θ)2⁢θ⁢∑r=2∞r⁢(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 R∼Geometric⁢(θ) pR⁢(r) = (1-θ)rθ for r=0,1,2,,… pR⁢(r) = 0 otherwise E⁢(R) = 1-θθ Var⁢(R) = 1-θθ2