Any random variable allows us to define events based on its possible values. Typically these are expressed by writing a predicate involving the random variable in square brackets. An example would be the probability that the sum of two dice is exactly ; or that the sum of the dice is less than . These are both sets of outcomes; we could expand or . This allows us to calculate the probability that a random variable has particular properties: and .
The probability mass function of a random variable gives for each possible value . For example, our random variable has the probability mass function shown in Table .
For a discrete random variable , the probability mass function gives enough information to calculate the probability of any event involving , since we can just sum up cases using countable additivity. This gives us another way to compute (see table ).
For two random variables, the joint probability mass function gives for each pair of values and (this generalizes in the obvious way for more than two variables). To the extent that we can, we will try to avoid continuous random variables (opposite of discrete, e.g., coin flip and dice flip).
Two or more random variables are independent if all sets of events involving different random variables are independent. In terms of probability mass functions, and are independent if = .
For discrete probability spaces, any function on outcomes can be a random variable. The reason is that any event in a discrete probability space has a well-defined probability. For more general spaces, in order to be useful, events involving a random variable should have well-defined probabilities. For discrete random variables that take on only countably many values.