Math 342 Chapter 5 Example, Tom Linton. Mathematica notebook

Let the joint-density function for two continuous random variables be given by:
[Graphics:jointexamplegr2.gif][Graphics:jointexamplegr1.gif]
for (x,y) satisfying 0 < y <= x <= 1. The density function f[x,y] takes the value 0 for all other values of x and y.

What is the value of the constant c?

Since the integral over all values of x and y must be one, we integrate over all values of x and y where f[x,y] is non-zero and set the result equal to one. Here is the region where f[x,y] takes non-zero values. The picture helps set up appropriate bounds for the integration.

[Graphics:jointexamplegr2.gif][Graphics:jointexamplegr3.gif]
[Graphics:jointexamplegr2.gif][Graphics:jointexamplegr4.gif]
[Graphics:jointexamplegr2.gif][Graphics:jointexamplegr5.gif]
It appears that Mathematica integrates in such a way that the command below indicates y first then x. It looks backwards however.
[Graphics:jointexamplegr2.gif][Graphics:jointexamplegr7.gif]
[Graphics:jointexamplegr2.gif][Graphics:jointexamplegr8.gif]
Since the integral over all pairs (x,y) is equal to c, we must have c = 1.
[Graphics:jointexamplegr2.gif][Graphics:jointexamplegr9.gif]
What is the probability that x > 0.5 and y > 0.3?

The answer is about 0.292 and here is why.
The probability corresponds to the integral of the density function over the values of (x,y) satisfying the conditions. Here is a picture showing this region. The red area is the one we must integrate over.

[Graphics:jointexamplegr2.gif][Graphics:jointexamplegr10.gif]
[Graphics:jointexamplegr2.gif][Graphics:jointexamplegr11.gif]
Because of the shape of this region, it is to our advantage to integrate y first, then x. Again the picture helps a lot in setting up the bounds.
[Graphics:jointexamplegr2.gif][Graphics:jointexamplegr13.gif]
[Graphics:jointexamplegr2.gif][Graphics:jointexamplegr14.gif]
Find formnulas for the marginal density functions fx[x] and fy[y].
[Graphics:jointexamplegr2.gif][Graphics:jointexamplegr15.gif]
[Graphics:jointexamplegr2.gif][Graphics:jointexamplegr16.gif]
[Graphics:jointexamplegr2.gif][Graphics:jointexamplegr17.gif]
[Graphics:jointexamplegr2.gif][Graphics:jointexamplegr18.gif]
Find the probability that x > 0.5.
This is the integral of fx[x] from x = 0.5 to 1, which is easy to do and will yield the answer 1 - 0.5 = 0.5.

Find the probability that y > 0.3.
This is the integral of fy[y] from 0.3 to 1, which is

[Graphics:jointexamplegr2.gif][Graphics:jointexamplegr19.gif]
[Graphics:jointexamplegr2.gif][Graphics:jointexamplegr20.gif]
Are X and Y independent?
No, fx[x] * fy[y] is NOT equal to f[x,y]. However, f[x,y] does factor as a function of x times a function of y, namely 1/x * 1, but the region of non-zero probability is not a square.

Find the conditional density function f_x_given_y[x] and calculate the probability that X < 0.6 given Y = 0.4.
The conditional density (of X given Y) is just the joint density divided by fy[y]. In this case, we get

[Graphics:jointexamplegr2.gif][Graphics:jointexamplegr21.gif]
[Graphics:jointexamplegr2.gif][Graphics:jointexamplegr22.gif]
To find the probability, we integrate from x = -Infinity to x = 0.6 (and set y = 0.4). Since y = 0.4, the only values of x allowed, are those with x >= 0.4 (the intersection of y = 0.4 with our original triangle of non-zero probabilities). We get:
[Graphics:jointexamplegr2.gif][Graphics:jointexamplegr23.gif]
[Graphics:jointexamplegr2.gif][Graphics:jointexamplegr24.gif]
Find E[X], E[Y], [Graphics:jointexamplegr25.gif] and [Graphics:jointexamplegr26.gif] (both directly and by the shortcut formulas).
Each of the quantities above is found by integration. The labels below should indicate which calculation is being done. The first integration is the direct calculation of each quantity and the second calculation uses the shortcut formula.
[Graphics:jointexamplegr2.gif][Graphics:jointexamplegr27.gif]
[Graphics:jointexamplegr2.gif][Graphics:jointexamplegr28.gif]
[Graphics:jointexamplegr2.gif][Graphics:jointexamplegr29.gif]
[Graphics:jointexamplegr2.gif][Graphics:jointexamplegr30.gif]
[Graphics:jointexamplegr2.gif][Graphics:jointexamplegr31.gif]
[Graphics:jointexamplegr2.gif][Graphics:jointexamplegr32.gif]
[Graphics:jointexamplegr2.gif][Graphics:jointexamplegr33.gif]
[Graphics:jointexamplegr2.gif][Graphics:jointexamplegr34.gif]
[Graphics:jointexamplegr2.gif]sigma[x]=Sqrt[Integrate[(x-1/2)^2*f[x,y],{x,0,1},{y,0,x}] ]
[Graphics:jointexamplegr2.gif][Graphics:jointexamplegr36.gif]
[Graphics:jointexamplegr2.gif]sigma2[x]=Sqrt[Integrate[x^2*f[x,y],{x,0,1},{y,0,x}]-(1/2)^2]
[Graphics:jointexamplegr2.gif][Graphics:jointexamplegr38.gif]
[Graphics:jointexamplegr2.gif]sigma[y]=Sqrt[Integrate[(y-1/4)^2*f[x,y],{x,0,1},{y,0,x}]]
[Graphics:jointexamplegr2.gif][Graphics:jointexamplegr40.gif]
[Graphics:jointexamplegr2.gif]sigma2[y]=Sqrt[Integrate[y^2*f[x,y],{x,0,1},{y,0,x}]-(1/4)^2]
[Graphics:jointexamplegr2.gif][Graphics:jointexamplegr42.gif]
Find COV[x,y] both directly and with the shortcut formula.
[Graphics:jointexamplegr2.gif]Integrate[(x-1)*(y-1/4)*f[x,y],{x,0,1},{y,0,x}]
[Graphics:jointexamplegr2.gif][Graphics:jointexamplegr44.gif]
[Graphics:jointexamplegr2.gif]Integrate[x*y*f[x,y],{x,0,1},{y,0,x}]-1/2*1/4
[Graphics:jointexamplegr2.gif][Graphics:jointexamplegr46.gif]
What is the correlation coefficient &rgr;?
[Graphics:jointexamplegr2.gif][Graphics:jointexamplegr47.gif]
[Graphics:jointexamplegr2.gif][Graphics:jointexamplegr48.gif]
[Graphics:jointexamplegr2.gif][Graphics:jointexamplegr49.gif]
[Graphics:jointexamplegr2.gif][Graphics:jointexamplegr50.gif]