144. Expected Value

144.1. Expected Value

The expected value 𝔼[𝑋] is the probability-weighted average of a random variable — its long-run mean over many draws.

144.1.1. Discrete

Weight each value 𝑥𝑖 by its probability 𝑝𝑖 and sum:

𝔼[𝑋]=𝑖=1𝑛𝑥𝑖𝑝𝑖
Example
Fair die: 𝔼[𝑋]=𝑘=16𝑘16=216=3.5

144.1.2. Continuous

Swap the sum for an integral, and the mass 𝑝𝑖 for 𝑓(𝑥)d𝑥:

𝔼[𝑋]=𝑥𝑓(𝑥)d𝑥

144.1.3. Partial (truncated) expectation

Average 𝑥 over only a window [𝑎,𝑏] — same integrand, restricted limits:

𝑎𝑏𝑥𝑓(𝑥)d𝑥=𝔼[𝑋1{𝑎𝑋𝑏}]

where 1{()} is the indicator (1 when the condition holds, 0 otherwise). This is not a mean — it is not renormalized, so it shrinks toward 0 as the window captures less probability.

144.1.4. Conditional expectation

Renormalize by the probability of the window — now it is a true average, given that 𝑋 landed in [𝑎,𝑏]:

𝔼[𝑋|𝑎𝑋𝑏]=𝑎𝑏𝑥𝑓(𝑥)d𝑥𝑃(𝑎𝑋𝑏)

144.1.5. LOTUS

Law of the Unconscious Statistician. To average a function 𝑔(𝑋), integrate 𝑔 against the density of 𝑋 — no need to first find the distribution of 𝑔(𝑋):

𝔼[𝑔(𝑋)]=𝑔(𝑥)𝑓(𝑥)d𝑥