Functions of Random Variables
In this section we will discuss what it means to take a function of a random variable, and we will build understanding for why a function of a random variable is a random variable. That is, if is a random variable, then , , and are also random variables, as is for any function .
Definition: Function of an r.v.
For an experiment with sample space , an r.v. , and a function , is the r.v. that maps to for all .
Taking for concreteness, the following figure represents by directly labeling the sample outcomes. If crystallizes to 4, then crystallizes to 2.
Warning Category Errors
Many common mistakes in probability can be traced to confusing two of the following fundamental objects with each other: distributions, random variables, events, and numbers. Such mistakes are examples of category errors. In general, a category error is a mistake that doesn't just happen to be wrong, but in fact is necessarily wrong since it is based on the wrong category of object.
For example, answering the question ''How many people live in Boston?" with ''" or ''" or ''pink elephants" would be a category error - we may not know the population size of a city, but we do know that it is a nonnegative integer at any point in time. To help avoid being categorically wrong, always think about what category an answer should have.
An especially common category error is to confuse a random variable with its distribution. The following saying sheds light on the distinction between a random variable and its distribution:
''The word is not the thing; the map is not the territory.'' - Alfred Korzybski
We can think of the distribution of a random variable as a map or blueprint describing the r.v. Just as different houses can share the same blueprint, different r.v.s can have the same distribution, even if the experiments they summarize, and the sample spaces they map from, are not the same.
Independence of Random Variables
Just as we had the notion of independence of events, we can define independence of random variables. Intuitively, if two r.v.s and are independent, then knowing the value of gives no information about the value of , and vice versa.
Definition: Independence of two r.v.s
Random variables and are said to be independent if
for all . In the discrete case, this is equivalent to the condition
for all with in the support of and in the support of .
Example
In a roll of two fair dice, if is the number on the first die and is the number on the second die, then is not independent of . To see why, note that
Since we have found a pair of values for which
and are dependent. This also makes sense intuitively: knowing the sum of the dice is 12 tells us their difference must be 0, so the r.v.s provide information about each other.
If and are independent then it is also true, for example, that is independent of , since if provided information about then would give information about (using and as intermediaries). In general, if and are independent then any function of is independent of any function of .
i.i.d.
Definition: i.i.d.
We will often work with random variables that are independent and have the same distribution. We call such r.v.s independent and identically distributed, or i.i.d. for short.
By taking a sum of i.i.d. Bernoulli r.v.s, we can write down the story of the Binomial distribution in an algebraic form.
Theorem
If , viewed as the number of successes in n independent Bernoulli trials with success probability , then we can write where the are i.i.d. .
Proof:
Theorem
If , , and is independent of , then .
Proof: We present three proofs, since each illustrates a useful technique.
Definition: Conditional Independence of r.v.s
Random variables and are conditionally independent given an r.v. if for all and all in the support of ,
For discrete r.v.s, an equivalent definition is to require
This is the definition of independence, except that we condition on everywhere, and require the equality to hold for all in the support of .
Definition: Conditional PMF
For any discrete r.v.s and , the function , when considered as a function of for fixed , is called the conditional PMF of given .
Independence of r.v.s does not imply conditional independence, nor vice versa. First let us show why independence does not imply conditional independence.