# ProbabilityRandom Variables

An event may be regarded as *real number*.

For example, suppose that you will receive a dollar for each head flipped in our two-fair-flips experiment. Then your payout might be 0 dollars, 1 dollar, or 2 dollars. Because represents a value which is random (that is, dependent on the outcome of a random experiment), it is called a **random variable**. A random variable which takes values in some finite or countably infinite set (such as , in this case) is called a **discrete** random variable.

Since a random variable associates a real number to each outcome of the experiment, in mathematical terms a random variable is a *function* from the sample space to . Using function notation, the dollar-per-head payout random variable satisfies

Note that a random variable , as a function from to , does not have its own uncertainty: for each outcome , the value of is consistently and perfectly well defined. The randomness comes entirely from thinking of as being selected randomly from . For example, the amount of money you'll take home from tomorrow's poker night is a random quantity, but the function which maps each poker game outcome to your haul is fully specified by the rules of poker.

We can combine random variables using any operations or functions we can use to combine numbers. For example, suppose is defined to be the number of heads in the first of two coin flips. In other words, we define

and is defined to be the number of heads in the second flip. Then the random variable maps each to . This random variable is equal to , since for every .

**Exercise**

Suppose that the random variable represents a fair die roll and is defined to be the remainder when is divided by .

Define a six-element probability space on which and may be defined, and find for every integer value of .

*Solution.* We set From the sample space, we see that for any integer value we have

**Exercise**

Consider a sample space and an event . We define the random variable by

The random variable is called the

*Solution.*

Since if and only if and we see that

Because may be equal to 2 (on the intersection of and ), we cannot have in general.

We observe that because if and only if