Random variables and their distributions
A random variable assigns a number to each outcome; its distribution says how the probability is laid out across those numbers.
An outcome like "the coin came up heads" is hard to integrate. A number like "the number of heads in ten tosses" is not. A random variable is the bridge: a function that reads an outcome and returns a number, so that probability becomes a distribution over the number line.
A random variable is a measurement, not a variable
The randomness lives in the outcome, not in the variable. Once the outcome is fixed, the random variable is a perfectly ordinary number. What we study is the distribution of those numbers across the sample space.
Switch between the binomial, Poisson and normal laws below. The bars or curve are the pmf or pdf; the shaded area is the probability up to the threshold.
Pick a law, set its parameters, slide the threshold
- mean
- 4.000
- variance
- 2.400
- σ
- 1.549
- P(X ≤ 4)
- 0.6331
Binomial and Poisson are discrete — the height of each bar is a probability and the bars sum to one. The normal is continuous, so it uses a density and only areas are probabilities; the shaded area is P(X ≤ threshold). The mean and variance readouts are computed from the distribution itself, which is the point: parameters control shape, and shape controls the summaries.
Discrete and continuous
A discrete random variable takes a countable set of values. Its probability mass function (pmf) gives , with
A continuous random variable takes values in an interval. Its probability density function (pdf) satisfies and
For continuous variables, for every single point; only intervals have non-zero probability, given by the integral. This is the single biggest conceptual break from the discrete case, and it is why the normal distribution is drawn as a density rather than a set of bars.
Both kinds share the cumulative distribution function (cdf)
which is non-decreasing, goes from 0 to 1, and works identically for both. The widget's threshold readout is a cdf value.
The named distributions
Three laws cover an enormous amount of ground:
- Binomial. is the number of successes in independent trials with success probability . The widget computes , with mean and variance . The shape is symmetric when and skews as moves to the extremes.
- Poisson. counts events in a fixed interval when they occur independently at constant rate . Then , and — the famous fact — mean and variance are both . It is the limit of the binomial when grows and .
- Normal. The bell curve, with density , mean and variance . It is the limit in the central limit theorem, which is why it appears whenever many small independent effects are added.
Density is not probability
A density can exceed 1 for a narrow distribution, because it measures probability per unit of x. Only the area under it is a probability, and only intervals have non-zero area. Never report a value of a pdf as a probability.
Standardization
Subtracting the mean and dividing by the standard deviation gives a standardized variable with mean 0 and variance 1:
This is how a normal table or a computer cdf can serve every normal distribution at once: transform to , then look up. It is also why standardizing features is a standard first step in machine learning — many estimators behave as if the inputs were already on a common scale.
Illustrative vs real
The widget draws tidy named distributions with a handful of parameters. Real data rarely matches a textbook law exactly; the value of the named distributions is as models and as limits, not as literal descriptions. The binomial's assumption of independent, identically distributed trials is the one most often violated, and it is the one to check before trusting a result.
Check yourself
Eduspheria wiki · Mathematics for AI, Probability
0 / 5 answered
Where next: expectation and variance — the two numbers that summarize a distribution.