Random variables and events

Any random variable $X$ 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 $11: [S = 11]$; or that the sum of the dice is less than $5: [S < 5]$. These are both sets of outcomes; we could expand $[S = 11] = \{\langle 5, 6\rangle , \langle 6, 5\rangle\}$ or $[S < 5] = \{\langle 1, 1\rangle , \langle 1, 2\rangle , \langle 1, 3\rangle , \langle 2, 1\rangle , \langle 2, 2\rangle , \langle 3, 1\rangle\}$. This allows us to calculate the probability that a random variable has particular properties: $Pr [S = 11] = \frac{2}{36} = \frac{1}{18}$ and $P_r[S < 5] = \frac{6}{36} = \frac{1}{6}$.

The probability mass function of a random variable gives $P_r[X = x]$ for each possible value $x$. For example, our random variable $S$ has the probability mass function shown in Table [*].


Table: Probability mass function for the sum of two independent fair six-sided dice.
$S$ Probability
2 $1/36$
3 $2/36$
4 $3/36$
5 $4/36$
6 $5/36$
7 $6/36$
8 $5/36$
9 $4/36$
10 $3/36$
11 $2/36$
12 $1/36$

For a discrete random variable $X$, the probability mass function gives enough information to calculate the probability of any event involving $X$, since we can just sum up cases using countable additivity. This gives us another way to compute $P_r[S < 5] = P_r[S = 2] + P_r[S = 3] + P_r[S = 4] = \frac{1+2+3}{36} = \frac{1}{6}$ (see table [*]).

For two random variables, the joint probability mass function gives $P_r[X = x \wedge Y = y]$ for each pair of values $x$ and $y$ (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, $X$ and $Y$ are independent if $P_r[X = x \wedge Y = y]$ = $P_r[X = x]·P_r[Y = y]$.

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.