Random Variable: a function X that assigns a real number to every sâS
X is a function from S to R (X:SâĶR)
E.g. Experiment is rolling a die, X is the number on the top face
Range space of X is the set of real numbers RXâ={xâĢx=X(s),sâS} (Set of all possible values that X can take, or set of all outputs of the function)
Notation
Capital letters denote random variables
Lower case letters denote observed values in the experiment
{X=x} means {sâS:X(s)=x}, and is a subset of S
If AâR, then {XâA} means {sâS:X(s)âA}, and is a subset of S
P(X=x)=P({sâS:X(s)=x})
P(XâA)=P({sâS:X(s)âA})
Probability Distribution
Discrete random variable: The number of values in RXâ is finite or countable: RXâ can be written as {x1â,x2â,âŊ}
Probability (mass) function (pf/pmf):f(x)=P(X=x) for xâRXâ, 0 otherwise
f(xiâ)âĨ0 for all xiââRxâ ; f(x)=0 for all xî âRXâ
Sum of all f(xiâ)=1
P(XâB)= sum of f(x) for all xâBâĐRXâ
Range: 0âĪf(x)âĪ1
Probability distribution: Collection of pairs (xiâ,f(xiâ))
Continuous random variable:RXâ is an interval or a collection of intervals
Probability (density) function (pf/pdf):f(x) satisfies:
f(x)âĨ0 for all xâRXâ ; f(x)=0 for all xî âRXâ
âŦRXââf(x)dx=1 , or âŦââââf(x)dx=1
If a function satisfies these two conditions^, it is a pdf
For any aâĪb , P(aâĪXâĪb)=âŦabâf(x)dx
For any specific value x0â, P(X=x0â)=âŦx0âx0ââf(x)dx=0 âP(A)=0 ,but A might not be â â
In P(aâĪXâĪb), any âĪ can be swapped with < , and the value will be the same
E.g. for a pdf f(x)=cx for 0<x<1, 1=âŦââââf(x)dx=âŦ01âcxdx=câ 2x2ââ01â=c/2
Range: f(x)âĨ0, but not necessary that f(x)âĪ1 (pdf does not represent probability)
Cumulative distribution function cdf:F(x)=P(XâĪx)
Applies whether X is discrete or continuous
Always non-decreasing
For any proabability function, the cdf is uniquely determined, and vice versa
Range: 0âĪF(x)âĪ1
For discrete random variable:
F(x)= sum of f(t) or P(X=t) for all tâRXâ:tâĪx
For any a<b, P(aâĪXâĪb)=P(XâĪb)âP(X<a)F(b)âF(aâ) where aâ is âlargest value in RXâ that is smaller than aâ, or limxâaâF(x)
For continuous random variable:
F(x)=âŦââxâf(t)dt ; f(x)=dF(x)/dx
P(aâĪXâĪb)=P(a<X<b)=F(b)âF(a)
Expectation
For discrete rv: expectation or mean of X=ΞXâ=E(X)=âxiââRXââxiâf(xiâ)
For continuous rv:ΞXâ=E(X)=âŦââââxf(x)dx=âŦxâRXââxf(x)dx
Properties
For a,bâR,E(aX+b)=aE(X)+b
E(X+Y)=E(X)+E(Y)
For any function g, rv X with probability function f(x) and range RXâ
If X is discrete, E[g(X)]=âxâRXââg(x)f(x)
If X is continuous, E[g(X)]=âŦRXââg(x)f(x)dx
Iff X and Y are independent, E(XY)=E(X)E(Y)
Variance
VarianceÏ2 of X: ÏX2â=V(X)=E(XâΞXâ)2 â this means E((XâΞXâ)2)
If X is discrete rv, V(X)=âxâRXââ(xâΞXâ)2f(x)
If X is continuous rv, V(X)=âŦââââ(xâΞxâ)2f(x)dx
V(X)âĨ0 for any X. =0 iff P(X=E(X))=1 i.e. X is a constant