18 Expected Value
- The distribution of a random variable specifies the possible values and the probability of any event that involves the random variable.
- Characteristics of distributions based on long run averages can be defined as “expected” values.
Example 18.1 Recall the matching problem with
0 | 9/24 |
1 | 8/24 |
2 | 6/24 |
4 | 1/24 |
- The table below displays 10 simulated values of
. How could you use the results of this simulation to approximate the long run average value of ? How could you get a better approximation of the long run average?
Repetition | Y |
---|---|
1 | 0 |
2 | 1 |
3 | 0 |
4 | 0 |
5 | 2 |
6 | 0 |
7 | 1 |
8 | 1 |
9 | 4 |
10 | 2 |
Rather than adding the 10 values and dividing by 10, how could you simplify the calculation in the previous part?
The table below summarizes 24000 simulated values of
. Approximate the long run average value of .
Value of X | Number of repetitions |
---|---|
0 | 8979 |
1 | 7993 |
2 | 6068 |
4 | 960 |
Recall the distribution of
. What would be the corresponding mathematical formula for the theoretical long run average value of ? This number is called the “expected value” of .
Is the expected value the most likely value of
?
Is the expected value of
the “value that we would expect” on a single repetition of the phenomenon?
Explain in what sense the expected value is “expected”.
- The expected value (a.k.a. expectation a.k.a. mean), of a random variable
defined on a probability space with measure , is a number denoted representing the probability-weighted average value1 of . - Note well that
represents a single number. - The expected value is the “balance point” (center of gravity) of a distribution.
- The expected value of a random variable
is defined by the probability-weighted average according to the underlying probability measure. But the expected value can also be interpreted as the long-run average value, and so can be approximated via simulation. - Read the symbol
as- Simulate lots of values of what’s inside
- Compute the average. This is a “usual” average; just sum all the simulated values and divide by the number of simulated values.
- Simulate lots of values of what’s inside
Example 18.2 Model the waiting time, measured continuously in hours, from now until the next earthquake (of any magnitude) occurs in southern CA as a continuous random variable
Compute and interpret
.
Compute
.
Compute
.
Find the median value (50th percentile) of
. Is the median less than, greater than, or equal to the mean? Why does this make sense?
What does the variable
represent? What is ? What is the distribution of ?
Example 18.3 Recall Example 14.3 in which we assume that
Recall from Example 14.3 that
. Evaluate the pmf for and use arithmetic to compute . (This will technically only give an approximation, since there is non-zero probability that , but the calculation will give you a concrete example before jumping to the next part.)
Use the pmf and infinite series to compute
.
Interpret
in context.
18.1 “Law of the unconscious statistician” (LOTUS)
Example 18.4 Flip a coin 3 times and let
Find the distribution of
.
Compute
.
How could we have computed
without first finding the distribution of ?
Is
equal to ?
- A function of a random variable is a random variable: if
is a random variable and is a function then is a random variable. - Since
is a random variable it has a distribution. In general, the distribution of will have a different shape than the distribution of . - The “law of the unconscious statistician” (LOTUS) says that the expected value of a transformed random variable can be found without finding the distribution of the transformed random variable, simply by applying the probability weights of the original random variable2 to the transformed values.
- LOTUS says we don’t have to first find the distribution of
to find ; rather, we just simply apply the transformation to each possible value of and then apply the corresponding weight for to . - Whether in the short run or the long run, in general
- In terms of expected values, in general
The left side is what we typically want and represents first transforming the values and then averaging the transformed values. (The right side represents first averaging the values and then plugging the average (a single number) into the transformation formula, but this doesn’t yield a meaningful value.) - The exception is linear rescalings: If
is a random variable and are non-random constants then
Example 18.5 Consider a simple electrical circuit with just a single 1 ohm resistor. Suppose a random voltage
Assume that
has a Uniform(0, 20) distribution. Use LOTUS to compute .
Use simulation to approximate the distribution of
; is it Uniform?
It can be shown that
has pdf Compute .
Now suppose we want to find
if has an Exponential distribution with mean 10. Donny Dont says: “I can just use LOTUS and replace with , so is ”. Do you agree? Explain.
- Remember, do NOT confuse a random variable with its distribution.
- The random variable is the numerical quantity being measured
- The distribution is the long run pattern of variation of many observed values of the random variable
18.2 Linearity of expected value
Example 18.6 Let
- Linearity of expected value. For any two random variables
and , - That is, the expected value of the sum is the sum of expected values, regardless of how the random variables are related.
- Therefore, you only need to know the marginal distributions of
and to find the expected value of their sum. (But keep in mind that the distribution of will depend on the joint distribution of and .) - Whether in the short run or the long run,
regardless of the joint distribution of and . - A linear combination of two random variables
and is of the form where and are non-random constants. Combining properties of linear rescaling with linearity of expected value yields the expected value of a linear combination. - Linearity of expected value extends naturally to more than two random variables.
Example 18.7 Recall the matching problem in Example 18.1. When
Let
be the indicator that object 1 is placed correctly in spot 1; that is is object 1 is placed in spot 1, and otherwise. Find .
When
, find for .
What is the relationship between the random variables
and ?
Use the previous parts to find
.
Now consider a general
. Let be the indicator that object is placed correctly in spot , . Find .
Find
. Be amazed.
Interpret
is context.
- Random variables that only take two possible values, 0 and 1, are called indicator (or Bernoulli) random variables.
- Indicators provide the bridge between events (sets) and random variables (functions). A realization of any event is either true or false; the event either happens or it doesn’t. An indicator random variable just translates “true” or “false” into numbers, 1 for “true” and 0 for “false”.
- Indicators also provide a bridge between expected value and probability. If
is the indicator of event , then - Representing a count as a sum of indicator random variables is a very common and useful strategy, especially in problems that involve “find the expected number of…”
- Let
be a collection of events. Suppose event occurs with marginal probability . Let be the random variable which counts the number of the events in the collection which occur. Then the expected number of events that occur is the sum of the event probabilities. If each event has the same probability, , then is equal to . These formulas for the expected number of events are true regardless of whether there is any association between the events (that is, regardless of whether the events are independent.)
Remember, the pmf or pdf is 0 outside the range of possible values, so when working problems the generic bounds of
should be replaced by the possible values of .↩︎Remember, the pmf or pdf is 0 outside the range of possible values, so when working problems the generic bounds of
should be replaced by the possible values of .↩︎