Computing Library › Probability Statistics
Probability Statistics

Random Variables

A random variable is a function that assigns a number to each outcome, turning events into arithmetic.

From outcomes to numbers

A random variable X is a function from the sample space to the real numbers. It does not have a fixed value; it has a distribution of possible values, each with a probability. Writing X = x really means the event {outcomes ω : X(ω) = x}.

Discrete and continuous

Kronos motion — number counters

A discrete random variable takes values in a countable set and is described by a probability mass function. A continuous random variable takes values in a continuum and is described by a probability density function. Both are unified by the cumulative distribution function F(x) = P(X ≤ x).

Functions of random variables

Any function g(X) of a random variable is again a random variable. This is how derived quantities inherit uncertainty: if a plasma parameter is uncertain, so is any performance figure computed from it. Propagating that uncertainty correctly is a core task of simulation.

Independence and joint behavior

Two random variables are independent if their joint distribution factors into the product of marginals for all values. Independence lets expectations and variances of sums simplify, and it underlies most sampling procedures.

Why the abstraction pays off

By separating the outcome (physical or combinatorial) from the number attached to it, random variables let one toolkit — expectation, variance, transformation rules — apply to dice, queue lengths, measurement noise, and Monte Carlo estimators alike. A stochastic model of a fusion diagnostic and a coin flip are handled by the same algebra.

The distribution, not any single draw, is the object you reason about and estimate from data.