4 Random Variables and Probability Distributions

A structured guide to modeling uncertainty with random variables, probability distributions, distribution functions, expected value, variability, and common discrete and continuous models.

Random Variables and Their Types

A random variable converts outcomes of a random experiment into numerical values. It is usually written with an uppercase letter such as XX, while a lowercase letter such as xx denotes a particular value.

For three fair coin tosses, let XX be the number of heads observed. The possible values are 00, 11, 22, and 33. The individual sequences of coin tosses are outcomes in the sample space; the random variable summarizes each sequence by its number of heads.

A random variable is discrete when its possible values are finite or countably infinite. Counts of defects, customers, or heads are discrete. It is continuous when it can take any value in an interval of real numbers, as with height, temperature, waiting time, or exact weight. The distinction concerns the values the variable can take, not merely the precision used to record a measurement.

Takeaway: First define what is being measured and determine whether its possible values are discrete or continuous.

Probability Distributions

A probability distribution specifies how probability is assigned to the possible values of a random variable. It may be represented by a table, formula, graph, or .

Every valid distribution obeys two basic requirements: probabilities cannot be negative, and the total probability must equal one. For discrete variables, probability is assigned to individual values. For continuous variables, probability is assigned to intervals through areas under a density curve.

This distinction determines which mathematical tool to use. A count such as the number of defective items calls for a , whereas a measurement such as waiting time is modeled with a .

Takeaway: The type of random variable determines how probabilities are represented and calculated.

Discrete Probabilities

For a discrete random variable XX, the is

pX(x)=P(X=x).p_X(x)=P(X=x).

It must satisfy

pX(x)≥0p_X(x)\ge 0

and

∑xpX(x)=1.\sum_x p_X(x)=1.

If an event contains several possible values, add their masses:

P(X∈A)=∑x∈ApX(x).P(X\in A)=\sum_{x\in A}p_X(x).

For three fair coin tosses, if XX counts heads, the probabilities for x=0,1,2,3x=0,1,2,3 are 18\frac{1}{8}, 38\frac{3}{8}, 38\frac{3}{8}, and 18\frac{1}{8}, respectively. Therefore,

P(X≥2)=P(X=2)+P(X=3)=38+18=12.P(X\ge 2)=P(X=2)+P(X=3)=\frac{3}{8}+\frac{1}{8}=\frac{1}{2}.

Takeaway: For discrete variables, calculate event probabilities by adding the relevant point probabilities.

Continuous Probabilities

For a continuous random variable, the probability of any single exact value is zero:

P(X=x)=0.P(X=x)=0.

Instead, probabilities are assigned to intervals using a . If fX(x)f_X(x) is the density, then

fX(x)≥0f_X(x)\ge 0

and

∫−∞∞fX(x) dx=1.\int_{-\infty}^{\infty}f_X(x)\,dx=1.

The interval probability is the area under the density:

P(a≤X≤b)=∫abfX(x) dx.P(a\le X\le b)=\int_a^b f_X(x)\,dx.

For example, if XX is uniform from 00 to 2020, then fX(x)=120f_X(x)=\frac{1}{20} on that interval. Consequently,

P(5≤X≤8)=∫58120 dx=320=0.15.P(5\le X\le 8)=\int_5^8\frac{1}{20}\,dx=\frac{3}{20}=0.15.

Because individual points have probability zero in a continuous model, including or excluding an endpoint does not change an interval probability.

Takeaway: For continuous variables, probability is area over an interval, not the height of the density at one point.

Cumulative Probability

The works for both discrete and continuous variables. It is defined by

FX(x)=P(X≤x).F_X(x)=P(X\le x).

A CDF is nondecreasing, remains between 00 and 11, approaches 00 as xx approaches negative infinity, and approaches 11 as xx approaches positive infinity.

For a<ba<b, subtracting CDF values gives an interval probability:

P(a<X≤b)=FX(b)−FX(a).P(a<X\le b)=F_X(b)-F_X(a).

For a discrete variable, the CDF accumulates point masses:

FX(x)=∑t≤xpX(t).F_X(x)=\sum_{t\le x}p_X(t).

For a continuous variable with density fXf_X, it accumulates area:

FX(x)=∫−∞xfX(t) dt.F_X(x)=\int_{-\infty}^{x}f_X(t)\,dt.

When the CDF is differentiable, its derivative is the PDF:

fX(x)=FX′(x).f_X(x)=F_X'(x).

Takeaway: A CDF provides a unified way to describe cumulative probability and calculate intervals for either type of random variable.

Common Discrete Models

Discrete models are selected according to the process being counted.

  • A Bernoulli distribution describes one trial with two outcomes. If the success probability is pp, then P(X=1)=pP(X=1)=p and P(X=0)=1−pP(X=0)=1-p.

  • A counts successes in a fixed number nn of independent Bernoulli trials with common success probability pp. The number of correct guesses on ten independent true-false questions is an example with n=10n=10 and p=12p=\frac{1}{2}.

  • A geometric distribution counts the trials needed to obtain the first success. Its probability rule is

P(X=k)=(1−p)k−1p,k=1,2,3,….P(X=k)=(1-p)^{k-1}p, \qquad k=1,2,3,\ldots.
  • A Poisson distribution counts events in a fixed interval when they occur independently at a constant average rate λ\lambda. Its probability rule is

P(X=k)=e−λλkk!,k=0,1,2,….P(X=k)=e^{-\lambda}\frac{\lambda^k}{k!}, \qquad k=0,1,2,\ldots.

The Poisson distribution can also approximate a when the number of trials is large and the success probability is small, provided that approximation is reasonable.

Takeaway: Match the model to the trial structure, stopping rule, or event-rate assumptions.

Common Continuous Models

Several continuous distributions describe measurements and waiting times.

  • A uniform distribution on [a,b][a,b] assigns equal probability to intervals of equal length. Its density on the interval is

fX(x)=1b−a,a≤x≤b.f_X(x)=\frac{1}{b-a}, \qquad a\le x\le b.
  • A is symmetric and bell-shaped, with parameters μ\mu and σ\sigma. Standardization uses

Z=X−μσ.Z=\frac{X-\mu}{\sigma}.
  • An exponential distribution often models waiting time until an event in a Poisson-process setting. With rate λ>0\lambda>0, its density and CDF for x≥0x\ge 0 are

fX(x)=λe−λxf_X(x)=\lambda e^{-\lambda x}

and

FX(x)=1−e−λx.F_X(x)=1-e^{-\lambda x}.

A model is appropriate only when its assumptions fit the context. For example, a normal model should not be adopted simply because a variable is numerical; the shape and process should support it.

Takeaway: Use continuous distributions to model measurements or waiting times, while checking the assumptions that justify each choice.

Center and Spread

The summarizes the probability-weighted center of a distribution. For a discrete variable,

E[X]=∑xx pX(x),E[X]=\sum_x x\,p_X(x),

and for a continuous variable,

E[X]=∫−∞∞xfX(x) dx.E[X]=\int_{-\infty}^{\infty}x f_X(x)\,dx.

The need not be an attainable outcome. A fair six-sided die has

E[X]=1+2+3+4+5+66=3.5,E[X]=\frac{1+2+3+4+5+6}{6}=3.5,

even though one roll cannot equal 3.53.5.

measures spread around the mean:

Var⁡(X)=E[(X−E[X])2].\operatorname{Var}(X)=E[(X-E[X])^2].

The standard deviation is

σX=Var⁡(X).\sigma_X=\sqrt{\operatorname{Var}(X)}.

For a linear transformation Y=aX+bY=aX+b, the center and spread transform as

E[Y]=aE[X]+b,Var⁡(Y)=a2Var⁡(X).E[Y]=aE[X]+b, \qquad \operatorname{Var}(Y)=a^2\operatorname{Var}(X).

Takeaway: describes location, while and standard deviation describe variability.

Applying Probability Models

A practical modeling workflow connects the mathematical distribution to the real setting:

  1. Define the random variable and state its units.

  2. List its possible values and classify it as discrete or continuous.

  3. Choose a distribution whose assumptions fit the process.

  4. Specify the distribution parameters.

  5. Calculate probabilities with a PMF, PDF, or CDF.

  6. Interpret the result in the original context.

  7. Check whether independence, constant rates, fixed trial counts, or approximate normality are reasonable.

Distributions can model counts of successes, arrivals, or defects; estimate the chance of exceeding a threshold; calculate expected costs or waiting times; and describe sampling behavior. A formula by itself does not validate a model. The assumptions behind the formula must be appropriate for the situation.

Final takeaway: Sound probability modeling requires both correct calculations and a defensible connection between the distribution's assumptions and the process being studied.