MathematicsCalculus & ProbabilityAdvanced

Random Variable

Also known as:Stochastic VariableVariateChance Variable

A random variable is a function that assigns a numerical value to each outcome in a sample space of a random experiment, providing a bridge between probability theory and real-valued analysis. Discrete random variables take countable values (like the number of heads in coin flips), while continuous random variables take values over an interval (like height or temperature). Random variables are characterized by their probability distributions, which describe the likelihood of each possible value, and are fundamental to statistics, signal processing, and stochastic modeling.

Key Formula

Expected value: E[X] = Σ xᵢ·P(X=xᵢ) for discrete; E[X] = ∫ x·f(x) dx for continuous

LaTeX: E[X] = \sum_{i} x_i \cdot P(X = x_i) \quad \text{(discrete)}, \quad E[X] = \int_{-\infty}^{\infty} x \cdot f(x)\,dx \quad \text{(continuous)}

SymbolMeaningUnit
XRandom variabledepends on context
xᵢSpecific value taken by the random variabledepends on context
P(X=xᵢ)Probability mass function (discrete case)dimensionless
f(x)Probability density function (continuous case)per unit of x
E[X]Expected value (mean) of the random variablesame as X

Worked Example

Problem

A random variable X represents the outcome of rolling a fair die. Compute E[X], the expected value.

Solution

Step 1: Identify possible values: x = {1, 2, 3, 4, 5, 6}, each with P(X=x) = 1/6. Step 2: Apply the expected value formula: E[X] = Σ xᵢ·P(X=xᵢ). Step 3: Compute: E[X] = 1·(1/6) + 2·(1/6) + 3·(1/6) + 4·(1/6) + 5·(1/6) + 6·(1/6). Step 4: Simplify: E[X] = (1+2+3+4+5+6)/6 = 21/6 = 3.5.

Answer

E[X] = 3.5 (the average outcome of a fair die roll)

Discrete vs. Continuous Random Variables

FeatureDiscrete Random VariableContinuous Random VariableExample
ValuesCountable set {x₁, x₂, …}Interval of real numbersHeads count vs. height
Probability functionPMF: P(X=x)PDF: f(x), where P(X=x)=0Poisson vs. Normal
Sum/IntegralΣ P(X=xᵢ) = 1∫ f(x)dx = 1Normalization condition
Expected valueE[X] = Σ xᵢ·P(X=xᵢ)E[X] = ∫ x·f(x) dxMean of distribution
VarianceVar(X) = E[X²] − (E[X])²Var(X) = ∫(x−μ)²·f(x)dxSpread of distribution
Common examplesBinomial, Poisson, GeometricNormal, Exponential, UniformDie roll vs. wait time

Interactive Tools

Khan Academy Random Variables

Open Tool

WolframAlpha Probability Distributions

Open Tool

Brilliant.org Random Variables

Open Tool
Diagram showing a random variable mapping outcomes from a sample space to real numbers

Wikimedia Commons, CC BY-SA

Related Terms

The term "random variable" (also called "stochastic variable") developed in the early 20th century as probability theory was formalized. "Random" comes from Old French "randon" (speed, impetuosity), and "variable" from Latin "variabilis" (changeable). The modern formalization as a measurable function was given by Andrey Kolmogorov in his 1933 axiomatic foundations of probability.

probabilitystatisticsdistributionsexpected-valuediscretecontinuous