A quantity that takes different numerical values according to the result of a particular experiment. For example, if a die is rolled, then the number rolled is a random variable on the sample space of possible rolls.
A random variable is discrete if the set of possible values is finite or denumerable. For a discrete random variable, the probability of its taking any particular value is given by the probability mass function.
A random variable is continuous if possible outcomes are distributed over uncountably many values and the cumulative distribution function FX(x) = P(X ≤ x) is a continuous function. If FX is piecewise differentiable, then the derivative fX is the probability density function.
Some random variables are mixed in the sense of having both discrete and continuous characteristics. For example, in modelling the lifetime T of a light bulb, there may be a non-zero probability p of the light bulb blowing immediately (so T=0) and the remaining 1–p is distributed over T>0 continuously.
Formally, a random variable on a probability space Ω is a measurable function X:Ω→ℝ.