Ch05 Student (Prob. Tuts)
Ch05 Student (Prob. Tuts)
• We also note that a pair of random variables X and Y is the same as the two-
0
dimensional vector X Y . Similarly, the random variables X1 , . . . , Xn can be writ-
0
ten as the n dimensional vector X = X1 · · · Xn . Since the components of X
are random variables, X is called a random vector . Thus this chapter begins our
study of random vectors.
• The joint CDF is a complete probability model for any experiment that produces two
random variables. However, it not very useful for analyzing practical experiments.
• More useful models are PX,Y (x, y), the joint probability mass function for two dis-
crete random variables, presented in Sections 5.2 and 5.3, and fX,Y (x, y), the joint
probability density function of two continuous random variables, presented in Sec-
tions 5.4 and 5.5.
• Section 5.7 considers functions of two random variables and expectations, respec-
tively.
• The subject of Section 5.9 is the special case in which X and Y are Gaussian.
Example 5.1
Y = X + Z. (5.1)
The noise Z prevents us from perfectly observing X. In some settings, Z
is an interfering signal. In the simplest setting, Z is just noise inside the
circuitry of your measurement device that is unrelated to X. In this case,
it is appropriate to assume that the signal and noise are independent;
that is, the events X = x and Z = z are independent. This simple model
produces three random variables, X, Y and Z, but any pair completely
specifies the remaining random variable. Thus we will see that a proba-
bility model for the pair (X, Z) or for the pair (X, Y ) will be sufficient to
analyze experiments related to this system.
Section 5.1
{X £ x, Y £ y} (x,y)
The area of the (X, Y ) plane corresponding to the joint cumulative dis-
tribution function FX,Y (x, y).
Joint Cumulative Distribution
Definition 5.1 Function (CDF)
FX,Y (x, y ) = P [X ≤ x, Y ≤ y ] .
Theorem 5.1
Express the following extreme values of the joint CDF FX,Y (x, y) as num-
bers or in terms of the CDFs FX(x) and FY (y).
Each value of the joint CDF can be found by considering the correspond-
ing probability.
(a) FX,Y (−∞, 2) = P[X ≤ −∞, Y ≤ 2] ≤ P[X ≤ −∞] = 0 since X cannot
take on the value −∞.
(b) FX,Y (∞, ∞) = P[X ≤ ∞, Y ≤ ∞] = 1.
This result is given in Theorem 5.1.
(c) FX,Y (∞, y) = P[X ≤ ∞, Y ≤ y] = P[Y ≤ y] = FY (y).
(d) FX,Y (∞, −∞) = P[X ≤ ∞, Y ≤ −∞] = P[Y ≤ −∞] = 0 since Y cannot
take on the value −∞.
Section 5.2
PX,Y (x, y ) = P [X = x, Y = y ] .
Example 5.3 Problem
Test two integrated circuits one after the other. On each test, the
possible outcomes are a (accept) and r (reject). Assume that all circuits
are acceptable with probability 0.9 and that the outcomes of successive
tests are independent. Count the number of acceptable circuits X and
count the number of successful tests Y before you observe the first reject.
(If both tests are successful, let Y = 2.) Draw a tree diagram for the
experiment and find the joint PMF PX,Y (x, y).
Example 5.3 Solution
a •aa
0.9 X=2,Y =2The experiment has the tree dia-
0.9
a X
X
XXX
gram shown to the left. The sample
XXX
0.1 X
X r •ar X=1,Y =1space of the experiment is
HH
pute
g(aa) = (2, 2), g(ar) = (1, 1), g(ra) = (1, 0), g(rr) = (0, 0).
(5.10)
[Continued]
Example 5.3 Solution (Continued 2)
For each pair of values x, y, PX,Y (x, y) is the sum of the probabilities of the
outcomes for which X = x and Y = y. For example, PX,Y (1, 1) = P[ar].
y
.81
•
6
2
0.81 x = 2, y = 2,
0.09 x = 1, y = 1,
.09
1 • PX,Y (x, y ) = 0.09 x = 1, y = 0,
.01 .09
0.01 x = 0, y = 0.
x
0 • • -
0
otherwise
0 1 2
Theorem 5.3
For discrete random variables X and Y and any set B in the X, Y plane,
the probability of the event {(X, Y ) ∈ B} is
X
P [B ] = PX,Y (x, y ) .
(x,y)∈B
Example 5.4 Problem
Y Y
B={X+Y £ 3} B={X 2 + Y 2 £ 9}
X X
The joint PMF PQ,G(q, g) for random variables Q and G is given in the
following table:
PQ,G (q, g ) g = 0 g = 1 g = 2 g = 3
q=0 0.06 0.18 0.24 0.12
q=1 0.04 0.12 0.16 0.08
Calculate the following probabilities:
(a) P[Q = 0]
(b) P[Q = G]
(c) P[G > 1]
(d) P[G > Q]
Quiz 5.2 Solution
From the joint PMF of Q and G given in the table, we can calculate the requested
probabilities by summing the PMF over those values of Q and G that correspond to the
event.
(a) The probability that Q = 0 is
P [Q = 0] = PQ,G (0, 0) + PQ,G (0, 1) + PQ,G (0, 2) + PQ,G (0, 3)
= 0.06 + 0.18 + 0.24 + 0.12 = 0.6. (1)
(b) The probability that Q = G is
P [Q = G] = PQ,G (0, 0) + PQ,G (1, 1) = 0.18. (2)
(c) The probability that G > 1 is
3 X
X 1
P [G > 1] = PQ,G (q, g)
g=2 q=0
= 0.24 + 0.16 + 0.12 + 0.08 = 0.6. (3)
(d) The probability that G > Q is
1
X 3
X
P [G > Q] = PQ,G (q, g)
q=0 g=q+1
= 0.18 + 0.24 + 0.12 + 0.16 + 0.08 = 0.78. (4)
Section 5.3
Marginal PMF
Theorem 5.4
For discrete random variables X and Y with joint PMF PX,Y (x, y),
X X
P X ( x) = PX,Y (x, y ) , P Y (y ) = PX,Y (x, y ) .
y∈SY x∈SX
Example 5.5 Problem
PX,Y (x, y) y = 0 y = 1 y = 2 In Example 5.3, we found that random
x=0 0.01 0 0 variables X and Y have the joint PMF
x=1 0.09 0.09 0 shown in this table. Find the marginal
x=2 0 0 0.81
PMFs for the random variables X and
Y.
Example 5.5 Solution
We note that both X and Y have range {0, 1, 2}. Theorem 5.4 gives
2
X 2
X
PX (0) = PX,Y (0, y) = 0.01 PX (1) = PX,Y (1, y) = 0.18 (5.14)
y=0 y=0
2
X
PX (2) = PX,Y (2, y) = 0.81 PX (x) = 0 x 6= 0, 1, 2 (5.15)
y=0
Referring to the table representation of PX,Y (x, y), we observe that each value of PX(x)
is the result of adding all the entries in one
P row of the table. Similarly, the formula for
the PMF of Y in Theorem 5.4, PY (y) = x∈SX PX,Y (x, y), is the sum of all the entries in
one column of the table. [Continued]
Example 5.5 Solution (Continued 2)
We display PX(x) and PY (y) by rewriting the table and placing the row sums and column
sums in the margins.
PX,Y (x, y) y=0 y=1 y=2 PX (x)
x=0 0.01 0 0 0.01
x=1 0.09 0.09 0 0.18
x=2 0 0 0.81 0.81
PY (y) 0.10 0.09 0.81
Thus the column in the right margin shows PX(x) and the row in the bottom margin
shows PY (y). Note that the sum of all the entries in the bottom margin is 1 and
so is the sum of all the entries in the right margin. This is simply a verification of
Theorem 3.1(b), which states that the PMF of any random variable must sum to 1.
Quiz 5.3
The probability mass function PH,B(h, b) for the two random variables H
and B is given in the following table. Find the marginal PMFs PH(h) and
PB(b).
PH,B (h, b) b = 0 b = 2 b = 4
h = −1 0 0.4 0.2
(5.16)
h=0 0.1 0 0.1
h=1 0.1 0.1 0
Quiz 5.3 Solution
By Theorem 5.4, the marginal PMF of H is
X
PH (h) = PH,B (h, b) . (1)
b=0,2,4
For each value of h, this corresponds to calculating the row sum across the table of the
joint PMF. Similarly, the marginal PMF of B is
1
X
PB (b) = PH,B (h, b) . (2)
h=−1
For each value of b, this corresponds to the column sum down the table of the joint
PMF. The easiest way to calculate these marginal PMFs is to simply sum each row and
column:
PH,B(h,b) b=0 b=2 b=4 PH(h)
h = −1 0 0.4 0.2 0.6
h=0 0.1 0 0.1 0.2
h=1 0.1 0.1 0 0.2
PB(b) 0.2 0.5 0.3
Section 5.4
Use the joint CDF for childrens’ ages X and Y given in Example 5.2 to
derive the joint PDF presented in Equation (5.5).
Example 5.6 Solution
Referring to Equation (5.3) for the joint CDF FX,Y (x, y), we must eval-
uate the partial derivative ∂ 2FX,Y (x, y)/∂x ∂y for each of the six regions
specified in Equation (5.3). However, ∂ 2FX,Y (x, y)/∂x ∂y is nonzero only
if FX.Y (x.y) is a function of both x and y. In this example, only the region
{5 ≤ x < 6, 6 ≤ y < 7} meets this requirement. Over this region,
∂2 ∂ ∂
fX,Y (x, y ) = [(x − 5)(y − 6)] = [x − 5] [y − 6] = 1. (5.18)
∂x ∂y ∂x ∂y
Over all other regions, the joint PDF fX,Y (x, y) is zero.
Theorem 5.6
A joint PDF fX,Y (x, y) has the following properties corresponding to first
and second axioms of probability (see Section 1.2):
Z ∞ Z ∞
(a) fX,Y (x, y) ≥ 0 for all (x, y), (b) fX,Y (x, y) dx dy = 1.
−∞ −∞
Theorem 5.7
1 1
y
y
X X
x 1 x 1
1 1
y
y
X X
x 1 1 x
0≤x<y 0≤y≤1
0≤x≤1 x>1
(c) (d)
(Case (e) covering the whole triangle is omitted.)
Find the joint CDF FX,Y (x, y) when X and Y have joint PDF
Y
1
fXY(x,y)=2
2 0 ≤ y ≤ x ≤ 1,
fX,Y (x, y ) = (5.22)
0 otherwise.
X
1
Example 5.8 Solution
We can derive the joint CDF using Definition 5.3 in which we integrate the joint PDF
fX,Y (x, y) over the area shown in Figure 5.1. To perform the integration it is extremely
useful to draw a diagram that clearly shows the area with nonzero probability and then
to use the diagram to derive the limits of the integral in Definition 5.3.
The difficulty with this integral is that the nature of the region of integration depends
critically on x and y. In this apparently simple example, there are five cases to consider!
The five cases are shown in Figure 5.3. First, we note that with x < 0 or y < 0, the
triangle is completely outside the region of integration, as shown in Figure 5.3a. Thus
we have FX,Y (x, y) = 0 if either x < 0 or y < 0. Another simple case arises when x ≥ 1
and y ≥ 1. In this case, we see in Figure 5.3e that the triangle is completely inside the
region of integration, and we infer from Theorem 5.6 that FX,Y (x, y) = 1. The other
cases we must consider are more complicated. In each case, since fX,Y (x, y) = 2 over
the triangular region, the value of the integral is two times the indicated area. When
(x, y) is inside the area of nonzero probability (Figure 5.3b), the integral is
Z yZ x
FX,Y (x, y) = 2 du dv = 2xy − y 2 (Figure 5.3b). (5.23)
0 v
[Continued]
Example 5.8 Solution (Continued 2)
In Figure 5.3c, (x, y) is above the triangle, and the integral is
Z xZ x
FX,Y (x, y) = 2 du dv = x2 (Figure 5.3c). (5.24)
0 v
The remaining situation to consider is shown in Figure 5.3d, when (x, y) is to the right
of the triangle of nonzero probability, in which case the integral is
Z yZ 1
FX,Y (x, y) = 2 du dv = 2y − y 2 (Figure 5.3d) (5.25)
0 v
The resulting CDF, corresponding to the five cases of Figure 5.3, is
0 x < 0 or y < 0 (a),
2xy − y 2 0≤y≤x≤1 (b),
FX,Y (x, y) = x2 0 ≤ x < y, 0 ≤ x ≤ 1 (c), (5.26)
2y − y 2 0 ≤ y ≤ 1, x > 1 (d),
1 x > 1, y > 1 (e).
In Figure 5.4, the surface plot of FX,Y (x, y) shows that cases (a) through (e) correspond
to contours on the “hill” that is FX,Y (x, y). In terms of visualizing the random variables,
the surface plot of FX,Y (x, y) is less instructive than the simple triangle characterizing
the PDF fX,Y (x, y).
Because the PDF in this example is fX,Y (x, y) = 2 over (x, y) ∈ SX,Y , each probability is
just two times the area of the region shown in one of the diagrams (either a triangle
or a trapezoid). You may want to apply some high school geometry to verify that the
results obtained from the integrals are indeed twice the areas of the regions indicated.
The approach taken in our solution, integrating over SX,Y to obtain the CDF, works for
any PDF.
Figure 5.4
0.5
2
1
0
0 0.5 1 0 y
1.5 2
x
Applying Theorem 5.7, we integrate fX,Y (x, y) over the part of the X, Y
plane satisfying Y > X. In this case,
Y
Y>X Z 3 Z 3 !
1
P [A] = dy dx (5.28)
0 x 15
3
Z 3
3−x 2
(3 − x) 3
= dx = − = . (5.29)
0 15 30
0 10
X
Quiz 5.4
Marginal PDF
Theorem 5.8
If X and Y are random variables with joint PDF fX,Y (x, y),
Z ∞ Z ∞
fX (x) = fX,Y (x, y ) dy, f Y (y ) = fX,Y (x, y ) dx.
−∞ −∞
Proof: Theorem 5.8
We use Theorem 5.8 to find the marginal PDF fX(x). In the figure that
accompanies Equation (5.33) below, the gray bowl-shaped region depicts
those values of X and Y for which fX,Y (x, y) > 0. When x < −1 or when
x > 1, fX,Y (x, y) = 0, and therefore fX(x) = 0. For −1 ≤ x ≤ 1,
Y X=x
1
5(1 − x4)
Z 1
5y
f X ( x) = dy = . (5.33)
x
2 x2 4 8
X
-1 x 1
The complete expression for the marginal PDF of X is
0.5
fX(x)
5(1 − x4)/8 −1 ≤ x ≤ 1,
f X ( x) = (5.34)
0 otherwise.
0
−1 0 1
x
[Continued]
Example 5.10 Solution (Continued 2)
For the marginal PDF of Y , we note that for y < 0 or y > 1, fY (y) = 0. For 0 ≤ y ≤ 1,
we integrate over the horizontal bar marked Y = y. The boundaries of the bar are
√ √
x = − y and x = y. Therefore, for 0 ≤ y ≤ 1,
Y
1
Z √
y
x=√y
5y 5y
Y=y fY (y) = √ dx = x
4 x=−√y
= 5y 3/2 /2. (5.35)
− y 4
X
1/2 1/2
-1 -y y 1
The complete marginal PDF of Y is
3
2
fY(y)
(5/2)y 3/2
0 ≤ y ≤ 1,
1 fY (y) = (5.36)
0 otherwise.
0
−1 0 1
y
Quiz 5.5
(3 + 6y 2 )/5 0 ≤ y ≤ 1,
fY (y) = (5)
0 otherwise.
Section 5.6
In Example 5.2, we derived the CDFs FX(x) and FY (y), which showed
that X is uniform (5, 6) and Y is uniform (6, 7). Thus X and Y have
marginal PDFs
1 5 ≤ x < 6, 1 6 ≤ x < 7,
f X ( x) = fY (y ) = (5.38)
0 otherwise, 0 otherwise.
Referring to Equation (5.5), we observe that fX,Y (x, y) = fX(x)fY (y).
Thus X and Y are independent.
Example 5.12 Problem
4xy 0 ≤ x ≤ 1, 0 ≤ y ≤ 1,
fX,Y (x, y ) =
0 otherwise.
Are X and Y independent?
Example 5.12 Solution
24uv u ≥ 0, v ≥ 0, u + v ≤ 1,
fU,V (u, v ) = (5.40)
0 otherwise.
Are U and V independent?
Example 5.13 Solution
Since fU,V (u, v) looks similar in form to fX,Y (x, y) in the previous example,
we might suppose that U and V can also be factored into marginal PDFs
fU(u) and fV (v). However, this is not the case. Owing to the triangular
shape of the region of nonzero probability, the marginal PDFs are
12u(1 − u)2 0 ≤ u ≤ 1, 12v(1 − v)2 0 ≤ v ≤ 1,
fU (u) = fV (v ) =
0 otherwise, 0 otherwise.
Clearly, U and V are not independent. Learning U changes our knowledge
of V . For example, learning U = 1/2 informs us that P[V ≤ 1/2] = 1.
Example 5.14 Problem
By Theorem 5.9, the ith double summation on the right side is E[gi (X, Y )]; thus,
E [g(X, Y )] = a1 E [g1 (X, Y )] + · · · + an E [gn (X, Y )] . (5.45)
For continuous random variables, Theorem 5.9 says
Z ∞Z ∞
E [g(X, Y )] = (a1 g1 (x, y) + · · · + an gn (x, y)) fX,Y (x, y) dx dy. (5.46)
−∞ −∞
To complete the proof, we express this integral as the sum of n integrals and recognize
that each of the new integrals is a weighted expected value, ai E[gi (X, Y )].
Theorem 5.11
E [X + Y ] = E [X ] + E [Y ] .
Theorem 5.12
Since E[X + Y ] = µX + µY ,
h i
2
Var[X + Y ] = E (X + Y − (µX + µY ))
h i
2
= E ((X − µX ) + (Y − µY ))
h i
2 2
= E (X − µX ) + 2(X − µX )(Y − µY ) + (Y − µY ) . (5.47)
We observe that each of the three terms in the preceding expected values
is a function of X and Y . Therefore, Theorem 5.10 implies
h i h i
2 2
Var[X + Y ] = E (X − µX ) + 2 E [(X − µX )(Y − µY )] + E (Y − µY ) .
(5.48)
The first and last terms are, respectively, Var[X] and Var[Y ].
Example 5.15 Problem
A company website has three pages. They require 750 kilobytes, 1500
kilobytes, and 2500 kilobytes for transmission. The transmission speed
can be 5 Mb/s for external requests or 10 Mb/s for internal requests.
Requests arrive randomly from inside and outside the company indepen-
dently of page length, which is also random. The probability models for
transmision speed, R, and page length, L, are:
0.3 l = 750,
0.4 r = 5,
0.5
l = 1500,
P R (r ) = 0.6 r = 10, PL (l) = (5.49)
0.2 l = 2500,
0 otherwise,
0 otherwise.
Write an expression for the transmission time g(R, L) seconds. Derive the
expected transmission time E[g(R, L)]. Does E[(g(R, L)] = g(E[R], E[L])?
Example 5.15 Solution
The transmission time T seconds is the the page length (in kb) divided
by the transmission speed (in kb/s), or T = 8L/1000R. Because R and
L are independent, PR,L(r, l) = PR(r)PL(l) and
XX 8l
E [g(R, L)] = PR (r) PL (l)
r l
1000r
!
8 X P R (r ) X
= P L (l ) l
1000 r r l
8 0.4 0.6
= + (0.3(750) + 0.5(1500) + 0.2(2500))
1000 5 10
= 1.652 s. (5.50)
P P
By comparison, E[R] = r rP R(r) = 8 Mb/s and E[L] = l lPL(l) = 1475
kilobytes. This implies
8 E [L]
g(E [R] , E [L]) = = 1.475 s 6= E [g(R, L)] . (5.51)
1000 E [R]
Section 5.8
2 2 2
Y
Y
0 0 0
−2 −2 −2
−2 0 2 −2 0 2 −2 0 2
X X X
(a) ρX,Y = −0.9 (b) ρX,Y = 0 (c) ρX,Y = 0.9
Each graph has 200 samples, each marked by a dot, of the random
variable pair (X, Y ) such that E[X] = E[Y ] = 0, Var[X] = Var[Y ] = 1.
Theorem 5.13
If X̂ = aX + b and Ŷ = cY + d, then
• X is the distance of a cellular phone from the nearest base station. Y is the power
of the received signal at the cellular phone. −1 < ρX,Y < 0.
For the integrated circuits tests in Example 5.3, we found in Example 5.5
that the probability model for X and Y is given by the following matrix.
PX,Y (x, y ) y = 0 y = 1 y = 2 PX (x)
x=0 0.01 0 0 0.01
x=1 0.09 0.09 0 0.18
x=2 0 0 0.81 0.81
P Y (y ) 0.10 0.09 0.81
Find rX,Y and Cov[X, Y ].
Example 5.17 Solution
By Definition 5.7,
2 X
X 2
rX,Y = E [XY ] = xyPX,Y (x, y ) (5.59)
x=0 y=0
= (1)(1)0.09 + (2)(2)0.81 = 3.33. (5.60)
To use Theorem 5.16(a) to find the covariance, we find
If g(X) = X, and h(Y ) = Y , this equation implies rX,Y = E[XY ] = E[X] E[Y ]. This
equation and Theorem 5.16(a) imply Cov[X, Y ] = 0. As a result, Theorem 5.16(b)
implies Var[X + Y ] = Var[X] + Var[Y ]. Furthermore, ρX,Y = Cov[X, Y ]/(σX σY ) = 0.
Example 5.18 Problem
We recall from Example 5.1 that the signal X is Gaussian (0, σX ), that
the noise Z is Gaussian (0, σZ ), and that X and Z are independent. We
know from Theorem 5.17(c) that independence of X and Z implies
(5.65)
This implies
v
Cov [X, Y ] 2
σX
u 2 /σ 2
σX Z .
u
ρX,Y = q =q =t 2 /σ 2
(5.66)
Var[X] Var[Y ] 2 (σ 2 + σ 2 )
σX 1 + σX
X Z Z
Quiz 5.8(A)
Random variables L and T have joint PMF
PL,T (l, t) t = 40 sec t = 60 sec
l = 1 page 0.15 0.1
l = 2 pages 0.30 0.2
l = 3 pages 0.15 0.1.
Find the following quantities.
(a) E[L] and Var[L]
(b) E[T ] and Var[T ]
(c) The covariance Cov[L, T ]
(d) The correlation coefficient ρL,T
Quiz 5.8(A) Solution
It is helpful to first make a table that includes the marginal PMFs.
PL,T(l, t) t = 40 t = 60 PL(l)
l=1 0.15 0.1 0.25
l=2 0.3 0.2 0.5
l=3 0.15 0.1 0.25
PT(t) 0.6 0.4
(a) The expected value of L is
E [L] = 1(0.25) + 2(0.5) + 3(0.25) = 2. (1)
Since the second moment of L is
E L2 = 12 (0.25) + 22 (0.5) + 32 (0.25) = 4.5,
(2)
the variance of L is
Var [L] = E L − (E [L])2 = 0.5.
2
(3)
(b) The expected value of T is
E [T ] = 40(0.6) + 60(0.4) = 48. (4)
The second moment of T is
E T 2 = 402 (0.6) + 602 (0.4) = 2400.
(5)
[Continued]
Quiz 5.8(A) Solution (Continued 2)
Thus
Var[T ] = E T 2 − (E [T ])2 = 96.
(6)
(c) First we need to find
3
X X
E [LT ] = ltPLT (lt)
t=40,60 l=1
= 1(40)(0.15) + 2(40)(0.3) + 3(40)(0.15)
+ 1(60)(0.1) + 2(60)(0.2) + 3(60)(0.1)
= 96. (7)
The covariance of L and T is
Cov [L, T ] = E [LT ] − E [L] E [T ] = 96 − 2(48) = 0. (8)
(d) Since Cov[L, T ] = 0, the correlation coefficient is ρL,T = 0.
Quiz 5.8(B)
Similarly, for 0 ≤ y ≤ 2,
Z ∞ Z 2
x=1
1 y
xy dx = x2 y
fY (y) = fX,Y (x, y) dx = = . (2)
−∞ 0 2 x=0 2
The complete expressions for the marginal PDFs are
2x 0 ≤ x ≤ 1, y/2 0 ≤ y ≤ 2,
fX (x) = fY (y) = (3)
0 otherwise, 0 otherwise.
From the marginal PDFs, it is straightforward to calculate the various expectations.
(a) The first and second moments of X are
Z ∞ Z 1
2
E [X] = xfX (x) dx = 2x2 dx = . (4)
−∞ 0 3
Z ∞ Z 1
1
E X2 = x2 fX (x) dx = 2x3 dx = .
(5)
−∞ 0 2
[Continued]
Quiz 5.8(B) Solution (Continued 2)
The variance of X is
1
Var[X] = E[X 2 ] − (E[X])2 = .
18
(a) The first and second moments of Y are
Z ∞ Z 2
1 2 4
E [Y ] = yfY (y) dy = y dy = , (6)
−∞ 0 2 3
Z ∞ Z 2
2 1 3
E Y = y 2 fY (y) dy = y dy = 2. (7)
−∞ 0 2
The variance of Y is
16 2
Var[Y ] = E Y − (E [Y ])2 = 2 −
2
= . (8)
9 9
(b) We start by finding
Z ∞ Z ∞
E [XY ] = xyfX,Y (x, y) dx, dy
−∞ −∞
1Z 2 1 2
x3 y 3
Z
= 2 2
x y dx, dy = = 8. (9)
0 0 3 0 3 0 9
The covariance of X and Y is then
8 2 4
Cov [X, Y ] = E [XY ] − E [X] E [Y ] = − · = 0. (10)
9 3 3
(c) Since Cov[X, Y ] = 0, the correlation coefficient is ρX,Y = 0.
Section 5.9
fX,Y (x, y ) = q ,
2πσX σY 1 − ρX,Y 2
Figure 5.6
ρ = −0.9 ρ=0 ρ = 0.9
(x,y)
fX,Y(x,y)
0.2 0.2 0.2
X,Y
0.1 2 0.1 2 0.1 2
f
0 0 0
0 0 0
−2 −1 −2 −2 −1 −2 −2 −1 −2
0 1 2 y 0 1 2 y 0 1 2 y
x x x
2 2 2
Y
Y
0 0 0
−2 −2 −2
−2 0 2 −2 0 2 −2 0 2
X X X
The Joint Gaussian PDF fX,Y (x, y) for µX = µY = 0, σX = σY = 1, and three values of
ρX,Y = ρ. Next to each PDF, we plot 200 sample pairs (X, Y ) generated with that PDF.
Theorem 5.18
µX = 0, µY = 0,
σX = 1, σY = 1.
Applying these facts to Definition 5.10, we have
2 2
e−2(x −xy+y )/3
fX,Y (x, y ) = √ . (1)
3π 2
Section 5.10
The joint PDF of the continuous random variables X1, . . . , Xn is the func-
tion
∂ nFX1,...,Xn (x1, . . . , xn)
fX1,...,Xn (x1, . . . , xn) = .
∂x1 · · · ∂xn
Theorem 5.22
As in Quiz 5.10, the random variables Y1, . . . , Y4 have the joint PDF
4 0 ≤ y1 ≤ y2 ≤ 1, 0 ≤ y3 ≤ y4 ≤ 1,
fY1,...,Y4 (y1, . . . , y4) = (5.75)
0 otherwise.
Find the marginal PDFs fY1,Y4(y1, y4), fY2,Y3(y2, y3), and fY3(y3).
Example 5.22 Solution
Z ∞ Z ∞
fY1,Y4 (y1, y4) = fY1,...,Y4 (y1, . . . , y4) dy2 dy3. (5.76)
−∞ −∞
In the foregoing integral, the hard part is identifying the correct limits.
These limits will depend on y1 and y4. For 0 ≤ y1 ≤ 1 and 0 ≤ y4 ≤ 1,
Z 1Z y
4
fY1,Y4 (y1, y4) = 4 dy3 dy2 = 4(1 − y1)y4. (5.77)
y1 0
The complete expression for fY1,Y4(y1, y4) is
4(1 − y )y 0 ≤ y1 ≤ 1, 0 ≤ y4 ≤ 1,
1 4
fY1,Y4 (y1, y4) = (5.78)
0 otherwise.
Similarly, for 0 ≤ y2 ≤ 1 and 0 ≤ y3 ≤ 1,
Z y Z 1
2
fY2,Y3 (y2, y3) = 4 dy4 dy1 = 4y2(1 − y3). (5.79)
0 y3
[Continued]
Example 5.22 Solution (Continued 2)
We note that inspection of the joint PDF reveals that X1, . . . , X4 are iid
continuous uniform (0, 1) random variables. The integration in Equa-
tion (5.84) is easy because independence implies
We find P[C] by integrating the joint PDF over the region of interest.
Specifically,
Z 1 Z y Z 1 Z y
2 2 2 4
P [C ] = dy2 dy1 dy4 4dy3
0 0 0 0
Z 1 Z 1
2 2
= 4 y2 dy2 y4 dy4
0 0
1 1
2
1 2 1 2 1 1
= 4 y22 y42 = 4
= . (1)
2 0 2 0 8 16
Section 5.11
Matlab
Sample Space Grids
• We start with the case when X and Y are finite random variables with ranges
SX = {x1 , . . . , xn } , SY = {y1 , . . . , ym } . (5.87)
In this case, we can take advantage of Matlab techniques for surface plots of g(x, y)
over the x, y plane.
• To make sure that probabilities have been generated properly, we note that
[SX(:) SY(:) PXY(:)]
is a matrix whose rows list all possible pairs xi , yj and corresponding probabilities
PX,Y (xi , yj ).
• Given a function g(x, y) that operates on the elements of vectors x and y, the
advantage of this grid approach is that the Matlab function g(SX,SY) will calculate
g(x, y) for each x ∈ SX and y ∈ SY .
>> imagesize
eb =
319200
sb =
96000 144000 192000 288000 384000 432000 576000
pb =
0.2000 0.0500 0.0500 0.3000 0.1000 0.1000 0.2000
The function imagerv uses the imagesize.m script to define the matrices
SX, SY, and PXY. It then calls the finiterv.m function. Here is the code
imagerv.m and a sample run:
fxy=freqxy(xy,SX,SY)
that calculates the relative frequency of every pair x, y. The output fxy
should correspond to the matrix [SX(:) SY(:) PXY(:)].
Example 5.27 Solution
%imagestem.m
imagepmf;
xy=imagerv(10000);
0.2
fxy=freqxy(xy,SX,SY);
stem3(fxy(:,1),...
fxy(:,2),fxy(:,3)); 0.1
xlabel(’\it x’); 1600
ylabel(’\it y’); 0 800
1200 800 400 0 0 x
y