3 Mean and variance of a discrete probability distribution

If an experiment is performed N times in which the n possible outcomes X = x 1 , x 2 , x 3 , , x n are observed with frequencies f 1 , f 2 , f 3 , , f n respectively, we know that the mean of the distribution of outcomes is given by

x ̄ = f 1 x 1 + f 2 x 2 + + f n x n f 1 + f 2 + + f n = i = 1 n f i x i i = 1 n f i = 1 N i = 1 n f i x i = i = 1 n f i N x i

(Note that i = 1 n f i = f 1 + f 2 + + f n = N .)

The quantity f i N is called the relative frequency of the observation x i . Relative frequencies may be thought of as akin to probabilities; informally we would say that the chance of observing the outcome x i is f i N . Formally, we consider what happens as the number of experiments becomes very large. In order to give meaning to the quantity f i N we consider the limit (if it exists) of the quantity f i N as N . Essentially, we define the probability p i as

p i = lim N f i N

Replacing f i N with the probability p i leads to the following definition of the mean or expectation of the discrete random variable X .

Key Point 2

The Expectation of a Discrete Random Variable

Let X be a random variable with values x 1 , x 2 , , x n . Let the probability that X takes the value x i (i.e. P ( X = x i ) ) be denoted by p i . The mean or expected value or expectation of X , which is written E ( X ) is defined as:

E ( X ) = i = 1 n x i P ( X = x i ) = p 1 x 1 + p 2 x 2 + + p n x n

The symbol μ is sometimes used to denote E ( X ) .

The expectation E ( X ) of X is the value of X which we expect on average. In a similar way we can write down the expected value of the function g ( X ) as E [ g ( X ) ] , the value of g ( X ) we expect on average. We have

E [ g ( X ) ] = i n g ( x i ) f ( x i )

In particular if g ( X ) = X 2 , we obtain E [ X 2 ] = i n x i 2 f ( x i )

The variance is usually written as σ 2 . For a frequency distribution it is:

σ 2 = 1 N i = 1 n f i ( x i μ ) 2 where μ is the mean value

and can be expanded and ‘simplified’ to appear as:

σ 2 = 1 N i = 1 n f i x i 2 μ 2

This is often quoted in words:

The variance is equal to the mean of the squares minus the square of the mean.

We now extend the concept of variance to a random variable.

Key Point 3

The Variance of a Discrete Random Variable Let X be a random variable with values x 1 , x 2 , , x n . The variance of X , which is written V ( X ) is defined by

V ( X ) = i = 1 n p i ( x i μ ) 2
where μ E ( X ) . We note that V ( X ) can be written in the alternative form
V ( X ) = E ( X 2 ) [ E ( X ) ] 2
The standard deviation σ of a random variable is V ( X ) .
Example 6

A traffic engineer is interested in the number of vehicles reaching a particular crossroads during periods of relatively low traffic flow. The engineer finds that the number of vehicles X reaching the crossroads per minute is governed by the probability distribution:

x 0 1 2 3 4
P(X=x) 0.37 0.39 0.19 0.04 0.01
  1. Calculate the expected value, the variance and the standard deviation of the random variable X .
  2. Graph the probability distribution P ( X = x ) and the corresponding cumulative probability distribution F ( x ) = x i x P ( X = x i ) .
Solution
  1. The expectation, variance and standard deviation and cumulative probability values are calculated as follows:
    x x 2 P ( X = x ) F ( x )
    0 0 0.37 0.37
    1 1 0.39 0.76
    2 4 0.19 0.95
    3 9 0.04 0.99
    4 16 0.01 1.00

    E ( X ) = x = 0 4 x P ( X = x ) = 0 × 0.37 + 1 × 0.39 + 2 × 0.19 + 3 × 0.04 + 4 × 0.01 = 0.93 V ( X ) = E ( X 2 ) [ E ( X ) ] 2 = x = 0 4 x 2 P ( X = x ) x = 0 4 x P ( X = x ) 2 = 0 × 0.37 + 1 × 0.39 + 4 × 0.19 + 9 × 0.04 + 16 × 0.01 ( 0.93 ) 2 = 0.8051

    The standard deviation is given by σ = V ( X ) = 0.8973

  2. Figure 2

    No alt text was set. Please request alt text from the person who provided you with this resource.

Task!

Find the expectation, variance and standard deviation of the number of Heads in the three-coin toss experiment.

E ( X ) = 1 8 × 0 + 3 8 × 1 + 3 8 × 2 + 1 8 × 3 = 12 8 p i x i 2 = 1 8 × 0 2 + 3 8 × 1 2 + 3 8 × 2 2 + 1 8 × 3 2 = 1 8 × 0 + 3 8 × 1 + 3 8 × 4 + 1 8 × 9 = 3 V ( X ) = 3 2.25 = 0.75 = 3 4 σ = 3 2
Exercises
  1. A machine is operated by two workers. There are sixteen workers available. How many possible teams of two workers are there?
  2. A factory has 52 machines. Two of these have been given an experimental modification. In the first week after this modification, problems are reported with thirteen of the machines. What is the probability that both of the modified machines are among the thirteen with problems assuming that all machines are equally likely to give problems,?
  3. A factory has 52 machines. Four of these have been given an experimental modification. In the first week after this modification, problems are reported with thirteen of the machines. What is the probability that exactly two of the modified machines are among the thirteen with problems assuming that all machines are equally likely to give problems?
  4. A random number generator produces sequences of independent digits, each of which is as likely to be any digit from 0 to 9 as any other. If X denotes any single digit, find E ( X ) .
  5. A hand-held calculator has a clock cycle time of 100 nanoseconds; these are positions numbered 0 , 1 , , 99 . Assume a flag is set during a particular cycle at a random position. Thus, if X is the position number at which the flag is set.

    P ( X = k ) = 1 100 k = 0 , 1 , 2 , , 99.

    Evaluate the average position number E ( X ) , and σ , the standard deviation.

    (Hint: The sum of the first k integers is k ( k + 1 ) 2 and the sum of their squares is:

    k ( k + 1 ) ( 2 k + 1 ) 6. )

  6. Concentric circles of radii 1 cm and 3 cm are drawn on a circular target radius 5 cm. A darts player receives 10, 5 or 3 points for hitting the target inside the smaller circle, middle annular region and outer annular region respectively. The player has only a 50-50 chance of hitting the target at all but if he does hit it he is just as likely to hit any one point on it as any other. If X = ‘number of points scored on a single throw of a dart’ calculate the expected value of X .
  1. The required number is

    16 2 = 16 × 15 2 × 1 = 120.

  2. There are

    52 13

    possible different selections of 13 machines and all are equally likely. There is only

    2 2 = 1

    way to pick two machines from those which were modified but there are

    50 11

    different choices for the 11 other machines with problems so this is the number of possible selections containing the 2 modified machines.

    Hence the required probability is

    2 2 50 11 52 13 = 50 11 52 13 = 50 ! ( 11 ! 39 ! ) 52 ! ( 13 ! 39 ! ) = 50 ! 13 ! 52 ! 11 ! = 13 × 12 52 × 51 0.0588

    Alternatively, let S be the event “first modified machine is in the group of 13” and C be the event “second modified machine is in the group of 13”. Then the required probability is

    P ( S ) × P ( C S ) = 13 52 × 12 51 .

  3. There are 52 13  different selections of 13, 4 2  different choices of two modified machines

     and 48 11  different choices of 11 non-modified machines.

    Thus the required probability is

    4 2 48 11 52 13 = ( 4 ! 2 ! 2 ! ) ( 48 ! 11 ! 37 ! ) ( 52 ! 13 ! 39 ! ) = 4 ! 48 ! 13 ! 39 ! 52 ! 2 ! 2 ! 11 ! 37 ! = 4 × 3 × 13 × 12 × 39 × 38 52 × 51 × 50 × 49 × 2 0.2135

    Alternatively, let I ( i ) be the event “modified machine i is in the group of 13” and O ( i )

    be the negation of this, for i = 1 , 2 , 3 , 4. The number of choices of two modified machines is

    4 2

    so the required probability is

    4 2 P { I ( 1 ) } × P { I ( 2 ) I ( 1 ) } × P { O ( 3 ) I ( 1 ) , I ( 2 ) } × P { O ( 4 ) I ( 1 ) I ( 2 ) O ( 3 ) }

    = 4 2 13 52 × 12 51 × 39 50 × 38 49

    = 4 × 3 × 13 × 12 × 39 × 38 52 × 51 × 50 × 49 × 2

  4. x 0 1 2 3 4 5 6 7 8 9
    P ( X = x ) 1 10 1 10 1 10 1 10 1 10 1 10 1 10 1 10 1 10 1 10

    E ( X ) = 1 10 { 0 + 1 + 2 + 3 + + 9 } = 4.5

  5. Same as Q.4 but with 100 positions

    E ( X ) = 1 100 { 0 + 1 + 2 + 3 + + 99 } = 1 100 99 ( 99 + 1 ) 2 = 49.5

    σ 2 = mean of squares square of means

    σ 2 = 1 100 [ 1 2 + 2 2 + + 9 9 2 ] ( 49.5 ) 2 = 1 100 [ 99 ( 100 ) ( 199 ) ] 6 49 . 5 2 = 833.25

    so the standard deviation is σ = 833.25 = 28.87

  6. X can take 4 values 0, 3, 5 or 10

       P ( X = 0 ) = 0.5 [only 50/50 chance of hitting target]

      The probability that a particular points score is obtained is related to the areas of the annular

      regions which are, from the centre: π , ( 9 π π ) = 8 π , ( 25 π 9 π ) = 16 π

    P ( X = 3 ) = P [ ( 3 is scored ) ( target is hit ) ] = P ( 3 is scored | target is hit ) × P ( target is hit ) = 16 π 25 π . 1 2 = 16 50 P ( X = 5 ) = P ( 5 is scored | target is hit ) × P ( target is hit ) = 8 π 25 π . 1 2 = 8 50 P ( X = 10 ) = P ( 10 is scored | target is hit ) × P ( target is hit ) = π 25 π . 1 2 = 1 50

    x 0 3 5 10
    P ( X = x ) 25 50 16 50 8 50 1 50

    E ( X ) = 48 + 40 + 10 50 = 1 . 96 .