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.
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)}
| Symbol | Meaning | Unit |
|---|---|---|
| X | Random variable | depends on context |
| xᵢ | Specific value taken by the random variable | depends 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 variable | same as X |
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)
| Feature | Discrete Random Variable | Continuous Random Variable | Example |
|---|---|---|---|
| Values | Countable set {x₁, x₂, …} | Interval of real numbers | Heads count vs. height |
| Probability function | PMF: P(X=x) | PDF: f(x), where P(X=x)=0 | Poisson vs. Normal |
| Sum/Integral | Σ P(X=xᵢ) = 1 | ∫ f(x)dx = 1 | Normalization condition |
| Expected value | E[X] = Σ xᵢ·P(X=xᵢ) | E[X] = ∫ x·f(x) dx | Mean of distribution |
| Variance | Var(X) = E[X²] − (E[X])² | Var(X) = ∫(x−μ)²·f(x)dx | Spread of distribution |
| Common examples | Binomial, Poisson, Geometric | Normal, Exponential, Uniform | Die roll vs. wait time |
Wikimedia Commons, CC BY-SA
Probability is a numerical measure of the likelihood that a specific event will occur, expressed as a value between 0 (impossible) and 1 (certain). It quantifies uncertainty by assigning weights to outcomes in a sample space, and forms the mathematical foundation for statistics, stochastic processes, and decision theory. Probability theory underpins fields as diverse as quantum mechanics, financial modeling, machine learning, and epidemiology.
A sample space is the complete set of all possible outcomes of a random experiment, typically denoted by Ω (omega) or S. Every event in probability theory is defined as a subset of the sample space, and the probability function assigns values to events in a way consistent with the axioms of probability. Correctly identifying the sample space is the critical first step in any probabilistic analysis, as it determines which outcomes are possible and how they are structured.
Conditional probability is the probability of an event A occurring given that another event B has already occurred, denoted P(A|B) and read "probability of A given B." It updates the original probability by restricting the sample space to the outcomes where B has occurred. Conditional probability is the cornerstone of Bayesian reasoning, decision trees, diagnostic testing, and machine learning classifiers.
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.