Expectation (LOTUS)
The expectation of a random variable represents its probability-weighted average value. The generalized expectation function can be given by the Law of the Unconscious Statistician (LOTUS):
The expectation of a discrete random variable with a range , where , is generally defined as,
Similarly, the expectation of a continuous random variable is defined as
Intuition
The expectation can be seen as the average or mean of a probability distribution. It is the most expected value given all probabilities.
Properties
(Linearity) Any satisfy
The linearity of expectation can be proved by taking (sum to one rule). Then taking the definition of a random variable, we get:
Then, for random variables and ,
Why does the probability not change with the amount of variables? Well, because we simplify each event into . All of the above stems from this simple fact, since by the definition of the random variable, \set{\upomega \in \Upomega : X(\upomega) = a} and . From there, we replace with , and therefore with .
(Tail Formula) Any satisfies
For a random variable that takes values , each with probability ,
(Independence) If and are independent, then .
(Conditionality)
(Iterated/Total Expectation)
(Wald’s Identity) If , then .
(Jensen’s Inequality) Any convex satisfies .
Examples
(Expectation, Indicator Variables) Connecting Ropes
You have identical lengths of rope, each with two loose ends. You toss all ropes into a bag, swirl them around, then–without looking–pull out two ends and tie them together.
What is the probability that the two ends you just tied belong to the same rope? Before grabbing any rope, we have possible ends to grab. After grabbing the first end, we grab another one of the ends. This gives us possible outcomes for grabbing two random ends.
Consider the possibility of grabbing the same rope. Before grabbing any end, we can blindly pick any one of the ropes. However, after we grab our first end, there is exactly way of grabbing the other end of the same rope. Therefore, there are exactly ways of grabbing the same rope. This makes intuitive sense: you can grab either ends of the same rope in the beginning, and then grab the second end. Therefore, we have:
If you continue this process until all ends are connected, what is the expected total number of times you ever tie the two ends of the same rope together?
Consider the following indicator variable:
1 & \text{the two ends of rope } i \text{ are paired}, \
0 & \text{otherwise,}
\end{cases}$$
where for all . Then, is the number of self-loops after all ends have been tied. As such,
What is the expected number of total loops after there are no loose ends left? loose ends and immediately tie 2 ends, yielding loose ends. We proceed until there are no loose ends left. Let represent the number of total loops given ropes.
We start with
(Iterated Expectation) Dice Game
You roll a dice. For each roll, you are paid the face value. If a roll gives 4, 5, or 6, you can roll the dice again. Once you get 1, 2, or 3, the game stops.
What is the expected payoff of this game? be your cumulative expected payoff in round , and let be an indicator variable showing the outcome of your last throw (i.e., whether you rolled 4, 5, 6 or not). Then,
Let
\mathbb{E}(X)&=\mathbb{E}(\mathbb{E}(X \mid C)) \
&=\frac{1}{2} \cdot \mathbb{E}(X \mid C=0) + \frac{1}{2} \cdot \mathbb{E}(X \mid C=1) \
&= \frac{1}{2} \cdot \frac{1+2+3}{3}+\frac{1}{2} \cdot \left(\frac{4+5+6}{3}+\mathbb{E}(X)\right) \
&= 7.
\end{align}$$
We add to our payoff on the right hand side, since you continue playing if you roll 4, 5, or 6 for an indefinite amount of time.
Ace Hunt
Ace Hunt is a solo “table game” played with a freshly shuffled 52-card deck placed face-down in the center. You (the dealer) turn over cards one at a time into a single community pile, pausing only when the very first Ace appears; at that moment the hand ends and the total number of cards revealed is recorded. The person whose guess is closest to the recorded number of total cards wins.
What is the probability that you will need to turn over exactly cards before revealing the first Ace? Let denote the even that the -th card turned over is an Ace. Then,
What is the expected number of cards you must expose to see the first Ace? as the number of cards turned over before the first ace. Then, (since there are at most 48 non-Ace cards drawn before the first ace, where
Denote
1 & \text{i-th card is not an Ace} \
0 & \text{otherwise}.
\end{cases}$$
Coupon Collector
Let there be distinct coupon types, labeled . You collect coupons from cereal boxes one at a time; on each trial you receive exactly one coupon, and each type is always equally likely.
If you want to collect a complete set of coupons with at least one of each type, how many boxes on average are needed to complete the set? represent the number of additional (marginal) draws needed to collect the -th coupon type after types have been collected. Then, is the total number of coupons needed for all coupon types to be collected.
Let
Given that coupons are collected, a new coupon will be a different type with probability . Since each is a first-success measure, . As such,
If you have collected coupons, what is the expected number of distinct coupon types? Let represent the present coupon types, such that indicates whether the -th coupon type is present. The probability of a coupon type that is NOT the -th type is exactly , and therefore indicates that in the sequence of draws, the -th coupon does not appear once. We can express as a sum of , such that