Random Variables
The main reading rule is: D describes the distribution, and z ∼ D describes the relationship between the variable z and that distribution.
From Distribution to Sample
Random-variable notation becomes easier when you read it from the distribution outward. Start with D: it names a probability distribution over a set Z. Then read z ∼ D as a sampling statement: z is obtained by sampling according to D. The symbol z does not identify one permanently fixed value. It represents a value whose source is the distribution D.
The main reading rule is: D describes the distribution, and z ∼ D describes the relationship between the variable z and that distribution.
Reading D and z ∼ D
Imagine that D describes how values are selected from a set Z. Writing z ∼ D tells you to regard z as a value obtained by sampling from D. It does not select one permanently fixed value in advance. Instead, it establishes a sampling convention that later expressions can use.
Following the Sampling Convention
Suppose D is a distribution over a set Z, and write z ∼ D. What does a later expression involving z mean?
- 11. Identify D
D is the distribution that governs how values are selected from Z.
- 22. Interpret z ∼ D
The variable z is regarded as a value sampled according to D.
- 33. Use z later
A later function, event, or expectation involving z is evaluated with respect to that sampling convention.
The notation does not describe a fixed value of z. It describes where z comes from and which distribution governs reasoning about it.
Two Questions About a Sample
Once z is understood as sampled from D, later notation can ask different kinds of questions. Expected-value notation summarizes a real-valued function of the sampled variable. Probability notation for an event summarizes how often a Boolean condition is true.
| Notation | What it describes | What to ask |
|---|---|---|
| E_{z ∼ D}[f(z)] | The expected value of a real-valued function of z | What value does f(z) summarize on average under D? |
| Pr_{z ∼ D}[f(z)] | The probability that a Boolean condition is true | How often is the condition f(z) true under D? |
Both expressions use the same sampling context, but they summarize different kinds of information.
Separating an Average from an Event
Read the difference between E_{z ∼ D}[f(z)] and Pr_{z ∼ D}[f(z)].
- 1Expected value
In E_{z ∼ D}[f(z)], f is treated as a real-valued function. The notation summarizes the expected value of the result of applying f to a sample from D.
- 2Event probability
In Pr_{z ∼ D}[f(z)], f is treated as a Boolean condition. The notation summarizes the probability that the condition is true for a sample from D.
- 3Context shorthand
When the dependence on z and its distribution is already clear, E[f] may be used as shorter notation for the same expected quantity.
Expected-value notation averages a real-valued result; probability notation measures the chance that a condition holds.
Building D^m
A single sampled variable is not the only object that can have a distribution. If m points are sampled from D, the resulting object is an m-component tuple written as (z₁, …, zₘ). The notation Dm refers to the probability over the larger space Zm induced by this sampling process.
Interpreting Dm
Suppose m points are sampled from D independently. What object is described by Dm?
- 11. Make individual draws
Each component zᵢ is sampled from D.
- 22. Form the tuple
The individual samples are collected as (z₁, …, zₘ), an m-component point in Zm.
- 33. Identify the induced distribution
Dm describes the probability over these m-component tuples that is induced by the independent sampling process.
D governs individual samples from Z, while Dm governs the larger space Zm of m-component sample tuples.
Common Reading Errors
Common mistake Treating z ∼ D as if it named one permanently fixed value.
What it looks likeReading z ∼ D as though z had been selected once and would no longer depend on the sampling convention.
Why it failsThe notation tells you that z is regarded as a value obtained by sampling from D.
Do this insteadKeep the distribution context active whenever you interpret a later expression involving z.
Common mistake Confusing an expected value with an event probability.
What it looks likeAssuming E_{z ∼ D}[f(z)] and Pr_{z ∼ D}[f(z)] ask the same question.
Why it failsExpected value summarizes a real-valued function, whereas probability notation summarizes when a Boolean condition is true.
Do this insteadCheck whether the expression is averaging a numeric result or measuring the chance that a condition holds.
Common mistake Interpreting Dm as another individual sample from D.
What it looks likeReading the superscript m as if it changed the name of one sampled value.
Why it failsDm describes a probability over m-component tuples in Zm produced by independent sampling.
Do this insteadExpand the notation mentally as separate samples z₁ through zₘ collected into the tuple (z₁, …, zₘ).
Common mistake Ignoring the distribution subscript in an expectation.
What it looks likeTreating E_{z ∼ D}[f(z)] as though the subscript were decorative.
Why it failsThe subscript identifies the distribution governing the variable inside the brackets.
Do this insteadUse the subscript to identify which sampling process determines the expected value, unless the context already makes it clear.
Practice the Notation
For each expression, identify whether it describes a sampled variable, an expected value, an event probability, or a distribution over tuples: z ∼ D; E_{z ∼ D}[f(z)]; Pr_{z ∼ D}[f(z)]; D^m.
Hints
- Start by identifying the role of D.
- For the expressions with brackets, ask whether the inside describes a real-valued function or a Boolean condition.
- For Dm, look for the larger space and the tuple produced by repeated sampling.
Practice Answer
Classify z ∼ D, E_{z ∼ D}[f(z)], Pr_{z ∼ D}[f(z)], and D^m.
- 1z ∼ D
This states that z is sampled according to D.
- 2E_{z ∼ D}[f(z)]
This is an expected-value expression for a real-valued function of a sample from D.
- 3Pr_{z ∼ D}[f(z)]
This is an event-probability expression for the condition f(z) being true under the sampling convention.
- 4Dm
This is the induced probability over m-component tuples in Zm formed from independent samples from D.
The notation changes meaning according to whether it establishes sampling, summarizes numeric values, measures a Boolean event, or describes repeated sampling over tuples.
Key Takeaways
- 1D is a probability distribution over a set Z.
- 2z ∼ D says that z is sampled according to D; it does not identify one permanently fixed value.
- 3E_{z ∼ D}[f(z)] summarizes the expected value of a real-valued function of the sampled variable.
- 4Pr_{z ∼ D}[f(z)] summarizes the probability that a Boolean condition is true.
- 5Dm describes the induced probability over m-component tuples in Zm formed by independent sampling from D.
At a glance
- Read D first: it names the distribution over the set Z.
- Read z ∼ D as a sampling relationship between z and D.
- Separate expected-value notation from event-probability notation by asking whether the expression summarizes a real-valued result or a Boolean condition.
- Interpret Dm as the probability over m-component tuples induced by independent samples from D.