random variable ( RV ): a function that assigns a real number to each outcome in the sample space of a random experiment
written as capitals X , Y , Z ; the values it can take are its support
discrete : countable, distinct values, like the number of heads in some coin flips
continuous : any value in a range, infinitely divisible ( “infinite precision” ), like a person’s height
described by a density f ( x ) , probabilities are areas under it, P ( X = x ) = 0 for any single value
the expected value is the balancing point ( fulcrum ) of the pmf, the variance the spread around it
E ( X ) = μ = ∑ x p ( x ) , V a r ( X ) = ∑ ( x − μ ) 2 p ( x ) = E ( X 2 ) − μ 2
example: an osprey nest has 0 to 3 eggs with probabilities 0.2, 0.4, 0.3, 0.1; X = number of eggs
x p ( x ) F ( x ) x p ( x ) 0 .2 .2 0 1 .4 .6 .4 2 .3 .9 .6 3 .1 1 .3
E ( X ) = 0 + .4 + .6 + .3 = 1.3 eggs
E ( X 2 ) = .4 + 1.2 + .9 = 2.5 , V a r ( X ) = 2.5 − 1. 3 2 = 0.81
example: machined cylinders meant to be 50mm come out anywhere in [ 49.5 , 50.5 ] , a continuous RV with a parabola ( vertex form ) density
f ( x ) = { 1.5 − 6 ( x − 50 ) 2 , 0 , 49.5 ≤ x ≤ 50.5 otherwise
- CDF by integrating from the left edge: $F(x) = 1.5(x - 49.5) - 2(x - 50)^3 - 0.25$ on $[49.5, 50.5]$, $0$ below, $1$ above