Guozhen AIGlobal AI field notes and model intelligence

English translation

Die face values

Published:

Category: Probability for Beginners

Read time: 4 min

Reads: 0

Lesson #11Views are counted together with the original Chinese articleImages are preserved from the source page

Conceptual Diagram of Expected Value

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.

Expected Value Verification Chart

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:

Expected Value Decision Card

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.

E[X]=ixiP(X=xi)E[X] = \sum_{i} x_i P(X = x_i)

For a continuous random variable, the expected value is given by:

E[X]=xf(x)dxE[X] = \int_{-\infty}^{\infty} x f(x) \, dx

where f(x)f(x) 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:

Probability Reading Map Card

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.

Var(X)=E[(XE[X])2]=E[X2](E[X])2\mathrm{Var}(X) = E[(X - E[X])^2] = E[X^2] - (E[X])^2

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 XX denote the number shown on the die. Its possible values are 1,2,3,4,5,61, 2, 3, 4, 5, 6, each occurring with probability 16\frac{1}{6}.

Computing the Expected Value

Using the expected value formula:

E[X]=i=16iP(X=i)=116+216+316+416+516+616E[X] = \sum_{i=1}^{6} i \cdot P(X = i) = 1 \cdot \frac{1}{6} + 2 \cdot \frac{1}{6} + 3 \cdot \frac{1}{6} + 4 \cdot \frac{1}{6} + 5 \cdot \frac{1}{6} + 6 \cdot \frac{1}{6}

Simplifying:

E[X]=1+2+3+4+5+66=216=3.5E[X] = \frac{1 + 2 + 3 + 4 + 5 + 6}{6} = \frac{21}{6} = 3.5

Computing the Variance

Next, compute the variance:

  1. First compute E[X2]E[X^2]:
E[X2]=i=16i2P(X=i)E[X^2] = \sum_{i=1}^{6} i^2 \cdot P(X = i) E[X2]=16(12+22+32+42+52+62)=916E[X^2] = \frac{1}{6}(1^2 + 2^2 + 3^2 + 4^2 + 5^2 + 6^2) = \frac{91}{6}
  1. Then apply the variance formula:
Var(X)=E[X2](E[X])2\mathrm{Var}(X) = E[X^2] - (E[X])^2 Var(X)=916(72)2=916494=70242.917\mathrm{Var}(X) = \frac{91}{6} - \left(\frac{7}{2}\right)^2 = \frac{91}{6} - \frac{49}{4} = \frac{70}{24} \approx 2.917

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 Y=E[XZ]Y = E[X \mid Z] denote the conditional expectation of XX given another random variable ZZ. A key identity simplifies such computations:

E[E[XZ]]=E[X]E[E[X \mid Z]] = E[X]

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}")

Application Review Card for “Computing Expected Values and the Expected Value of Variance”

If you haven’t fully internalized “Computing Expected Values and the Expected Value of Variance”, walk through the four actions on this card again.

Application Check Card for “Computing Expected Values and the Expected Value of Variance”

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

Keep reading from here

Browse English site

Reader Messages

Reader messages

Questions, corrections, extra sources, or hands-on results can be left here. No login is required.

Max 800 characters

To reduce spam, each message is checked for length, link count, and posting frequency.

0/800

Messages

0 messages
Loading messages...