What is a random variable in probability theory?

Updated May 17, 2026

Short answer

A random variable is a function that assigns numerical values to outcomes of a random process.

Deep explanation

A random variable maps outcomes from a sample space to real numbers. It allows probabilistic events to be analyzed mathematically. There are two types: discrete (finite/countable values) and continuous (uncountable values). Random variables form the foundation for expectation, variance, and distributions.

Real-world example

Modeling daily stock price changes as a random variable.

Common mistakes

  • Thinking a random variable is a variable that changes randomly rather than a function mapping outcomes.

Follow-up questions

  • What is the difference between a random variable and a variable in programming?
  • What is a discrete random variable?

More Probability interview questions

View all →