Chapter 2
Random Variables
Definition
A random variable is a function
Expectation
The expectation of a discrete random variable
For a continuous random variable the sum becomes an integral,
Linearity of expectation
Linearity
For any random variables
, and constants , ,
No independence between
Aside
"aside" is not one of Obsidian's built-in callout types. The publisher still renders it, with a neutral colour.
Variance
Variance measures how far
Simulation
import random
rolls = [random.randint(1, 6) for _ in range(100_000)]
print(sum(rolls) / len(rolls)) # close to 3.5The expected value of a die roll is
Comments