lesson

Probability Foundations · High School

Random Variables and Distributions

Map outcomes to numerical values and reason about probability distributions, expectation, variance, transformations, and common models.

A random variable turns outcomes of an uncertain process into numbers that can be analyzed. The mapping is fixed even though the outcome is not known in advance. A probability distribution then describes how probability is allocated among possible numerical values or intervals. Expected value summarizes center, while variance and standard deviation summarize spread. This lesson connects outcome spaces, functions, graphs, calculations, assumptions, and interpretation.

Begin with outcomes and a fixed mapping

An experiment is any repeatable or conceptually repeatable process with an uncertain outcome. Its sample space Ω\Omega is the set of possible outcomes. The Greek capital omega, Ω\Omega, is a conventional symbol for that space. An event is a subset of outcomes. Probability is assigned to events before a random variable converts outcomes into numerical values.

A random variable is a function X:ΩRX:\Omega\to\mathbb R. The arrow means that XX maps each outcome in the sample space to one real number. The capital letter XX names the random variable. A lowercase xx commonly represents one possible numerical value. Randomness lies in which outcome occurs, not in whether the mapping changes its rule.

For two coin tosses, the sample space is {HH,HT,TH,TT}\{HH,HT,TH,TT\}. Define XX as the number of heads. Then X(HH)=2X(HH)=2, X(HT)=1X(HT)=1, X(TH)=1X(TH)=1, and X(TT)=0X(TT)=0. Different outcomes can map to the same numerical value. The distribution combines their probabilities after the mapping.

A sample-space mapping sends several coin-toss outcomes into the values zero, one, and two heads.

Distinguish random variables from their realized values

Before an outcome is observed, XX represents a numerical quantity whose value is uncertain. After observation, a realized value such as x=1x=1 can be recorded. The statement X=1X=1 describes the event containing every outcome mapped to one. For the two-toss example, that event is {HT,TH}\{HT,TH\}. Probability can therefore be written P(X=1)P(X=1).

The random variable is not itself a probability. It is a numerical function to which probabilities are transferred from outcomes. A value such as X=2X=2 can have a probability, but the number two is not a probability. Keeping function, value, event, and probability separate prevents notation from collapsing. Each object plays a different role.

Random variables can carry physical units. If XX is waiting time, it may be measured in seconds. If YY is mass, it may be measured in kilograms. Probabilities are dimensionless, while density units depend on the variable. Expected values inherit the variable’s units.

Classify discrete and continuous variables

A discrete random variable has a finite or countably infinite set of possible values. Counts such as number of defects, number of arrivals, or number of successes are usually discrete. The values may be listed in principle even if the list is infinite. Gaps can exist between possible values. Probability may be assigned directly to individual values.

A continuous random variable can take values across intervals. Idealized measurement quantities such as time, length, temperature, or concentration are often modeled continuously. Any one exact value has probability zero under a continuous density model. Intervals can still have positive probability. Probability comes from area rather than from density height alone.

The distinction belongs to the model as well as the measurement. A digital instrument may record temperature to the nearest 0.1C0.1\,^{\circ}\mathrm{C}, producing discrete recorded values. A continuous model may remain a useful approximation to the underlying temperature. Modeling choices simplify reality for a purpose. Their consequences should be acknowledged.

Construct a probability mass function

For a discrete random variable XX, the probability mass function is pX(x)=P(X=x)p_X(x)=P(X=x). The subscript reminds the reader which random variable the function describes. Every mass satisfies pX(x)0p_X(x)\geq0. The masses sum to one, written xpX(x)=1\sum_xp_X(x)=1. The sigma symbol instructs us to add over every possible value.

For the number of heads in two fair tosses, pX(0)=14p_X(0)=\dfrac{1}{4}, pX(1)=12p_X(1)=\dfrac{1}{2}, and pX(2)=14p_X(2)=\dfrac{1}{4}. The middle value receives probability from two outcomes. Adding gives 14+12+14=1\dfrac{1}{4}+\dfrac{1}{2}+\dfrac{1}{4}=1. No probability belongs to values outside zero, one, and two. A bar graph can display the separate masses.

The mass function provides probabilities of events by addition. For example, P(X1)=pX(1)+pX(2)=34P(X\geq1)=p_X(1)+p_X(2)=\dfrac{3}{4}. The symbol \geq means greater than or equal to. The event includes one or two heads. Discreteness makes endpoint inclusion visible because individual points can carry probability.

Use the cumulative distribution function

The cumulative distribution function is FX(x)=P(Xx)F_X(x)=P(X\leq x). It records all probability at or below the input value. The definition works for discrete, continuous, and mixed variables. A CDF never decreases as xx increases. Its values lie between zero and one.

For a discrete variable, the CDF is a step function. It jumps at each value with positive probability. The jump size at xx equals P(X=x)P(X=x). Between possible values, the CDF stays constant. Right-continuity determines how each jump endpoint is included.

Interval probabilities can be recovered through subtraction. For a<ba<b, P(a<Xb)=FX(b)FX(a)P(a<X\leq b)=F_X(b)-F_X(a). The left endpoint is excluded because FX(a)F_X(a) removes probability at or below aa. Different endpoint choices matter for discrete variables. For a continuous distribution, individual endpoints have zero probability and the choices agree.

A discrete probability-mass graph is paired with its staircase cumulative distribution function.

Define a continuous probability density

A continuous random variable can be described by a probability density function fX(x)f_X(x). The density must satisfy fX(x)0f_X(x)\geq0. Its total area is one, written fX(x)dx=1\int_{-\infty}^{\infty}f_X(x)\,dx=1. The integral sign represents continuous accumulation. Infinite limits mean the entire real line is included.

Probability over an interval is P(aXb)=abfX(x)dxP(a\leq X\leq b)=\int_a^bf_X(x)\,dx. The probability is area under the density curve between the endpoints. Density height is probability per unit of xx, not probability at one point. A density can exceed one if it remains narrow enough that total area is one. Only accumulated area must lie between zero and one.

If XX is measured in seconds, density has units of inverse seconds. Multiplying density by the differential width dxdx produces a dimensionless probability contribution. This unit analysis explains why density height is not itself probability. Changing measurement units changes numerical density height. The same interval probability remains invariant after proper transformation.

Understand zero probability at a point

For a continuous variable, P(X=x)=0P(X=x)=0 for every exact value xx. This does not mean that the variable can never take a value. It means an individual point has zero width and therefore zero density area. Uncountably many zero-probability points collectively form intervals with positive probability. The logic differs from adding a countable list of zeros.

Measurement language often rounds continuous values. An instrument reading 5.0s5.0\,\mathrm{s} may represent an interval such as 4.95sX<5.05s4.95\,\mathrm{s}\leq X<5.05\,\mathrm{s}. That interval can have positive probability. The displayed number is not an infinitely precise event. Resolution links continuous models with discrete records.

For continuous XX, endpoint inclusion does not affect interval probability. Thus P(a<X<b)=P(aXb)P(a<X<b)=P(a\leq X\leq b) under the model. For discrete XX, adding or removing an endpoint may change probability. Recognizing the variable type determines whether inequality symbols matter numerically. This is a conceptual check before integration or summation.

Calculate expected value for discrete variables

The expected value of a discrete random variable is E[X]=xxpX(x)E[X]=\sum_xx\,p_X(x) when the sum exists. Each possible value is multiplied by its probability and the products are added. The operator EE means expectation. Expected value is a probability-weighted center. It is not necessarily one of the possible outcomes.

For the two-toss head count, E[X]=0(14)+1(12)+2(14)=1E[X]=0\left(\dfrac{1}{4}\right)+1\left(\dfrac{1}{2}\right)+2\left(\dfrac{1}{4}\right)=1. In this case, the expectation is a possible value. For a fair six-sided die, expectation is 3.53.5 even though no face displays 3.53.5. The value describes long-run average behavior across repeated independent trials. It does not predict the next outcome.

Expectation is linear. For constants aa and bb, E[aX+b]=aE[X]+bE[aX+b]=aE[X]+b. This rule does not require independence because only one variable appears. More generally, E[X+Y]=E[X]+E[Y]E[X+Y]=E[X]+E[Y] even when XX and YY are dependent. Linearity makes totals easier to analyze than their full distributions.

Calculate expectation for continuous variables

For a continuous random variable, expectation is E[X]=xfX(x)dxE[X]=\int_{-\infty}^{\infty}x f_X(x)\,dx when the integral exists. The value xx is weighted by density and accumulated over the real line. The formula parallels the discrete probability-weighted sum. Integrals replace sums because values vary continuously. The result inherits the units of XX.

Suppose XX is uniform on [0,4s][0,4\,\mathrm{s}]. Its density is fX(x)=14sf_X(x)=\dfrac{1}{4\,\mathrm{s}} over that interval and zero elsewhere. The expectation is 04sx(14s)dx=2s\int_0^{4\,\mathrm{s}}x\left(\dfrac{1}{4\,\mathrm{s}}\right)dx=2\,\mathrm{s}. Symmetry also places the center halfway between the endpoints. Units reduce correctly during integration.

An expectation need not exist even when a valid probability distribution exists. Heavy tails can make the positive and negative weighted contributions fail to converge. A distribution also can have a mean but no finite variance. Formulas require existence conditions. Software output should not replace checking those mathematical assumptions.

Interpret expected value in decisions

Consider a game that pays 8.00dollars8.00\,\mathrm{dollars} with probability 0.250.25 and loses 3.00dollars3.00\,\mathrm{dollars} with probability 0.750.75. Let net payoff be XX. Its expected value is E[X]=(8.00dollars)(0.25)+(3.00dollars)(0.75)=0.25dollarsE[X]=(8.00\,\mathrm{dollars})(0.25)+(-3.00\,\mathrm{dollars})(0.75)=-0.25\,\mathrm{dollars}. Over many independent plays, average payoff tends toward a loss of about twenty-five cents per play. One play still produces either gain or loss.

Expected monetary value is not the only decision criterion. A rare catastrophic loss can matter more than its average contribution suggests. Risk tolerance, utility, legal constraints, and resource limits may alter a rational choice. Two distributions with the same expectation can have very different spreads and tails. Center must be interpreted with variability.

Expectation can also describe conservation across random outcomes. If repeated fair transfers redistribute money without external cost, total expected money may remain fixed. Individual outcomes can still vary substantially. Expected value summarizes an ensemble or long-run average. It does not make uncertainty disappear.

Define variance and standard deviation

Let μ=E[X]\mu=E[X] denote the population mean. Variance is Var(X)=E[(Xμ)2]\operatorname{Var}(X)=E[(X-\mu)^2]. The difference XμX-\mu measures deviation from the mean. Squaring prevents positive and negative deviations from canceling. Averaging squared deviations quantifies spread.

Variance has squared units. If XX is measured in meters, variance is measured in square meters. Standard deviation is σ=Var(X)\sigma=\sqrt{\operatorname{Var}(X)}. The Greek letter sigma, σ\sigma, commonly denotes population standard deviation. Taking the square root returns to the original units.

The computational identity is Var(X)=E[X2]μ2\operatorname{Var}(X)=E[X^2]-\mu^2 when the required expectations exist. It follows by expanding (Xμ)2(X-\mu)^2 and using linearity of expectation. The identity can simplify hand calculations. In floating-point computation with very large nearly equal terms, a numerically stable algorithm may be preferable. Algebraic equivalence does not guarantee identical numerical behavior under finite precision.

Compute a discrete variance

Let P(X=0)=0.2P(X=0)=0.2, P(X=1)=0.5P(X=1)=0.5, and P(X=2)=0.3P(X=2)=0.3. The mean is μ=0(0.2)+1(0.5)+2(0.3)=1.1\mu=0(0.2)+1(0.5)+2(0.3)=1.1. Next compute E[X2]=02(0.2)+12(0.5)+22(0.3)=1.7E[X^2]=0^2(0.2)+1^2(0.5)+2^2(0.3)=1.7. Therefore variance is 1.7(1.1)2=0.491.7-(1.1)^2=0.49. The standard deviation is 0.700.70.

If XX counts events, the mean and standard deviation are expressed in count units, while variance is in squared count units. The calculation uses population probabilities rather than a sample denominator correction. Every probability contributes to both moments. A probability table helps prevent omitted values. The probabilities should sum to one before moments are trusted.

The mean 1.11.1 is not required to be an attainable count. It locates the distribution’s balance point. The standard deviation 0.700.70 describes a typical scale of variation but is not a strict boundary. Individual values can lie more than one standard deviation away. Distribution shape determines how probability is arranged around the center.

Transform location and scale

Let Y=aX+bY=aX+b, where aa and bb are constants. The expectation is E[Y]=aE[X]+bE[Y]=aE[X]+b. Adding bb shifts every value and therefore shifts the mean by bb. Multiplying by aa scales all values and the mean. Units must remain compatible when quantities are added.

Variance transforms as Var(Y)=a2Var(X)\operatorname{Var}(Y)=a^2\operatorname{Var}(X). The shift bb does not affect spread because it moves every value equally. The factor aa is squared because deviations are squared. Standard deviation becomes σY=aσX\sigma_Y=|a|\sigma_X. Absolute value keeps spread nonnegative when aa is negative.

If E[X]=4.0mE[X]=4.0\,\mathrm{m} and Var(X)=9.0m2\operatorname{Var}(X)=9.0\,\mathrm{m^2}, let Y=2X1.0mY=2X-1.0\,\mathrm{m}. Then E[Y]=7.0mE[Y]=7.0\,\mathrm{m}. The variance is 4(9.0m2)=36m24(9.0\,\mathrm{m^2})=36\,\mathrm{m^2}. The standard deviation changes from 3.0m3.0\,\mathrm{m} to 6.0m6.0\,\mathrm{m}. Subtracting 1.0m1.0\,\mathrm{m} shifts the center but contributes nothing to the spread.

Recognize common discrete models

A Bernoulli random variable records one success or failure. It takes value one with probability pp and zero with probability 1p1-p. Its mean is pp, and its variance is p(1p)p(1-p). The word success labels the event of interest without implying desirability. The model represents one binary trial.

A binomial variable counts successes in nn independent Bernoulli trials with constant success probability pp. Its mean is npnp, and its variance is np(1p)np(1-p). Independence and constant probability are substantive assumptions. Sampling without replacement from a small population generally violates independence. Changing trial conditions can invalidate constant pp.

A geometric variable models the number of trials until the first success under repeated independent equal-probability trials. A Poisson variable often models counts of events in a fixed exposure when a constant-rate and independence structure is plausible. Each distribution is a model with assumptions, not merely a formula shape. Context should be checked before parameters are estimated. Similar-looking count data can arise from different processes.

Recognize common continuous models

The uniform distribution assigns constant density across a finite interval. Equal-length subintervals then have equal probability. The normal distribution has a symmetric bell shape determined by mean μ\mu and standard deviation σ\sigma. It extends over the entire real line. Many measurement and aggregation processes are approximately normal in central regions.

An exponential distribution models nonnegative waiting times under a constant-rate memoryless process. Its density decreases as time increases. A lognormal distribution models positive quantities whose logarithms are approximately normal. It often has a long right tail. Choosing among these models requires process knowledge and diagnostic checking.

Normality should not be assumed merely because a histogram looks vaguely bell shaped. Sample size, bin choices, tails, truncation, and mixtures can mislead. Quantile plots and subject knowledge provide additional evidence. Even an approximate model may be useful for one purpose and poor for another. The relevant features depend on the intended calculation.

Connect distributions to graphs and simulation

A PMF graph uses separated bars or points because discrete values carry masses. A density graph uses a continuous curve whose areas represent probability. A CDF graph always rises from near zero toward one. These graphs encode different objects. Their vertical axes should not be labeled interchangeably.

Simulation generates outcomes according to a specified distribution. Repeated simulated values form empirical frequencies and averages. As the number of trials grows, these summaries often approach theoretical probabilities and expectations under appropriate conditions. Simulation can build intuition and approximate difficult calculations. It does not validate whether the chosen distribution describes reality.

Empirical distributions summarize observed or simulated data without asserting a smooth theoretical family. The empirical CDF increases by observation weights at recorded values. Comparing it with a fitted model can reveal discrepancies. Graphical comparison is strongest when paired with context and uncertainty. A model is a proposed data-generating description, not the data themselves.

Discrete bars, a continuous density curve, and a cumulative curve are aligned to distinguish mass, density, and cumulative probability.

Diagnose common probability mistakes

One mistake is treating density height as probability. Only an integral over an interval gives continuous probability. Another is expecting the mean to be a possible outcome. The mean is a weighted center and can lie between attainable values. A third is forgetting that standard deviation, not variance, shares the variable’s units.

Another mistake is failing to square a scale factor in variance. If values double, deviations double and squared deviations quadruple. A shift changes the mean but not spread. Unit analysis makes these transformations easier to remember. Variance units expose a missing square.

Model assumptions also cause errors. A binomial model requires a fixed number of trials, binary outcomes, independence, and constant success probability. A normal model can assign impossible negative values to inherently positive quantities if variability is large. A distribution name should be accompanied by an argument for why its structure applies. Calculation cannot repair a mismatched model.

Practice a complete distribution routine

First define the experiment, sample space, and random-variable mapping. Second classify the numerical variable as discrete or continuous under the chosen model. Third specify a PMF, density, or CDF with domain and units. Fourth check nonnegativity and total probability one. Fifth calculate the requested probability or moment and interpret it in context.

Suppose delivery time TT is uniform from 4.0min4.0\,\mathrm{min} to 10.0min10.0\,\mathrm{min}. The density is 16.0min\dfrac{1}{6.0\,\mathrm{min}} over that interval. The probability of delivery between 5.0min5.0\,\mathrm{min} and 8.0min8.0\,\mathrm{min} is interval width divided by total width, or 3.0min6.0min=0.50\dfrac{3.0\,\mathrm{min}}{6.0\,\mathrm{min}}=0.50. The mean is the midpoint 7.0min7.0\,\mathrm{min}. Units cancel in probability but remain in expectation.

As a discrete check, let XX count successes in ten independent trials with p=0.30p=0.30. A binomial model gives E[X]=np=3.0E[X]=np=3.0. Its variance is np(1p)=2.1np(1-p)=2.1, and standard deviation is 2.1=1.45\sqrt{2.1}=1.45. These summaries do not imply that every outcome lies between roughly one and four successes. The complete distribution is needed for exact event probabilities.

Consolidate distribution reasoning

A random variable maps outcomes to numbers. A PMF assigns probability mass to discrete values, while a density assigns probability per unit to continuous regions. A CDF accumulates probability at or below each input and works for either type. Expected value locates a weighted center. Variance and standard deviation quantify spread on squared and original scales.

Transformations change center and spread in predictable ways. Common distribution families package particular assumptions about support, independence, rate, symmetry, and tail behavior. Their formulas become meaningful only when those assumptions fit the process. Graphs and simulation help compare representations. Units keep probabilities, densities, values, and moments distinct.

The strongest solution begins with the outcome process and mapping rather than with a memorized distribution name. It checks normalization, support, endpoint meaning, and dimensional consistency. It interprets averages as long-run or ensemble centers rather than guarantees for individuals. Probability distributions organize uncertainty without eliminating it. Their value lies in making assumptions and consequences explicit.

Knowledge Map

Where this lesson fits

Prerequisites

Probability FoundationsConditional Probability

Continue exploring

Connections

Related lessons

Data and InferenceDescribing DistributionsData and InferenceConfidence Intervals

Applications

  • risk analysis
  • measurement
  • statistical models