Introduction to Joint Random Variables
Consider 2 random variables over a joint sample space, and .
Note that techniques in this entire section generalize to variable functions, though for simplicity we will only cover the 2-variable case.
Discrete Case
In the discrete case, if and are discrete random variables, then the joint probability distribution of and , denoting the probability of the value pair occurring, is given as
In the discrete case of 2 random variables, we often find it useful to represent as a table of values, where rows denote one random variable, and columns denote the other.
The discrete joint pdf has the following properties:
Example: Joint Probability Distributions (Discrete Case)
There are 3 (different) math books, 2 history, 4 physics.
Before, we could only define a single random variable for one type of book specifically. Now, using joint distributions, we can define multiple random variables at once.
Let be the total math books chosen, and be the total history books chosen, out of 2 books total. We can use to find the probability of multiple random variables occurring at once.
Furthermore, given , the joint cumulative probability distribution of and is given as
Where is the pdf of the joint distribution.
The discrete joint cdf has the following properties:
- If , and , then .
Continuous Case
In the continuous case, if and are continuous random variables, then the joint probability density function over and is given as the function satisfying
Where is a region on the -plane.
The continuous joint pdf has the following properties:
- for all .
Furthermore, given , we can find the joint cumulative probability distribution of and as
Similar to the continuous one-variable case, we can differentiate the cdf to find our pdf, and integrate our pdf to find our cdf. Note that order of differentiation and integration do not matter.
Consider the following examples.
Example: Joint Continuous Distributions
Given the joint cdf
Find .
To find this, we first find by taking the partial derivative of the cdf twice.
Example: Joint Probability Distribution (2)
In a study on workers, the hours spent using their phones, and the hours spent on their job is approximated by the joint pdf
What is the probability a person spends at least twice as much time on their phone than doing their job?
To find this, we want to find .
Example: Joint Continuous Distributions - PDF to CDF
Given the above joint continuous pdf, find the cdf of and .
By virtue of multiple variables, we’ll have to address numerous cases to find .
- If , then .
- If , then .
- If ,
- If ,
- If , ,
Putting these cases together, we find cdf
Conditional Distributions and Independence
If is the joint pdf of a random variable, then the marginal distribution of , denoting the total probability of occurring over all cases , is given as
The marginal distribution of follows similarly.
Note that in a marginal distribution, we sum / integrate over the other variable.
Now, given joint pdf and marginal distribution of , we can find the conditional distribution of given as
This definition is analogous to the definition of conditional probability in the one-variable case.
Similarly, the cumulative conditional distribution of given is given as
Note that for the cumulative conditional distribution, is fixed.
Example: Joint Conditional Distributions
Let the joint pdf of and be given as
Find .
First, we find the marginal pdf as
and use this to find as
Finally, we use this to find our answer as
Let be random variables, and let be the marginal distribution of random variable .
We say that random variables are independent if and only if for all that take on, we have that
In other words, the joint probability distribution of all of the variables equals the product of their marginal probability distributions.
It naturally follows from this that if and are independent, then
This is the same as our one-variable case! It tells us that the conditioning of does not affect our probability of , if they are independent.
Consider the following examples for independence.
Example: Independence on Joint Distributions
Given the joint pdf of
We find that and are independent, as .
Knowing independence can be highly useful, and simplify many computations. For example, it gives us an easy shortcut for evaluating combinations of random variables!
Theorem: Summation of Independent Random Variables
Let be independent random variables with pmf/pdfs given as . Define .
Then, for the continuous case,
Called the convolution of the two functions.
Example: Summation of Independent Random Variables
Let and . Furthermore, let be independent and assume
What is the pdf of random variable ?
We can find this using the convolution of and .
Note that we can only do this because our random variables are independent of one another.
Transformations of Joint Distributions
Recall in the one-variable case, that for random variable with pdf , and random variable , we can find the pdf of as
Let’s generalize this fact to multiple variables. Given joint pdf and random variables and , how do we find the joint pdf of and ?
Assuming that the partial derivatives exist, and that and are one-to-one, we can perform a change in variables to find our pdf (similar to multivariable calculus). This gives us the following theorem:
Theorem: Transforming Joint Distributions
Let be random variables with joint pdf and let there be random variables
Then, the joint pdf of and , , is given as
Where the Jacobian, (provided ) is given as
Note: One can show that with ,
Which can be helpful if evaluates to a constant.
Consider the following examples.
Example: Transforming Joint Distributions
Let the joint pdf of random variables be given as
Find the joint pdf of random variables where
First, we solve for in terms of .
We can use this perform a change of variables using our theorem.
Expectation and Variance
Let be random variables. If is their pdf, then the expected value of some combination of and , given as is given as
Provided the values exist.
Theorem: Linearity of Expectation
Let be constants, and be random variables. Then,
In particular, we can apply this theorem for and on and , to find
Example: Expectation
Let and be random variables with pdf given as
We can find the expectation of some combination of and , say, .
Recall that if are independent, then . Supposing that are independent, we find that
This is formalized in the following theorem.
Theorem: Independence and Expectation
If are independent, then
Note that this does not, however, imply the converse. In other words, does not necessarily mean and are independent.
When and are not independent, we can measure their relationship with one another. One measure that may help in doing this is the covariance, denoted .
is seen as a measure of the linear relationship of and .
The covariance tells us the direction of the relationship between and .
- If covariance is negative, then and have a negative relationship (as increases, decreases)
- If covariance is positive, then and have a positive relationship (as increases, increases)
Theorem: Covariance
Proof
It follows from this theorem that if and are independent, then (they are uncorrelated). Other properties of our covariance are given below:
Example: Covariance
Let the pdf of be given as
Find .
We find
Note that using the definition of covariance, we can derive expressions for the covariance of sums of random variables. This is given in the following theorem.
Theorem: Covariance of Sums
Let be random variables, and assume
Then,
Corollary
If , then
In particular, if are independent, then is the sum of the variances of !
Example: Variance of Sums
Let the joint pdf of be given as
Find , where .
We can apply our theorem for . Note that because the variance of a constant is 0, we see that
We can now calculate
We can further use covariance to define correlation coefficient of and as
measuring the “power” of the relationship - or in other words, how related and are.
Properties of the correlation coefficient are given below.
- if and only if , for some .
Conditional Expectation
Let and be random variables, and let be a function on random variable .
Then, the conditional expectation of given is defined as
In particular, if is given as , then we define the conditional moment as . We can use this to define the following:
We also have the following properties:
Theorem: Conditional Expectation and Expectation / Variance
The following two equalities are true.
We prove them below.
Proof (1)
First, define function as
We want to use this to show that .
Here, we apply the definition of conditional probability (multivariate case)
Proof (2)
We start from the right-hand side expression, and find that
Theorem: Law of Total Expectation
We have
We can generalize this fact further. If partition the sample space, then
Example: Conditional Expectation
Suppose that
Now suppose we have random variable , and define
On the cases , then
We use this to find expected values
This gives us the expected value distribution
We can then use this to find !
Example: Conditional Expectation (2)
Let
Find .
Given that
We can find by finding
Let . We find
Sometimes, we can use conditional expectation to find expected values that are recursively defined in terms of themselves. See the following examples.
Example: Conditional Expectation (3)
A man is stuck in a cave. There are 3 tunnel exits:
- Tunnel 1 takes 2 hours to get out.
- Tunnel 2 takes 5 hours, but returns to the starting point.
- Tunnel 3 takes 7 hours, but returns to the starting point.
If he picks a tunnel at random each time, what is the expected time until he gets out?
Let be the total hours to get out, and be the tunnel he enters initially. We want
Note that we express recursively in terms of itself, as if the man enters tunnel 2 or 3, he ends up back where he started but with additional time spent.
Solving for , we find .
Example: Conditional Expectation (4)
A biased coin has . We toss the coin until we get 2 consecutive heads. What is the number of expected tosses?
Let:
- be the event of the sequence .
- be the event of the sequence .
- be the event of the sequence of just .
As partition the sample space of the toss sequences, we can find our expected value by breaking it up across these different sequences.
Define as the total number of tosses needed until we get 2 consecutive heads. Then,
Solving for , we find .