👉 In mathematics, a random variable is a mathematical object that can take on any value from a set of possible outcomes. The terms "random" and "variable" are often used interchangeably. A random variable is a function that maps some input to an output (e.g., the number of heads in a coin flip). It can be discrete or continuous, but it's usually considered to be either discrete or continuous because its domain is finite. In probability theory, a random variable is also called