English translation
Die face values
The expected value is the long-run average weighted by probabilities—it need not be an outcome that actually occurs in any single trial. It serves well to measure overall central tendency.
I multiply each possible value by its corresponding probability. Omitting probability weights yields an ordinary average—not the expected value.
In the previous section, we explored the geometric distribution and its applications. Now, we delve deeper into computing expected values and variances—particularly the expected value of variance—across diverse scenarios. This material is essential for understanding random variable behavior and how it evolves over time.
Definition of Expected Value
In probability theory, the expected value (also called the mean) represents the weighted average of a random variable’s possible outcomes over many trials. For a discrete random variable, the expected value is computed as:
When learning about expected value, first list all possible values of the random variable along with their associated probabilities; then compute the weighted sum using those probabilities.
For a continuous random variable, the expected value is given by:
where is the probability density function.
Relationship Between Variance and Expected Value
Variance quantifies how spread out the values of a random variable are. It is defined as:
The article “Computing Expected Values and the Expected Value of Variance” can be read through four lenses: scenario, concept, action, and outcome. First align these four elements; then revisit the parameters, code, or workflows in the main text.
As shown above, variance is intrinsically tied to the expected value.
Computing Expected Values and Variances
1. Example: Rolling a Fair Die
Suppose we roll a fair six-sided die. The expected value and variance are computed as follows:
- Let random variable denote the number shown on the die. Its possible values are , each occurring with probability .
Computing the Expected Value
Using the expected value formula:
Simplifying:
Computing the Variance
Next, compute the variance:
- First compute :
- Then apply the variance formula:
2. The Expected Value of an Expected Value
In problems involving the expected value of an expected value, we often examine how expectations behave under varying conditions. For instance, let denote the conditional expectation of given another random variable . A key identity simplifies such computations:
This law—often called the law of total expectation—is crucial for handling conditionally dependent random variables and appears frequently in Bayesian statistics.
Sample Code: Python Implementation
We can perform the above calculations in Python:
import numpy as np
# Die face values
point_values = np.array([1, 2, 3, 4, 5, 6])
probabilities = np.array([1/6] * 6)
# Compute expected value
E_X = np.sum(point_values * probabilities)
print(f"Expected value E[X]: {E_X}")
# Compute E[X^2]
E_X2 = np.sum(point_values**2 * probabilities)
# Compute variance
Var_X = E_X2 - E_X**2
print(f"Variance Var(X): {Var_X}")
If you haven’t fully internalized “Computing Expected Values and the Expected Value of Variance”, walk through the four actions on this card again.
When revisiting “Computing Expected Values and the Expected Value of Variance”, avoid tackling large projects at once. Instead, start with one simple example to verify whether the core logic is clear.
Conclusion
In this section, we learned how to compute the expected value and variance of a random variable—and especially how to leverage expected values to derive variance properties. Through repeated exploration and calculation across varied examples, we gain deeper insight into distributional characteristics and behavioral patterns of random variables. In the next section, we’ll explore further properties of variance—stay tuned for more discoveries in the fascinating world of probability theory!
Continue