We can think of a random variable as the numeric result of operating a non-deterministic mechanism or performing a non-deterministic experiment to generate a random result. For example, rolling a die and recording the outcome yields a random variable with range {1,2,3,4,5,6}. Picking a random person and measuring their height yields another random variable.
Mathematically, a random variable is defined as a measurable function from a probability space to some measurable space. This measurable space is usually taken to be the real numbers with the Borel σ-algebra, and we will always assume this in this encyclopedia, unless otherwise specified.
If a random variable X, defined on the probability space (Ω, P), is given, we can ask questions like "How likely is it that the value of X is bigger than 2?". This asks about the probability of the event {s in Ω : X(s) > 2} which is often written as P(X > 2) for short.
Recording all these probabilities of ouput ranges of a real-valued random variable X yields the probability distribution of X. The probability distribution "forgets" about the particular probability space used to define X and only records the probabilities of various values of X. Such a probability distribution can always be captured by its cumulative distribution function and sometimes also using a probability density function.
Given a random variable, it is often important to know what its "average value" is. For instance, what is the average you get when you roll a die, or measure a human's height? This is captured by the mathematical concept of expected value of a random variable.
See also: discrete random variable, continuous random variable, probability distribution