4.5. Dependence and Independence#
Conditional distributions help us formalize our intuitive ideas about whether two random variables are independent of each other. Let
Let’s start with some examples and then move to precise definitions and results.
4.5.1. Dependence#
Here is the joint distribution of two random variables
dist1
X=0 | X=1 | X=2 | X=3 | |
---|---|---|---|---|
Y=3 | 0.037037 | 0.000000 | 0.000000 | 0.00000 |
Y=2 | 0.166667 | 0.055556 | 0.000000 | 0.00000 |
Y=1 | 0.250000 | 0.166667 | 0.027778 | 0.00000 |
Y=0 | 0.125000 | 0.125000 | 0.041667 | 0.00463 |
You can see at once that if
Here is an example in which you can’t quickly determine dependence or independence by just looking at the possible values.
dist2
X=3 | X=4 | |
---|---|---|
Y=7 | 0.3 | 0.1 |
Y=6 | 0.2 | 0.2 |
Y=5 | 0.1 | 0.1 |
But you can tell by looking at the conditional distributions of
dist2.conditional_dist('X', 'Y')
X=3 | X=4 | Sum | |
---|---|---|---|
Dist. of X | Y=7 | 0.75 | 0.25 | 1.0 |
Dist. of X | Y=6 | 0.50 | 0.50 | 1.0 |
Dist. of X | Y=5 | 0.50 | 0.50 | 1.0 |
Marginal of X | 0.60 | 0.40 | 1.0 |
It follows (and you should try to prove this), that at least some of the conditional distributions of
In this example, all three conditional distributions of
dist2.conditional_dist('Y', 'X')
Dist. of Y | X=3 | Dist. of Y | X=4 | Marginal of Y | |
---|---|---|---|
Y=7 | 0.500000 | 0.25 | 0.4 |
Y=6 | 0.333333 | 0.50 | 0.4 |
Y=5 | 0.166667 | 0.25 | 0.2 |
Sum | 1.000000 | 1.00 | 1.0 |
4.5.2. Independence#
Here is a joint distribution table in which you can’t immediately tell whether there is dependence.
dist3
X=0 | X=1 | X=2 | X=3 | |
---|---|---|---|---|
Y=4 | 0.000096 | 0.000289 | 0.000289 | 0.000096 |
Y=3 | 0.001929 | 0.005787 | 0.005787 | 0.001929 |
Y=2 | 0.014468 | 0.043403 | 0.043403 | 0.014468 |
Y=1 | 0.048225 | 0.144676 | 0.144676 | 0.048225 |
Y=0 | 0.060282 | 0.180845 | 0.180845 | 0.060282 |
But look what happens when you condition
dist3.conditional_dist('X', 'Y')
X=0 | X=1 | X=2 | X=3 | Sum | |
---|---|---|---|---|---|
Dist. of X | Y=4 | 0.125 | 0.375 | 0.375 | 0.125 | 1.0 |
Dist. of X | Y=3 | 0.125 | 0.375 | 0.375 | 0.125 | 1.0 |
Dist. of X | Y=2 | 0.125 | 0.375 | 0.375 | 0.125 | 1.0 |
Dist. of X | Y=1 | 0.125 | 0.375 | 0.375 | 0.125 | 1.0 |
Dist. of X | Y=0 | 0.125 | 0.375 | 0.375 | 0.125 | 1.0 |
Marginal of X | 0.125 | 0.375 | 0.375 | 0.125 | 1.0 |
All the rows are the same. That is, all the conditional distributions of
Given the value of
You could have drawn the same conclusion by conditioning
dist3.conditional_dist('Y', 'X')
Dist. of Y | X=0 | Dist. of Y | X=1 | Dist. of Y | X=2 | Dist. of Y | X=3 | Marginal of Y | |
---|---|---|---|---|---|
Y=4 | 0.000772 | 0.000772 | 0.000772 | 0.000772 | 0.000772 |
Y=3 | 0.015432 | 0.015432 | 0.015432 | 0.015432 | 0.015432 |
Y=2 | 0.115741 | 0.115741 | 0.115741 | 0.115741 | 0.115741 |
Y=1 | 0.385802 | 0.385802 | 0.385802 | 0.385802 | 0.385802 |
Y=0 | 0.482253 | 0.482253 | 0.482253 | 0.482253 | 0.482253 |
Sum | 1.000000 | 1.000000 | 1.000000 | 1.000000 | 1.000000 |
See More
4.5.3. Independence of Two Events#
The concept of independence seems intuitive, but it is possible to run into trouble by not being careful about its definition. So let’s define it formally.
There are two equivalent definitions of the independence of two events. The first encapsulates the main idea of independence, and the second is useful for calculation.
Two events
4.5.4. Independence of Two Random Variables#
What we have observed in the examples of this section can be turned into a formal definition of independence.
Two random variables
That is, no matter what the given
Equivalently (this needs a proof, which consists of a routine application of definitions), for every
An equivalent definition in terms of the independence of events is that for any values of
That is,
Independence simplifies the conditional probabilities in the multiplication rule.
It is a fact that if
You can prove these facts by partitioning and then using the definition of independence. The proofs are routine but somewhat labor intensive. You are welcome to just accept the facts if you don’t want to prove them.
4.5.5. Mutual Independence#
Events
That’s quite a mouthful. In practical terms it means that it doesn’t matter which of the events you know have happened; chances involving the remaining events are unchanged.
In terms of random variables,
In practice, this just formalizes statements such as “results of different tosses of a coin are independent” or “draws made at random with replacement are independent”.
Try not to become inhibited by the formalism. Notice how the theory not only supports intuition but also develops it. You can expect your probabilistic intuition to be much sharper at the end of this course than it is now!
4.5.6. IID Random Variables#
If random variables are mutually independent and identically distributed, they are called “i.i.d.” That’s one of the most famous acronyms in probability theory. You can think of i.i.d. random variables as draws with replacement from a population, or as the results of independent replications of the same experiment.
Calculations involving i.i.d. random variables are often straightforward. For example, suppose the distribution of
where
The last expression is easy to calculate if you know the numerical values of all the
Quick Check
Let
If
Answer