3.1 Random variables

Random variables (RVs)

For a given sample space \(\Omega\) of some experiment, a random variable is defined as a function that assigns a number to each outcome.

Example

Random variable \(X\):

Roll a die 🎲 and record the roll.

Example

Random variable \(X\):

Roll a pair of dice 🎲 🎲 and record the maximum roll.

Is it a random variable?

Roll a pair of dice 🎲 🎲

  • \(X\): the sum of the two rolls
  • \(Y\): the number of doubles we get
  • \(Z\): the second roll raised to the square (e.g., \(3^2=9\))
  • \(W\): the sequence of two rolls (e.g., 5 followed by 3)

Discrete random variables

The variable takes finite or countably infinite values.

  • Toss a coin 4 times, the number of heads
  • Roll a die 🎲 and record the number it lands on
  • The number of orders that a shop receives in a day

Continuous random variables

The variable takes infinitely many, uncountable values.

  • The speed of riding a bicycle
  • The water level of a dam
  • The time when customers arrive at a shop

Rule of thumb:

  • If you can count it, it is discrete.
  • If you need to measure it, it is continuous.

Functions of random variables

\(Y\) is a function of a random variable \(X\)

\[Y=g(X)\]

Is \(Y\) a random variable?