A random variable, also called random quantity, aleatory variable, or stochastic variable, is a mathematical formalization of a quantity or object which depends on random events. It is a mapping or a function from possible events in a sample space to a measurable space, often the real numbers.