10.4: Discrete Random Variables
Let \((S,P)\) be a probability space and let \(X:S \rightarrow \mathbb{R}\) be any function that maps the outcomes in \(S\) to real numbers (all values allowed, positive, negative and zero). We call \(X\) a random variable . The quantity \(\sum_{x \in S} X(x)P(x)\), denoted \(E(X)\), is called the expectation (also called the mean or expected value ) of the random variable \(X\). As the suggestive name reflects, this is what one should expect to be the average behavior of the result of repeated Bernoulli trials.
Note that since we are dealing only with probability spaces \((S,P)\) where \(S\) is a finite set, the range of the probability measure \(P\) is actually a finite set. Accordingly, we can rewrite the formula for \(E(X)\) as \(\sum_{y} y \cdot [rpb(X(x) = y)\), where the summation extends over a finite range of values for \(y\).
For the spinner shown in Figure 10.1 , let \(X(i)=i^2\) where \(i\) is the number of the region. Then
\(E(x) = \displaystyle \sum_{i \in S} i^2P(i) = 1^2 \dfrac{1}{8} + 2^2 \dfrac{2}{8} + 3^2 \dfrac{1}{8} + 4^2 \dfrac{1}{8} + 5^2 \dfrac{3}{8} = \dfrac{109}{8}\).
Note that \(109/8=13.625\). The significance of this quantity is captured in the following statement. If we record the result from the spinner \(n\) times in succession as \((i_1,i_2,…,i_n)\) and Xing receives a prize worth \(i_j^2\) for each \(j=1,2,…,n\)), then Xing should “expect” to receive a total prize worth \(109n/8=13.625n\). Bob asks how this statement can possibly be correct, since \(13.625n\) may not even be an integer, and any prize Xing receives will have integral value. Carlos goes on to explain that the concept of expected value provides a formal definition for what is meant by a fair game. If Xing pays 13.625 cents to play the game and is then paid \(i^2\) pennies where i is the number of the region where the spinner stops, then the game is fair. If he pays less, he has an unfair advantage, and if he pays more, the game is biased against him. Bob says “How can Xing pay 13.625 pennies?” Brushing aside Bob's question, Carlos says that one can prove that for every \(ϵ>0\), there is some \(n_0\) (which depends on \(ϵ\)) so that if \(n>n_0\), then the probability that Xing's total winnings minus \(13.625n\), divided by \(n\) is within \(ϵ\) of 13.625 is at least \(1−ϵ\). Carlos turns to Dave and explains politely that this statement gives a precise meaning of what is meant by “close” and “large”.
For Alice's game from the start of the chapter, \(S=\{0,1,2,3,4,5\}\), we could take \(X\) to be the function defined by \(X(d)=2−d\). Then \(X(d)\) records the amount that Bob wins when the difference is \(d\) (a negative win for Bob is just a win for Alice in the same amount). We calculate the expectation of \(X\) as follows:
\(E(X) = \displaystyle \sum_{d=0}^5 X(d)p(d) = -2 \dfrac{1}{6} - 1 \dfrac{10}{36} + 0 \dfrac{8}{36} + 1 \dfrac{6}{36} + 2 \dfrac{4}{36} + 3236 = \dfrac{-2}{36}\).
Note that \(−2/36=−.055555….\) So if points were dollars, each time the game is played, Bob should expect to lose slightly more than a nickel. Needless to say, Alice likes to play this game and the more times Bob can be tricked into playing, the more she likes it. On the other hand, by this time in the chapter, Bob should be getting the message and telling Alice to go suck a lemon.
10.4.1 The Linearity of Expectation
The following fundamental property of expectation is an immediate consequence of the definition, but we state it formally because it is so important to discussions to follow.
Let \((S,P)\) be a probability space and let \(X_1,X_2,…,X_n\) be random variables. Then
\(E(X_1 + X_2 + \cdot \cdot \cdot + X_t) = E(X_1) + E(X_2) + \cdot \cdot \cdot + E(X_n)\).
10.4.2 Implications for Bernoulli Trials
Consider a series of \(n\) Bernoulli trials with \(p\), the probability of success, and let \(X\) count the number of successes. Then, we claim that
\(E(X) = \displaystyle \sum_{i=0}^n i \dbinom{n}{i} p^i(1-p)^{n-i} = np\)
To see this, consider the function \(f(x)=[px+(1−p)]^n\). Taking the derivative by the chain rule, we find that \(f′(x)=np[px+(1−p)]^{n−1}\). Now when \(x=1\), the derivative has value \(np\).
On the other hand, we can use the binomial theorem to expand the function \(f\).
\(f(x) = \displaystyle \sum_{i=0}^n \dbinom{n}{i} x^ip^i(1-p)^{n-i}\)
It follows that
\(f'(x) = \displaystyle \sum_{i=0}^n i \dbinom{n}{i} x^{i-}p^i(1-p)^{n-i}\)
And now the claim follows by again setting \(x=1\). Who says calculus isn't useful!
Many states have lotteries to finance college scholarships or other public enterprises judged to have value to the public at large. Although far from a scientific investigation, it seems on the basis of our investigation that many of the games have an expected value of approximately fifty cents when one dollar is invested. So the games are far from fair, and no one should play them unless they have an intrinsic desire to support the various causes for which the lottery profits are targeted.
By contrast, various games of chance played in gambling centers have an expected return of slightly less than ninety cents for every dollar wagered. In this setting, we can only say that one has to place a dollar value on the enjoyment derived from the casino environment. From a mathematical standpoint, you are going to lose. That's how they get the money to build those exotic buildings.