There are two important classes of random variables: discrete random variables and continuous random variables.
1 Discrete Random Variable
A random variable is called discrete if its range (the set of values that it can take) is finite or at most countably infinite. A random variable that can take an uncountably infinite number of values is not discrete. For an example, consider the experiment of choosing a point a from the interval [−1, 1]. The random variable that associates the numerical value X(a)=a2 to the outcome a is not discrete since the range is [0, 1]. On the other hand, the random variable that associates with a the numerical value
X(a)=⎩⎨⎧1,0,−1,a>0a=0a<0
is discrete.
For a discrete random variable X, we define the probability mass function (pmf) of X by
pX(a)=P(X=a)=P({ω∣X(ω)=a}).
Note that pX(.) is a valid pmf if and only if the following condition is satisfied.
I=1∑∞pX(xI)=1,
where {x1,x2,…,} is the range of the random variable X.
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).
Types of Discrete Random Variables
i) Bernoulli Random Vadriable
Consider the toss of a biased coin, which comes up a head with probability p, and a tail with probability 1−p. The Bernoulli random variable takes the two values 1 and 0, depending on whether the outcome is a head or a tail:
X(T)=0,X(H)=1.
The probability mass function (pmf) of the Bernoulli random variable is given by
pX(0)=1−p,pX(1)=p.
The cumulative distribution function (cdf) of the Bernoulli random variable is given by
FX(x)=⎩⎨⎧0,1−p,1,x<00≤x<1x≥1
ii) Binomial Random Variable
A biased coin is tossed n times. At each toss, the coin comes up a head with probability p, and a tail with probability 1−p, independently of prior tosses. The sample space is given by the set of all 2n possible tuples
of H, T combinations. For the case of n = 4, the sample space is as given below:
For any ω∈Ω, X(ω) is defined as the number of heads in ω. The range of values which the random variable X takes is {0,1,…,n}. The probability mass function (pmf) of the random variable X is given by
pX(k)=(kn)pk(1−p)n−k,0≤k≤n
This random variable is known as binomial random variable. Note that the above pmf is a valid pmf as it sums to 1.
Suppose that we repeatedly and independently toss a biased coin with probability of a head p, where 0<p<1 till a head comes up for the first time. The sample space corresponding to the experiment is given by
Ω={H,TH,TTH,TTTH,…}.
For any ω∈Ω, X(ω) is defined as the number of tosses in ω. The range of values which the random variable X takes is {1,2,…,}. The probability mass function (pmf) of the random variable X is given by
pX(k)=(1−p)k−1p,k∈{1,2,…}.
This random variable is known as geometric random variable. Note that the above pmf is a valid pmf as it sums to 1.
A poisson random variable takes nonnegative integer values. Its pmf is given by
pX(k)=k!e−λλk,k=0,1,2,…
Note that the above pmf is a valid pmf as it sums to 1.
k=0∑∞pX(k)=e−λk=0∑∞k!λk=e−λeλ=1.
An important property of the Poisson random variable is that it may be used to approximate a binomial random variable when the binomial parameter n is large and p is small.
2) 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.
For a continuous random variable X, the probability of it taking any single value is zero, so we use a Probability Density Function (PDF), denoted fX(x), to describe its distribution.
The PDF is defined as the derivative of the Cumulative Distribution Function (CDF), FX(x), where the derivative exists:
fX(x)=dxdFX(x)
The probability that X falls within an interval [a,b] is the integral of the PDF over that interval:
P(a≤X≤b)=∫abfX(x)dx
A valid PDF must satisfy two conditions: fX(x)≥0 for all x, and its total integral must be one, ∫−∞∞fX(x)dx=1.
Conversely, the CDF can be obtained from the PDF by integrating from negative infinity up to a point x:
FX(x)=P(X≤x)=∫−∞xfX(u)du
Types of Continuous Random Variable
i) 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 is:
FX(x)=⎩⎨⎧0b−ax−a1x<aa≤x<bx≥b
ii) 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 is:
FX(x)=1−e−λx
iii) 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: