In a previous post called An Example on Calculating Covariance, we calculated the covariance and correlation coefficient of a discrete joint distribution where the conditional mean is a linear function of . In this post, we give examples in the continuous case. Problem A is worked out and Problem B is left as exercise.
The examples presented here are also found in the post called Another Example of a Joint Distribution. Some of the needed calculations are found in this previous post.
____________________________________________________________________
Problem A
Let be a random variable with the density function where . For each realized value , the conditional variable is uniformly distributed over the interval , denoted symbolically by . Obtain solutions for the following:
 Calculate the density function, the mean and the variance for the conditional variable .
 Calculate the density function, the mean and the variance for the conditional variable .
 Use the fact that the conditional mean is a linear function of to calculate the covariance and the correlation coefficient .
Problem B
Let be a random variable with the density function where . For each realized value , the conditional variable is uniformly distributed over the interval , denoted symbolically by . Obtain solutions for the following:
 Calculate the density function, the mean and the variance for the conditional variable .
 Calculate the density function, the mean and the variance for the conditional variable .
 Use the fact that the conditional mean is a linear function of to calculate the covariance and the correlation coefficient .
____________________________________________________________________
Background Results
Here’s the idea behind the calculation of correlation coefficient in this post. Suppose and are jointly distributed. When the conditional mean is a linear function of , that is, for some constants and , it can be written as the following:
Here, and . The notations and refer to the standard deviation of and , respectively. Of course, refers to the correlation coefficient in the joint distribution of and and is defined by:
where is the covariance of and and is defined by
or equivalently by .
Just to make it clear, in the joint distribution of and , if the conditional mean is a linear function of , then we have:
____________________________________________________________________
Discussion of Problem A
Problem A1
Since for each , has the uniform distribution , we have the following:
for
Problem A2
In a previous post called Another Example of a Joint Distribution, the joint density function of and is calculated to be: . In the same post, the marginal density of is calculated to be: (exponentially distributed). Thus we have:
Thus the conditional variable has an exponential distribution that is shifted to the right by the amount . Thus we have:
Problem A3
To compute the covariance , one approach is to use the definition indicated above (to see this calculation, see Another Example of a Joint Distribution). Here we use the idea that the conditional mean is linear in . From the previous post Another Example of a Joint Distribution, we have:
Plugging in and , we have the following calculation:
____________________________________________________________________
Answers for Problem B
Problem B1
Problem B2

where and
Problem B3
____________________________________________________________________