Chapter 14 Random Variables
14.1 Definitions
random variable: can assume any of several possible vaues based on a random event
discrete: a random variable that takes on a finite (or “countably infinite”) number of values
continuous: a random variable that takes on an (“uncountably”) infinite number of values over a given range
14.2 ‘Generic’ Discrete Probability Distribution
Consider the following ‘generic’ probability distribution table, where \(X\) is the score on the AP Stats exam and \(P(X)\) is the probability of a student receiving that score. The probabilities in this example were found using relative frequency (i.e. counting how many students got each score), not with a mathematical function.
As many of you know, AP exams are scored on a 1 to 5 scale, so there are exactly 5 possible values for \(X\).
\(X\) | \(P(X)\) |
---|---|
1 | 0.15 |
2 | 0.20 |
3 | 0.35 |
4 | 0.20 |
5 | ??? |
We know that all probabilities must be between 0 and 1 (or 0% to 100%). We also know that the probabilities of all possible value of \(X\) sum to 1 (100%), i.e. \(\sum P(X=x) = 1\).
My cousin went to Notre Dame, which would only accept a score of \(X=5\) for credit in their classes. We can find the missing probability:
\[P(X=5)= 1-(0.15+0.20+0.35+0.20) = 1-0.90=0.10\]
At Murray State, we typically accept a score of 3 or higher in order to grant credit for the AP course.
\[P(X \geq 3)=P(X=3)+P(X=4)+P(X=5)=0.35+0.20+0.10=0.65\]
Suppose we changed our policy and would only accept scores greater than 3.
\[P(X > 3)=P(X=4)+P(X=5)=0.20+0.10=0.30\]
The expected value (mean) of any discrete probability distribution can be computed as: \[\mu_X=E(X)=\sum x \times P(X=x)\]
\[\mu_X=E(X)=1(0.15)+2(0.20)+3(0.35)+4(0.20)+5(0.1)=2.9\]
The variance of any discrete probability distribution can be computed as: \[\sigma^2_X=Var(X)= \sum (x-\mu_X)^2 \times P(X=x)\]
\[\sigma^2_X=Var(X)=(1-2.9)^2 \times 0.15 + \cdots + (5-2.9)^2 \times 0.10 = 1.39\]
\[\sigma_X=SD(X)=\sqrt{1.39}=1.179\]
14.3 Expected Value of a Casino Game
One of the more basic casino games is roulette. One wager that can be made is to pick your ‘lucky’ number between \(1,2,\cdots,35,36\). Suppose ‘27’ is my lucky number and I wager one matchstick ($1) on ‘27’. I will be paid 35-to-1 and win $35 (35 matchsticks) if the number ‘27’ comes up when the wheel is spun and the ball drops into that slot.
If there are 36 numbered slots from \(1,2,\cdots,35,36\) and each slot is equall likely, we can compute the expected value of the game.
Outcome | \(X\) | \(P(X)\) |
---|---|---|
Win | 35 | \(\frac{1}{36}\) |
Lose | -1 | \(\frac{35}{36}\) |
\[E(X)=35 \times \frac{1}{36} + -1 \times \frac{35}{36}=\frac{35}{36}-\frac{35}{36}=0\]
When the expected value of a game is zero, it is said to be a fair game. Over the long run, we would expect to break even.
Obviously, casinos do not generally offer fair games, as they want to make a profit and they have expenses. In the actual game of roulette, there are actually 38 numbered slots, 1 through 36 and also ‘0’ and ‘00’, but you are still paid 35-to-1 for a win as if there were only 36 numbered slots.
Outcome | \(X\) | \(P(X)\) |
---|---|---|
Win | 35 | \(\frac{1}{38}\) |
Lose | -1 | \(\frac{37}{38}\) |
\[E(X)=35 \times \frac{1}{38} + -1 \times \frac{37}{38}=\frac{35}{38}-\frac{37}{38}=\frac{-2}{38}=-0.053\]
For every $1 or matchstick wagered, you expect to lose about $0.053. The ‘house edge’ is 5.3%.
14.4 Expected Value of Insurance
Insurance companies employ analysts known as actuaries, whose job is to evaluate risk and help the insurance companies determine how much to charge for premiums that they sell. Let’s consider a very simplified insurance scenario.
When I worked as a seasonal worker in Yellowstone National Park when I was a student, the seasonal workers all had an insurance policy (there was a small deduction from our paycheck for this policy) that would pay me (or my next-of-kin) a fixed amount if I were killed or disabled during the summer. A challenge for the actuaries is to accurately find the probabilities of events such as death, etc.
Outcome | \(X\) | \(P(X)\) |
---|---|---|
Death | $10000 | 0.001 |
Disability | $5000 | 0.002 |
Neither | 0 | 0.997 |
\[E(X)=10000 \times 0.001 + 5000 \times 0.002 + 0 \times 0.997 = 20\]
The insurance company would need to charge more than $20 for this policy in order to expect a profit.
While I didn’t do so, we could have computed the variance for the game of roulette or for our insurance policy. You would find that the variance is larger for insurance, as there are rare events (death or disability) with a large payout.
If your neighbor offered you $100 per year to insure his home, where you would have to pay to rebuild his home if it were destroyed in a fire but otherwise could keep the $100, would you do so?
Most people say ‘NO WAY’, because the risk of having to pay many thousands of dollars to rebuild the neighbor’s home is too much to take, and is not worth $100 to you. Insurance companies take on this risk for thousands of customers, and recoup the money paid out with the premiums collected from those of us that do not file a claim.
14.5 Let’s Make a Deal
Suppose you chose Door #1. The game show host shows you that there was a “goat” behind Door #3, but instead of giving you the option to switch to Door #2 (which we now know is the best option), he offers us $1000 to give up the door. If the car is worth $24,000, what is the expected value of keeping the door and turning down the cash?
Outcome | \(X\) | \(P(X)\) |
---|---|---|
Car | $24000 | \(\frac{1}{3}\) |
Goat | $0 | \(\frac{2}{3}\) |
\[E(X)=24000 \times \frac{1}{3} + 0 \times \frac{2}{3} = 8000\]
We see that from a purely mathematical aspect, we should turn down the $1000 and keep our “equity” with the door, even though most of the time we will lose.
Obviously from a psychological standpoint and from a practical standpoint, the higher the offer, the more likely most people are to take the “sure thing”. None of you were interested in an offer of $1 if the prize was a $24 gift certificate to a local restaurant.
People with high risk aversion are likely to take even small offers well below the expected value, whereas people with low risk aversion are likely to “gamble” and to try to win the big prize, even if the offer exceeds the expected value.
This can be rigorously quantified in economic theory with the utility function: a mathematical function that ranks alternatives according to their utility to an individual.