Download Solutions to HW9 Solution to problem 7.2.2 (SK) Problem 7.2.4 •

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

Probability wikipedia , lookup

Transcript
ECE302 Spring 2015
HW9 Solutions
May 3, 2015
1
Solutions to HW9
Note: Most of these solutions were generated by R. D. Yates and D. J. Goodman, the
authors of our textbook. I have added comments in italics where I thought more detail was
appropriate. Those solutions I have written myself are designated by my initials.
Solution to problem 7.2.2 (SK)
We are given that random variable X has CDF

0
x < −1,



0.2 −1 ≤ x < 0,
FX (x) =
0.7 0 ≤ x < 1,



1
x ≥ 1,
(1)
and that B = {|X| > 0}.
We are asked to find PX|B (x), E[X|B], Var[X|B].
First we need the PMF of X. We find

0
x < −1,




1/5
x = −1
(1/5 = 0.2 − 0)

1/2 x = 0
(1/2 = 0.7 − 0.2)
fX (x) =


3/10
x
=
1
(3/10 = 1 − 0.7)



0
otherwise.
(2)
So
P [B] = 1 − P [X = 0] = 1 − 1/2 = 1/2
and thus

2/5 x = −1,
PX (x) 
3/5 x = 1,
PX|B (x) =
=
PB (x) 
0
otherwise.
(3)
Note that because B is the event that X is nonzero, PX|B takes nonzero values only for
nonzero x.
E[X|B] = 2/5(−1) + 3/5(1) = 1/5
and
V ar[X|B] = E[X 2 ] = (E[X])2 = 2/5(−1)2 + 3/5(1)2 − (1/5)2 = 1 − 1/25 = 24/25.
Problem 7.2.4 •
Y is an exponential random variable with parameter λ = 0.2. Given the event A = {Y < 2},
(a) What is the conditional PDF, fY |A (y)?
ECE302 Spring 2015
HW9 Solutions
May 3, 2015
2
(b) Find the conditional expected value, E[Y |A].
Problem 7.2.4 Solution
From Definition 3.6, the PDF of Y is
(1/5)e−y/5 y ≥ 0
fY (y) =
0
otherwise
(1)
(a) The event A has probability
Z
P [A] = P [Y < 2] =
0
2
2
(1/5)e−y/5 dy = −e−y/5 = 1 − e−2/5
0
From Definition 3.15, the conditional PDF of Y given A is
fY (y) /P [A] x ∈ A
fY |A (y) =
0
otherwise
(1/5)e−y/5 /(1 − e−2/5 ) 0 ≤ y < 2
=
0
otherwise
(2)
(3)
(4)
(b) The conditional expected value of Y given A is
Z
∞
E [Y |A] =
yfY |A (y) dy =
−∞
1/5
1 − e−2/5
Z
2
ye−y/5 dy
(5)
0
R
R
Using the integration by parts formula u dv = uv − v du with u = y and dv =
e−y/5 dy yields
2 Z 2
1/5
−y/5 −y/5
5e
dy
(6)
−5ye
E [Y |A] =
+
0
1 − e−2/5
0
2 1/5
−2/5
−y/5 =
−10e
− 25e
(7)
0
1 − e−2/5
5 − 7e−2/5
=
(8)
1 − e−2/5
Problem 7.2.6 The number of pages X in a document has PMF

 0.15 x = 1, 2, 3, 4
0.1 x = 5, 6, 7, 8
PX (x) =

0
otherwise
A firm sends all documents with an even number of pages to printer A and all documents
with an odd number of pages to printer B.
ECE302 Spring 2015
HW9 Solutions
May 3, 2015
3
(a) Find the conditional PMF of the length X of a document, given the document was
sent to printer A. What are the conditional expected length and standard deviation?
(b) Find the conditional PMF of the length X of a document, given the document was
sent to printer B and had no more than six pages. What are the conditional expected
length and standard deviation?
Problem 7.2.6 Solution
Recall that the PMF of the number of pages in

 0.15
0.1
PX (x) =

0
a fax is
x = 1, 2, 3, 4
x = 5, 6, 7, 8
otherwise
(1)
(a) The event that a document was sent to printer A can be expressed mathematically
as the event that the number of pages X is an even number. Similarly, the event
that a document was sent to [printer] B is the event that X is an odd number. Since
SX = {1, 2, . . . , 8}, we define the set A = {2, 4, 6, 8}. Using this definition for A, we
have that the event that a document is sent to A is equivalent to the event X ∈ A.
The event A has probability
P [A] = PX (2) + PX (4) + PX (6) + PX (8) = 0.5
Given the event A, the conditional PMF of X is

(
 0.3 x = 2, 4
PX (x)
x∈A
P [A]
0.2 x = 6, 8
PX|A (x) =
=

0
otherwise
0
otherwise
The conditional first and second moments of X given A is
X
E [X|A] =
xPX|A (x) = 2(0.3) + 4(0.3) + 6(0.2) + 8(0.2) = 4.6
(2)
(3)
(4)
x
X 2
E X 2 |A =
x PX|A (x) = 4(0.3) + 16(0.3) + 36(0.2) + 64(0.2) = 26
(5)
x
The conditional variance and standard deviation are
Var[X|A] = E X 2 |A − (E [X|A])2 = 26 − (4.6)2 = 4.84
p
σX|A = Var[X|A] = 2.2
(6)
(7)
(b) Let the event B 0 denote the event that the document was sent to B and that the
document had no more than 6 pages. Hence, the event B 0 = {1, 3, 5} has probability
P B 0 = PX (1) + PX (3) + PX (5) = 0.4
(8)
The conditional PMF of X given B 0 is

(
 3/8 x = 1, 3
PX (x)
0
x∈B
0]
P
[B
1/4 x = 5
PX|B 0 (x) =
=

0
otherwise
0
otherwise
(9)
ECE302 Spring 2015
HW9 Solutions
May 3, 2015
Given the event B 0 , the conditional first and second moments are
X
xPX|B 0 (x) = 1(3/8) + 3(3/8) + 5(1/4)+ = 11/4
E X|B 0 =
4
(10)
x
X 2
x PX|B 0 (x) = 1(3/8) + 9(3/8) + 25(1/4) = 10
E X 2 |B 0 =
(11)
x
The conditional variance and standard deviation are
Var[X|B 0 ] = E X 2 |B 0 − (E X|B 0 )2 = 10 − (11/4)2 = 39/16
p
√
σX|B 0 = Var[X|B 0 ] = 39/4 ≈ 1.56
(12)
(13)
Solution to Problem 7.4.4 (SK)
We are given that Z ∼ N (0, 1), independent of X, and Y = X + Z.
We are asked to find the conditional PDF fY |X (y|x).
There are many theorems that at first glance appear to be potentially useful here. However,
we do not need any of them to solve the problem. Going back to the definition of the
conditional CDF and the CDF, we have that
FY |X (y|x) = P [Y ≤ y|X = x]
(14)
= P [X + Z ≤ y|X = x]
(15)
= P [x + Z ≤ y]
(16)
= P [Z ≤ y − x]
(17)
= FZ (y − x).
(18)
Then
d
F
(y|x)
dy Y |X
d
=
FZ (y − x)
dy
∂
∂z
=
FZ (z)
∂z
∂y
= fZ (y − x) · 1
fY |X (y|x) =
(19)
(20)
(21)
(22)
(23)
so
fY |X (y|x) =
1
2π
2 /2
e−(y−x)
.
ECE302 Spring 2015
HW9 Solutions
May 3, 2015
5
Problem 4.9.3 •
X and Y have joint PDF

 (4x + 2y)/3 0 ≤ x ≤ 1;
0 ≤ y ≤ 1,
(x, y) =

0
otherwise.
fX,Y
(a) For which values of y is fX|Y (x|y) defined? What is fX|Y (x|y)?
(b) For which values of x is fY |X (y|x) defined? What is fY |X (y|x)?
Problem 7.4.6 Random variables X and Y have joint PDF

 (4x + 2y)/3 0 ≤ x ≤ 1;
0 ≤ y ≤ 1,
fX,Y (x, y) =

0
otherwise.
Let A = {Y ≤ 1/2}.
(a) What is P [A]?
(b) Find fX,Y |A (x, y), fX|A (x), and fY |A (y).
Solution to Problem 7.4.6 (SK)
First let’s check to be sure that the given joint PDF is valid.
1
Z 1Z 1
Z 1
2x2 y + xy 2 2
1
(4x + 2y)/3dxdy
(2x + 2xy)|0 dy =
= 3/3.
3
0
0
0
0
(a) For what values of y is fX|Y (x|y) defined?
The conditional PDF is defined for y such that fY (y) > 0. Thus
1
Z
fY (y) =
0
1
2(1 + y)
2x2 + 2xy =
(4x + 2y)/3dx =
3
3
0
which is defined on [0, 1] subject to the added (and superfluous here) requirement that
y 6= −1. Now
2x+2y
fX,Y (x, y)
x, y ∈ [0, 1]
1+y
fX|Y (x|y) =
=
fY (y)
0
otherwise.
(b) For what values of x is fY |X (y|x) defined?
fY |X(y|x) is defined for x such that fX (x) 6= 0. so
Z
fX (x) =
1
(4x + 2y)/3dy =
0
1
4xy + y 2 4x + 1
=
3
3
0
ECE302 Spring 2015
HW9 Solutions
May 3, 2015
6
requires x 6= −1/4.
fY |X (y|x) =
fX,Y (x, y)
=
fX (x)
4x+2y
4x+1
x, y ∈ [0, 1]
otherwise.
0
Solution to 7.4.8 (SK)
We are given that Y = ZX where X ∼ N (0, 1),

 1−p
p
PZ (z) =

0
X and Z are independent, and
z = −1,
z = 1,
otherwise.
(1)
(a) Putting these together we have that the PDF of Y is either
2
(1/2π)e−x /2
with probability p
2 /2
−(−x)
(1/2π)e
with probability 1 − p.
Thus
fY |Z (y|1) = fY |Z (y| − 1) = (1/2π)e−x
2 /2
and Y and Z are independent.
(b) Note that while conditioning on Z yields a PDF, conditioning on X yields a PMF.
p
y=x
PY |X (y|x) := P [Y = y|X = x] =
1 − p y = −x.
Thus by Theorem 7.11 Y and X are not independent.
Problem 7.5.2 •
Let random variables X and Y have joint PDF fX,Y (x, y) given in Problem 4.9.4. Find the
PDF fX (x), the conditional PDF fY |X (y|x), and the conditional expected value E[Y |X = x].
Problem 7.5.2 Solution
Random variables X and Y have joint PDF
Y
1
fX,Y (x, y) =
2 0≤y≤x≤1
0 otherwise
(1)
X
1
For 0 ≤ x ≤ 1, the marginal PDF for X satisfies
Z ∞
Z
fX (x) =
fX,Y (x, y) dy =
−∞
0
x
2 dy = 2x
(2)
ECE302 Spring 2015
HW9 Solutions
May 3, 2015
7
Note that fX (x) = 0 for x < 0 or x > 1. Hence the complete expression for the marginal
PDF of X is
2x 0 ≤ x ≤ 1
fX (x) =
(3)
0 otherwise
The conditional PDF of Y given X = x is
fY |X (y|x) =
fX,Y (x, y)
=
fX (x)
1/x 0 ≤ y ≤ x
0
otherwise
(4)
Given X = x, Y has a uniform PDF over [0, x] and thus has conditional
R ∞ expected value
E[Y |X = x] = x/2. Another way to obtain this result is to calculate −∞ yfY |X (y|x) dy.
Problem 7.5.4 The probability model for random variable A is

 1/3 a = −1,
2/3 a = 1,
PA (a) =

0
otherwise.
The conditional probability model for random variable B given A is:

 1/3 b = 0,
2/3 b = 1,
PB|A (b| − 1) =

0
otherwise,

 1/2 b = 0,
1/2 b = 1,
PB|A (b|1) =

0
otherwise.
(a) What is the probability model for random variables A and B? Write the joint PMF
PA,B (a, b) as a table.
(b) If A = 1, what is the conditional expected value E[B|A = 1]?
(c) If B = 1, what is the conditional PMF PA|B (a|1)?
(d) If B = 1, what is the conditional variance Var[A|B = 1] of A?
(e) What is the covariance Cov[A, B] of A and B?
Problem 7.5.4 Solution
(a) First we observe that A takes on the values SA = {−1, 1} while B takes on values
from SB = {0, 1}. To construct a table describing PA,B (a, b) we build a table for all
possible values of pairs (A, B). The general form of the entries is
b=0
b=1
PA,B (a, b)
a = −1
PB|A (0| − 1) PA (−1) PB|A (1| − 1) PA (−1)
a=1
PB|A (0|1) PA (1)
PB|A (1|1) PA (1)
(1)
ECE302 Spring 2015
HW9 Solutions
May 3, 2015
8
Now we fill in the entries using the conditional PMFs PB|A (b|a) and the marginal
PMF PA (a). This yields
PA,B (a, b)
b=0
b=1
PA,B (a, b) b = 0 b = 1
a = −1
(1/3)(1/3) (2/3)(1/3) which simplifies to a = −1
1/9
2/9
(1/2)(2/3) (1/2)(2/3)
1/3
1/3
a=1
a=1
(2)
(b) Since PA (1) = PA,B (1, 0) + PA,B (1, 1) = 2/3,
PA,B (1, b)
PB|A (b|1) =
=
PA (1)
1/2 b = 0, 1,
0
otherwise.
(3)
If A = 1, the conditional expectation of B is
E [B|A = 1] =
1
X
bPB|A (b|1) = PB|A (1|1) = 1/2.
(4)
b=0
(c) Before finding the conditional PMF PA|B (a|1), we first sum the columns of the joint
PMF table to find
4/9 b = 0
(5)
PB (b) =
5/9 b = 1
The conditional PMF of A given B = 1 is
PA|B (a|1) =
PA,B (a, 1)
=
PB (1)
2/5 a = −1
3/5 a = 1
(6)
(d) Now that we have the conditional PMF PA|B (a|1), calculating conditional expectations
is easy.
X
E [A|B = 1] =
aPA|B (a|1) = −1(2/5) + (3/5) = 1/5
(7)
a=−1,1
X
E A2 |B = 1 =
a2 PA|B (a|1) = 2/5 + 3/5 = 1
(8)
a=−1,1
The conditional variance is then
Var[A|B = 1] = E A2 |B = 1 − (E [A|B = 1])2 = 1 − (1/5)2 = 24/25
(e) To calculate the covariance, we need
X
E [A] =
aPA (a) = −1(1/3) + 1(2/3) = 1/3
(9)
(10)
a=−1,1
E [B] =
1
X
bPB (b) = 0(4/9) + 1(5/9) = 5/9
(11)
b=0
E [AB] =
1
X X
abPA,B (a, b)
(12)
a=−1,1 b=0
= −1(0)(1/9) + −1(1)(2/9) + 1(0)(1/3) + 1(1)(1/3) = 1/9
(13)
ECE302 Spring 2015
HW9 Solutions
May 3, 2015
9
The covariance is just
Cov [A, B] = E [AB] − E [A] E [B] = 1/9 − (1/3)(5/9) = −2/27
(14)