Lably
Skip to content

Random variable

Variable representing a random phenomenon

  • 19 min read
  • 9 chapters
  • 1 lab on Lably

Learn it on Lably

  • the domain is the set of possible outcomes in a sample space (e.g. the set {H,T} (which are the possible upper sides of a flipped coin heads H or tails T as the result from tossing a coin); and
  • the range is a measurable space (e.g. corresponding to the domain above, the range might be the set {−1,1} if say heads H mapped to −1 and T mapped to 1). Typically, the range of a random variable is a subset of the real numbers.

Informally, randomness typically represents some fundamental element of chance, such as in the roll of a die; it may also represent uncertainty, such as measurement error. However, the interpretation of probability is philosophically complicated, and even in specific cases is not always straightforward. The purely mathematical analysis of random variables is independent of such interpretational difficulties, and can be based upon a rigorous axiomatic setup.

In the formal mathematical language of measure theory, a random variable is defined as a measurable function from a probability measure space (called the sample space) to a measurable space. This allows consideration of the pushforward measure, which is called the distribution of the random variable; the distribution is thus a probability measure on the set of all possible values of the random variable. It is possible for two random variables to have identical distributions but to differ in significant ways; for instance, they may be independent.

It is common to consider the special cases of discrete random variables and absolutely continuous random variables, corresponding to whether a random variable is valued in a countable subset or in an interval of real numbers. There are other important possibilities, especially in the theory of stochastic processes, wherein it is natural to consider random sequences or random functions. Sometimes a random variable is taken to be automatically valued in the real numbers, with more general random quantities instead being called random elements. A random variate is a particular outcome or realization of a random variable.

According to George Mackey, Pafnuty Chebyshev was the first person "to think systematically in terms of random variables".

Definition

A random variable X is a measurable function X:Ω→E from a sample space Ω as a set of possible outcomes to a measurable space E. For the measurability of X to be meaningful, the sample space Ω needs to belong to a probability triple (Ω,F,P) (see the measure-theoretic definition). A random variable is often denoted by capital Roman letters such as X,Y,Z,T.

The probability that X takes on a value in a measurable set S⊆E is written as P⁡(X∈S)=P⁡({ω∈Ω∣X(ω)∈S}).

Standard case

In many cases, X is real-valued, i.e. E=R. In some contexts, the term random element (see extensions) is used to denote a random variable not of this form.

When the image (or range) of X is finite or countably infinite, the random variable is called a discrete random variable and its distribution is a discrete probability distribution, i.e. can be described by a probability mass function that assigns a probability to each value in the image of X. If the image is uncountably infinite (usually an interval) then X is called a continuous random variable. In the special case that it is absolutely continuous, its distribution can be described by a probability density function, which assigns probabilities to intervals; in particular, each individual point must necessarily have probability zero for an absolutely continuous random variable. Not all continuous random variables are absolutely continuous.

Any random variable can be described by its cumulative distribution function, which describes the probability that the random variable will be less than or equal to a certain value.

Extensions

The term "random variable" in statistics is traditionally limited to the real-valued case (⁠E=R⁠). In this case, the structure of the real numbers makes it possible to define quantities such as the expected value and variance of a random variable, its cumulative distribution function, and the moments of its distribution.

However, the definition above is valid for any measurable space E of values. Thus one can consider random elements of other sets E, such as random Boolean values, categorical values, complex numbers, vectors, matrices, sequences, trees, sets, shapes, manifolds, and functions. One may then specifically refer to a random variable of type E, or an E-valued random variable.

This more general concept of a random element is particularly useful in disciplines such as graph theory, machine learning, natural language processing, and other fields in discrete mathematics and computer science, where one is often interested in modeling the random variation of non-numerical data structures. In some cases, it is nonetheless convenient to represent each element of E, using one or more real numbers. In this case, a random element may optionally be represented as a vector of real-valued random variables (all defined on the same underlying probability space Ω, which allows the different random variables to covary). For example:

  • A random word may be represented as a random integer that serves as an index into the vocabulary of possible words. Alternatively, it can be represented as a random indicator vector, whose length equals the size of the vocabulary, where the only values of positive probability are (1000⋯), (0100⋯), (0010⋯) and the position of the 1 indicates the word.
  • A random sentence of given length N may be represented as a vector of N random words.
  • A random graph on N given vertices may be represented as a N×N matrix of random variables, whose values specify the adjacency matrix of the random graph.
  • A random function F may be represented as a collection of random variables F(x), giving the function's values at the various points x in the function's domain. The F(x) are ordinary real-valued random variables provided that the function is real-valued. For example, a stochastic process is a random function of time, a random vector is a random function of some index set such as 1,2,…,n, and a random field is a random function on any set (typically time, space, or a discrete set).

Sign in to keep reading

8 more chapters are free with a Lably account.

More in Statistics and probability