Page 499 - Discrete Mathematics and Its Applications
P. 499

478  7 / Discrete Probability


                                                when a coin is flipped 100 times? What is the expected number of comparisons used to find an
                                                element in a list using a linear search? To study such questions we introduce the concept of the
                                                expected value of a random variable.

                              DEFINITION 1       The expected value, also called the expectation or mean, of the random variable X on the
                                                 sample space S is equal to


                                                     E(X) =     p(s)X(s).
                                                             s∈S
                                                 The deviation of X at s ∈ S is X(s) − E(X), the difference between the value of X and the
                                                 mean of X.


                                                Note that when the sample space S has n elements S ={x 1 ,x 2 ,...,x n }, E(X) =
                                                  n
                                                  i=1  p(x i )X(x i ).
                                                Remark: When there are infinitely many elements of the sample space, the expectation is de-
                                                fined only when the infinite series in the definition is absolutely convergent. In particular, the
                                                expectation of a random variable on an infinite sample space is finite if it exists.


                                 EXAMPLE 1      Expected Value of a Die  Let X be the number that comes up when a fair die is rolled. What
                                                is the expected value of X?

                                                Solution: The random variable X takes the values 1, 2, 3, 4, 5, or 6, each with probability 1/6.
                                                It follows that
                                                            1     1      1      1     1      1      21   7
                                                    E(X) =   · 1 +  · 2 +  · 3 +  · 4 +  · 5 +  · 6 =  =  .                    ▲
                                                            6     6      6      6     6      6      6    2
                                 EXAMPLE 2      A fair coin is flipped three times. Let S be the sample space of the eight possible outcomes, and
                                                let X be the random variable that assigns to an outcome the number of heads in this outcome.
                                                What is the expected value of X?

                                                Solution: In Example 10 of Section 7.2 we listed the values of X for the eight possible outcomes
                                                when a coin is flipped three times. Because the coin is fair and the flips are independent, the
                                                probability of each outcome is 1/8. Consequently,

                                                            1
                                                    E(X) =   [X(HHH) + X(HHT) + X(HTH) + X(THH) + X(TTH)
                                                            8
                                                            + X(THT) + X(HTT) + X(TTT)]
                                                            1                               12
                                                         =   (3 + 2 + 2 + 2 + 1 + 1 + 1 + 0) =
                                                            8                               8
                                                            3
                                                         =   .
                                                            2
                                                Consequently, the expected number of heads that come up when a fair coin is flipped three times
                                                is 3/2.                                                                        ▲

                                                    When an experiment has relatively few outcomes, we can compute the expected value of
                                                a random variable directly from its definition, as was done in Example 2. However, when an
                                                experiment has a large number of outcomes, it may be inconvenient to compute the expected
                                                value of a random variable directly from its definition. Instead, we can find the expected value
   494   495   496   497   498   499   500   501   502   503   504