For many of the experiments that we model, we are not interested in the
outcomes themselves, but instead in some numerical attribute associated with
the outcome. In the example above that modelled the games played by two
gamblers, we were not interested in the particular outcome,
, but instead all that was important was the number of
wins, in this case 4, associated with the outcome. This numerical attribute,
the number of wins, is an attribute possessed by each possible outcome of the
experiment. We call such numerical attributes random variables.
Formally, a random variable is a function,
,
that assigns a real number to each outcome of an experiment. In the case of
the gambler's problem, if
denotes the number of wins in 10 games,
and if
, then
. If all that we care to
observe in an experiment is the value of
, then the only events
we need to work with are events defined in terms of the random variable.
For example,
One requirement that we have regarding random variables is that we must be able
to obtain the probability of events in which the random variable belongs to an
interval of real numbers, along with all the sets one can obtain by finite
unions, intersections, and complements of such events. The probabilities of
events of this form can be obtained from the distribution function
(d.f.) of the random variable, defined by

The sample space of a random variable is the set of all possible
values of the random variable. If the sample space is finite or countably
infinite, we say that the random variable is discrete. If the
distribution function is differentiable, we say that the random variable is
continuous. If
is a discrete random variable, it is usually
easier to obtain probabilities of events in terms of
its probability mass function (pmf), defined by
.
The correspondence between the d.f. of a random variable and its pmf is given
by the following relationships:
The basic axioms of probability can be used to show that distribution functions of random variables satisfy the following properties:
Probability mass functions satisfy the properties,
In the previous section, we obtained the probability of randomly
selecting
females for a subcommittee of size 5 from a committee that
has 40 males and 20 females. Let
denote the number of females
selected for the subcommittee. Then the p.m.f. of this random variable is given
by,