Random variables · Definition

Random variable

probabilityrandom variables

Before you start you need to know

It summarizes each outcome of an experiment with a number, so that the whole machinery of calculus can be applied to chance phenomena.

Definition

A random variable \(X\) is a function that assigns a real number to each outcome of the sample space \(\Omega\) of a random experiment.

\[X:\Omega\to\mathbb{R}\]

The name is misleading: a random variable is neither a variable nor random by itself. It is a fixed function \(X\) that sends each outcome \(\omega\) of the sample space to a number \(X(\omega)\). The randomness lives in the experiment, which decides which \(\omega\) occurs; \(X\) only translates it into a number. When rolling two dice, \(X(a,b)=a+b\) turns the pair into its sum.

Thanks to \(X\), events can be described with numerical conditions. The set \(\{X=4\}\) is the event made of all outcomes \(\omega\) with \(X(\omega)=4\); for the sum of two dice they are \((1,3)\), \((2,2)\) and \((3,1)\). Likewise \(\{X\le 5\}\) or \(\{X\text{ is even}\}\) are events, and their probability is computed with the probability measure of the original space, for instance \(P(X=4)=\tfrac3{36}\).

A random variable is discrete if it takes isolated values that can be listed (number of heads, calls, defects) and continuous if it can take any value in an interval (a time, a height, a temperature). The distinction decides how its distribution is described: with a mass function in the discrete case and a density function in the continuous one.

Two different variables can live in the same experiment and behave very differently: with two dice, the sum \(a+b\) and twice the first die \(2a\) are not distributed alike. A typical mistake is to confuse the variable with one of its values, or the function \(X\) with the event \(\{X=x\}\).

Think about it

If \(X\) is the number of heads in three tosses, how many outcomes make up the event \(\{X=2\}\)?

Three: HHT, HTH and THH.

Can a constant, such as \(X(\omega)=5\) for every \(\omega\), be a random variable?

Yes: it is a valid function from the sample space to the reals, even though its value carries no uncertainty.

Exercises 10

References

  • Joseph K. Blitzstein, Jessica Hwang, Introduction to Probability, 2nd edition, CRC Press, 2019. §3.1
  • Sheldon Ross, A First Course in Probability, 10th edition, Pearson, 2019. §4.1
  • Larry Wasserman, All of Statistics, 1st edition, Springer, 2004. §2.1