There are two important classes of random variables: discrete random variables and continuous random variables.
Discrete Random Variables
A set A is countable if either:
A is finite, e.g., {1,2,3,4}, or
It can be put in one-to-one correspondence with the natural numbers (countably infinite).
Sets such as N, Z, Q and their subsets are countable, while nonempty intervals [a,b] in R are uncountable. A random variable is discrete if its range is a countable set. If X is a discrete random variable, its range RX is countable, so we can list its elements:
RX={x1,x2,x3,…}
Here, x1,x2,x3,… are possible values of X. The event A={X=xk} is defined as the set of outcomes s in the sample space S for which X(s)=xk:
A={s∈S∣X(s)=xk}
The probabilities of events {X=xk} are given by the probability mass function (PMF) of X.
Definition (PMF)
Let X be a discrete random variable with range RX={x1,x2,x3,…} (finite or countably infinite). The function
PX(xk)=P(X=xk),for k=1,2,3,…,
is called the probability mass function (PMF) of X.
The PMF can be extended to all real numbers:
PX(x)={P(X=x)0if x∈RXotherwise
The PMF is a probability measure that satisfies:
0≤PX(x)≤1 for all x,
∑x∈RXPX(x)=1,
For any set A⊂RX, P(X∈A)=∑x∈APX(x).
Independence of Random Variables
Two random variables X and Y are independent if:
P(X=x,Y=y)=P(X=x)P(Y=y)for all x,y.
For n discrete random variables X1,X2,…,Xn, they are independent if:
P(X1=x1,X2=x2,…,Xn=xn)=P(X1=x1)P(X2=x2)…P(Xn=xn)for all x1,x2,…,xn.
Types of Discrete Random Variables
Bernoulli Distribution
A Bernoulli random variable can take two values, usually 0 and 1, modeling a success/failure experiment.
Definition (Bernoulli Distribution)
A random variable X is Bernoulli with parameter p, denoted X∼Bernoulli(p), if:
PX(x)=⎩⎨⎧p1−p0for x=1for x=0otherwise
Geometric Distribution
This models the number of trials until the first success in a series of independent Bernoulli trials.
Definition (Geometric Distribution)
A random variable X is geometric with parameter p, denoted X∼Geometric(p), if:
PX(k)={p(1−p)k−10for k=1,2,3,…otherwise
Binomial Distribution
Models the number of successes in n independent Bernoulli trials.
Definition (Binomial Distribution)
A random variable X is binomial with parameters n and p, denoted X∼Binomial(n,p), if:
PX(k)={(kn)pk(1−p)n−k0for k=0,1,2,…,notherwise
Poisson Distribution
Models the number of events in a fixed interval of time or space.
Definition (Poisson Distribution)
A random variable X is Poisson with parameter λ, denoted X∼Poisson(λ), if:
PX(k)={k!e−λλk0for k∈{0,1,2,…}otherwise
Cumulative Distribution Function (CDF)
The CDF of a random variable X is defined as:
FX(x)=P(X≤x)for all x∈R.
For a discrete random variable X with range RX={x1,x2,x3,…} (with x1<x2<x3<…):
FX(x)=xk≤x∑PX(xk).
For all a≤b:
P(a<X≤b)=FX(b)−FX(a)
Expected Value (Mean)
The expected value of a discrete random variable X with range RX={x1,x2,x3,…} is:
E[X]=xk∈RX∑xkPX(xk).
Linearity of Expectation
E[aX+b]=aE[X]+b
E[X1+X2+…+Xn]=E[X1]+E[X2]+…+E[Xn]
Expected Value of a Function (LOTUS)
For a function g(X):
E[g(X)]=xk∈RX∑g(xk)PX(xk)
Variance
Variance measures the spread of a random variable around its mean. For EX=μX:
Var(X)=E[(X−μX)2]=xk∈RX∑(xk−μX)2PX(xk)
Standard Deviation
SD(X)=σX=Var(X)
Computational Formula for Variance
Var(X)=E[X2]−(E[X])2
Variance of a Linear Transformation
For a,b∈R:
Var(aX+b)=a2Var(X)
Variance of the Sum of Independent Variables
For independent X1,X2,…,Xn:
Var(X)=Var(X1)+Var(X2)+…+Var(Xn)
Continuous Random Variables
Random variables with a continuous range of possible values are common. For example, the exact velocity of a vehicle on a highway is a continuous random variable. The CDF of a continuous random variable is a continuous function, meaning it does not have jumps. This aligns with the fact that P(X=x)=0 for all x.
Definition (CDF)
A random variable X with CDF FX(x) is continuous if FX(x) is a continuous function for all x∈R. We also assume that the CDF is differentiable almost everywhere in R.
Probability Density Function (PDF)
For continuous random variables, the PMF does not apply as P(X=x)=0 for all x∈R. Instead, we use the PDF, which gives the density of probability at a point.
fX(x)=Δ→0+limΔP(x<X≤x+Δ)
The function fX(x) gives the probability density at point x. It is defined as:
fX(x)=dxdFX(x)=FX′(x),if FX(x) is differentiable at x
A random variable X is continuous if there is a non-negative function fX, called the probability density function (PDF), such that:
P(X∈B)=∫BfX(x)dx
For every subset B of the real line, the probability of X falling within an interval [a,b] is:
P(a≤X≤b)=∫abfX(x)dx
This can be interpreted as the area under the graph of the PDF. For any single value a:
P(X=a)=0
Thus:
P(a≤X≤b)=P(a<X<b)=P(a≤X<b)=P(a<X≤b)
A function fX must be non-negative and satisfy:
∫−∞∞fXdx=1
Definition (PDF)
Consider a continuous random variable X with an absolutely continuous CDF FX(x). The function fX(x) defined by:
fX(x)=dxdFX(x)=FX′(x),if FX(x) is differentiable at x
is the probability density function (PDF) of X. For small values of δ:
P(x<X≤x+δ)≈fX(x)δ
If fX(x1)>fX(x2):
P(x1<X≤x1+δ)>P(x2<X≤x2+δ)
Thus, X is more likely to be around x1 than x2.
The CDF can be obtained from the PDF by integration:
FX(x)=∫−∞xfX(u)du
And:
P(a<X≤b)=FX(b)−FX(a)=∫abfX(u)du
Properties of the PDF
fX(x)≥0 for all x∈R
∫−∞∞fX(u)du=1
P(a<X≤b)=∫abfX(u)du
For any set A, P(X∈A)=∫AfX(u)du
Range of a Continuous Random Variable
The range RX of a continuous random variable X is:
RX={x∣fX(x)>0}
Expected Value
The expected value of a continuous random variable X is:
EX=∫−∞∞xfX(x)dx
Expected Value of a Function (LOTUS)
For a function g(X):
E[g(X)]=∫−∞∞g(x)fX(x)dx
Linearity of Expectation
E[aX+b]=aEX+b
E[X1+X2+⋯+Xn]=EX1+EX2+⋯+EXn
Variance
The variance of a continuous random variable X is:
Var(X)=E[(X−μX)2]=EX2−(EX)2
So:
Var(X)=∫−∞∞(x−μX)2fX(x)dx=EX2−(EX)2
For a,b∈R:
Var(aX+b)=a2Var(X)
If X is continuous and Y=g(X), then Y is also a random variable. To find the CDF and PDF of Y, start from the CDF and then differentiate.
Uniform Random Variable
A continuous random variable X is uniformly distributed over [a,b], denoted X∼Uniform(a,b), if:
fX(x)={b−a10a<x<botherwise
The CDF and mean are:
FX(x)=⎩⎨⎧0b−ax−a1x<aa≤x<bx≥b
EX=2a+b
The variance is:
Var(X)=12(b−a)2
Exponential Random Variable
The exponential distribution models the time between events. A continuous random variable X is exponentially distributed with parameter λ>0, denoted X∼Exponential(λ), if:
fX(x)={λe−λx0x>0otherwise
The CDF, mean, and variance are:
FX(x)=1−e−λx
EX=λ1
Var(X)=λ21
The exponential distribution is memoryless:
P(X>x+a∣X>a)=P(X>x)
Normal Distribution
The Central Limit Theorem (CLT) states that the sum of a large number of random variables is approximately normal. A standard normal random variable Z is denoted Z∼N(0,1) and has PDF:
fZ(z)=2π1exp{−2z2}
The mean and variance are:
EZ=0Var(Z)=1
The CDF is:
FZ(z)=2π1∫−∞zexp{−2u2}du
The CDF of any normal random variable can be written in terms of the standard normal CDF, denoted Φ:
Φ(x)=2π1∫−∞xexp{−2u2}du
Properties of Φ:
limx→∞Φ(x)=1
limx→−∞Φ(x)=0
Φ(0)=21
Φ(−x)=1−Φ(x)
A normal random variable X with mean μ and variance σ2 is denoted X∼N(μ,σ2). If Z is standard normal and X=σZ+μ: