Other Examples
Other Examples
Z ∞ Z 1 1
fX (x) dx = 3x2 dx = x3 =1
−∞ 0 0
1
• If x < 0, then fX (t) = 0 for all t ≤ x.
Z x Z x
FX (x) = fX (t) dt = 0 dt = 0
−∞ −∞
In a nutshell, FX is given by :
0 if x < 0
FX (x) = x3 if 0 ≤ x ≤ 1
1 if x > 1
Z ∞
E[X] = xfX (x) dx
−∞
Z 1
= 3x3 dx
0
1
3 4
= x
4 0
3
=
4
2
Answer. We can use the shortcut formula : Var(X) = E[X 2 ] − (E[X])2 .
Since the expectation was previously computed, we only need to calculate
E[X 2 ] :
Z ∞
E[X 2 ] = x2 fX (x) dx
−∞
Z1
= 3x4 dx
0
1
3
= x5
5 0
3
=
5
Therefore, we obtain :
2
3 3 3
Var(X) = − =
5 4 80
3
2 fX (x)
x
−2 −1 1 2
−1
Z ∞ Z −1 Z 0 Z 1 Z ∞
fX (x) dx = fX (x) dx + fX (x) dx + fX (x) dx + fX (x) dx
−∞ −∞ −1 0 1
Z 0 Z 1
=0+ (x + 1) dx + (1 − x) dx + 0
−1 0
0 1
x2 x2
= +x + x−
2 −1 2 0
1 1
= 0− −1 + 1− −0
2 2
=1
4
• If −1 ≤ x ≤ 0, then fX (t) = t + 1 for all −1 ≤ t ≤ x.
Z x
FX (x) = FX (−1) + fX (t) dt
−1
Z x
=0+ (t + 1) dt
−1
2 x
t
= +t
2 −1
x2
1
= +x− −1
2 2
x2 1
= +x+
2 2
1
= (x + 1)2
2
In a nutshell, FX is given by :
01
if x < −1
2
2 (x2 + 1) if −1≤x≤0
FX (x) =
− x2 + x + 1
2 if 0<x≤1
1 if x>1
5
(d) Graph the cumulative distribution function FX of X.
Answer.
2 FX (x)
x
−2 −1 1 2
−1
6
Feb 28 Homework Solutions
Math 151, Winter 2012
Problem 8
The joint probability density function of X and Y is given by
(a) Find c.
We want Z ∞ Z ∞ Z ∞ Z y
1= f (x, y)dxdy = c(y 2 − x2 )e−y dxdy.
−∞ −∞ 0 −y
We compute
Z ∞Z y Z ∞ Z y
−y
2 2
(y − x )e dxdy = (y 2 − x2 )e−y dxdy
0 −y 0 −y
Z ∞ x=y
x3 −y
2
= xy − e dy
0 3 x=−y
4 ∞ 3 −y
Z
= y e dy
3 0
Z ∞
= 8 e−y dy using integration by parts
0
= 8.
Thus c = 1/8.
1
The marginal probability density function of X is
Z ∞
fX (x) = f (x, y)dy
−∞
Z ∞
1 2
= (y − x2 )e−y dy
|x| 8
Z ∞
1 −y
= ye dy using integration by parts
|x| 4
Z ∞
1 −|x| 1 −y
= |x|e + e dy using integration by parts
4 |x| 4
1 1
= |x|e−|x| + e−|x|
4 4
1 −|x|
= e |x| + 1
4
Problem 10
The joint probability density function of X and Y is given by
2
(b) Find P {X < a}.
Z a Z ∞ Z a Z ∞ Z a y=∞
−x−y
−e−x−y
P {X < a} = f (x, y)dydx = e dydx = y=0
dx
0 0 0 0 0
Z a x=a
e−x dx = −e−x x=0 = 1 − e−a .
=
0
Problem 15
The random vector (X, Y ) is said to be uniformly distributed over a region R in the plane
if, for some constant c, its joint density is
c if (x, y) ∈ R,
f (x, y) =
0 otherwise.
(a) Show that 1/c = area of region R.
Let R2 be the 2-dimensional plane. Observe that for E ⊆ R2 ,
ZZ ZZ
P {(X, Y ) ∈ E} = f (x, y)dxdy = c = c · area(E ∩ R).
E E∩R
3
(c) What is the probability that (X, Y ) lies in the circle of radius 1 centered at the
origin? That is, find P {X 2 + Y 2 ≤ 1}.
Let C denote the interior of the circle of radius 1 centered at the origin. We want
to compute P {(X, Y ) ∈ C}. We have
1 1 1 π
P {(X, Y ) ∈ C} = · area(C ∩ R) = · area(C) = · π = .
4 4 4 4
Problem 16
Suppose that n points are independently chosen at random on the circumference of a
circle, and we want the probability that they all lie in some semicircle. That is, we want
the probability that there is a line passing through the center of the circle such that all the
points are on one side of that line. Let P1 , . . . , Pn denote the n points. Let A denote the
event that all the points are contained in some semicircle, and let Ai be the event that
all the points lie in the semicircle beginning at the point Pi and going clockwise for 180◦ ,
i = 1, . . . , n.
4
Fix i ∈ {1, ..., n} and fix a randomly chosen Pi . For j 6= i, the probability that the
randomly chosen point Pj is in the semicircle starting at Pi and going clockwise 180
degrees is 1/2. So P (Ai ) = (1/2)n−1 . Therefore
n
X
P (A) = P (Ai ) = n(1/2)n−1 .
i=1
Problem 18
Two points are selected randomly on a line of length L so as to be on opposite sides of the
midpoint of the line. [In other words, the two points X and Y are independent random
variables such that X is uniformly distributed over (0, L/2) and Y is uniformly distributed
over (L/2, L).] Find the probability that the distance between the two points is greater
than L/3.
Note that X and Y are jointly distributed with joint probability density function
given by (
4
2 0 ≤ x ≤ L2 and L2 ≤ y ≤ L
f (x, y) = L
0 otherwise.
Hence the probability that the distance between the two points is greater than L/3 is
equal to
ZZ
P (Y − X > L/3) = f (x, y)dydx
y−x>L/3
Z L/2 Z L
4
= dydx
0 max{L/2,L/3+x} L2
Z L/6 ZL Z L/2 Z L
4 4
= dydx + dydx
0 L/2 L2 L/6 L/3+x L2
Z L/6 Z L/2
4 4
= 2
(L − L/2)dx + 2
L − (L/3 + x) dx
0 L L/6 L
Z L/6 Z L/2
2 8 4
= dx + − 2 x dx
0 L L/6 3L L
2 h 8 2 iL/2
= (L/6 − 0) + x − 2 x2
L 3L L L/6
1 4 1 4 1
= + − − −
3 3 2 9 18
7
= .
9
Note: it is much easier to find the limits for the integrals above if you first draw
a picture of the region in the plane where 0 ≤ x ≤ L2 , where L2 ≤ y ≤ L, and where
y − x > L/3. Alternatively, after drawing this region in the plane, you can compare the
area of this region to the area of the larger rectangle given by 0 ≤ x ≤ L2 and L2 ≤ y ≤ L
to see that the desired probability is 7/9.
5
Problem 23
The random variables X and Y have joint density function
f (x, y) = 12xy(1 − x), 0 < x < 1, 0 < y < 1.
and equal to zero otherwise.
(a) Are X and Y are independent?
Let R be the real line. Let A, B ⊆ R. Without loss of generality, we may assume
that A, B ⊆ (0, 1) since f is zero outside this range. We have
Z ∞Z Z 1Z
P {X ∈ A} = f (x, y)dxdy = 12xy(1 − x)dxdy
−∞ A 0 A
Z Z 1 Z
1
= 12 x(1 − x)dx · ydy = 12 x(1 − x)dx ·
2
Z A 0 A
= 6 x(1 − x)dx
A
and
Z Z ∞ Z Z 1
P {Y ∈ B} = f (x, y)dxdy = 12xy(1 − x)dxdy
B −∞ B 0
Z 1 Z Z Z
1
= 12 x(1 − x)dx · ydy = 12 · · ydy = 2 · ydy
0 B 6 B B
and
Z Z Z Z
P {X ∈ A, Y ∈ B} = f (x, y)dxdy = 12xy(1 − x)dxdy
B
Z A Z B A
6
(e) Find V ar(Y ).
Z ∞ Z 1 1
2 2
2y 3 dx = y 4 /2 0 = 1/2.
E[Y ] = y fY (y)dy =
−∞ 0
so
Var(Y ) = E[Y 2 ] − E[Y ]2 = 1/2 − (2/3)2 = 1/18.
Problem 26
Suppose that A, B, C are independent random variables, each being uniformly distributed
over (0, 1).
(b) What is the probability that all the roots of the equation Ax2 + Bx + C = 0 are
real?
Recall that the roots of Ax2 + Bx + C = 0 are real if B 2 − 4AC ≥ 0, which occurs
with probability
Z 1 Z 1 Z 1 Z 1 Z min{1,1/(4a)} Z 1
√
1dbdcda = √
1dbdcda
0 0 min{1, 4ac} 0 0 4ac
Z 1/4 Z 1 Z 1 Z 1 Z 1/(4a) Z 1
= √
1dbdcda + √
1dbdcda
0 0 4ac 1/4 0 4ac
Z 1/4 Z 1 Z 1 Z 1/(4a)
1/2 1/2
= (1 − 2a c )dcda + (1 − 2a1/2 c1/2 )dcda
0 0 1/4 0
Z 1/4 c=1
Z 1 c=1/(4a)
c − 43 a1/2 c3/2 c=0 da + c − 34 a1/2 c3/2 c=0
= da
0 1/4
Z 1/4 Z 1
1 −1
= 1 − 34 a1/2 da + 12
a da
0 1/4
a=1/4 1 a=1
= a − 89 a3/2 a=0 + 12
log(a) a=1/4
5 1
= 36
+ 12
log(4).
See page 243 for the version of the problem where L ≤ D. What is new for L > D is
that now X < min{D/2, (L/2) cos θ}. This does not reduce to X < (L/2) cos θ as it did
7
before. Let φ be the angle such that D/2 = (L/2) cos φ, that is, cos φ = D/L (note we
are using slightly different notation from the text). Then
ZZ
L
P X < cos θ = fX (x)fθ (y)dxdy
2 x<(L/2) cos y
Z π/2 Z min{D/2,(L/2) cos y
4
= dxdy
πD 0 0
Z φ Z D/2 Z π/2 Z (L/2) cos y
4 4
= dxdy + dxdy
πD 0 0 πD φ 0
Z π/2
4 φD 4 L
= · + cos y dy
πD 2 πD φ 2
2φ 2L
= + (1 − sin φ),
π πD
where φ is the angle such that cos φ = D/L.
Problem 5
If X and Y are independent continuous positive random variables, express the density
function of (a) Z = X/Y and (b) Z = XY in terms of the density functions of X and
Y . Evaluate the density functions in the special case where X and Y are both exponential
random variables.
(a) Z = X/Y .
Note fZ (z) = 0 for z ≤ 0, since X and Y are both positive. For z > 0, we compute
Z ∞ Z zy
P {Z < z} = P {X/Y < z} = P {X < zY } = fX (x)fY (y)dxdy,
0 −∞
so
Z ∞ Z zy Z ∞
d d
fZ (z) = P {Z < z} = fX (x)fY (y)dxdy = yfX (zy)fY (y)dy.
dz 0 dz −∞ 0
(b) Z = XY .
Note fZ (z) = 0 for z ≤ 0, since X and Y are both positive. For z > 0, we compute
Z ∞ Z z/y
P {Z < z} = P {XY < z} = P {X < z/Y } = fX (x)fY (y)dxdy,
0 −∞
so
Z ∞ Z z/y Z ∞
d d 1
fZ (z) = P {Z < z} = fX (x)fY (y)dxdy = fX (z/y)fY (y)dy.
dz 0 dz −∞ 0 y
8
(a) Z = X/Y .
Z ∞ Z ∞ Z ∞
−λzy −µy
fZ (z) = yfX (zy)fY (y)dy = λµye e dy = λµye−(λz+µ)y dy
0 0 0
Z ∞
λµ
= e−(λz+µ)y dy after integrating by parts
λz + µ 0
λµ
=
(λz + µ)2
(b) Z = XY .
Z ∞ Z ∞ Z ∞
1 λµ −λz/y −µy λµ −λz/y−µy
fZ (z) = fX (z/y)fY (y)dy = e e dy = e dy.
0 y 0 y 0 y