Probability and Random Processes Problem Set 7

UC Berkeley
Department of Electrical Engineering and Computer Science
EE 126: Probability and Random Processes
Problem Set 7: Solutions
Fall 2007
Issued: Thursday, October 18, 2007
Due: Friday, October 26, 2007
Reading: Bertsekas & Tsitsiklis, §4.1–4.4
Problem 7.1
Suppose X and Y are independent and exponentially distributed, each with parameter λ.
(a) Find the CDF and PDF of Z = X/Y . Is E[Z] less than, equal to, or greater than 1?
(b) Find the joint density function of Z as defined in (a) and the random variable W , where
W = X + Y . Are Z and W independent?
Solution:
1. For z ≥ 0,
X
≤ z)
Y
P r(X ≤ zY )
Z zy
Z ∞
fX (x)dxdy
fY (y)
0
0
Z ∞
Z zy
λe−λy
λe−λx dxdy
0
Z0 ∞
−λy
λe
(1 − e−λzy )dy
FZ (z) = P r(
=
=
=
=
0
= 1−
The PDF of Z is fZ (z) =
1
,
(1+z)2
1
1+z
for z > 0.
The expectation of Z is ∞.
2. Consider FZ,W (z, w), for z, w > 0,
X
FZ,W (z, w) = P r( ≤ z, X + Y ≤ w)
Y
Z w−x
Z zw
1+z
fY (y)dydx
fX (x)
=
x
z
0
=
Z
=
Z
=
zw
1+z
fX (x)(e−
λx
z
− e−λ(w−x) dx
0
zw
1+z
λe−λ
0
1+z
x
z
dx −
Z
zw
1+z
λe−λw dx
0
λzw −λw
z
(1 − e−λw ) −
e
1+z
1+z
1
It follows that for z, w > 0,
fZ,W (z, w) =
=
∂ 2 FZ,W (z, w)
∂z∂w
1
λ2 we−λw
(1 + z)2
We recognize the z-dependent term above as being fZ (z), so evidently the marginal
density of W will be the remaining terms, namely λ2 we−λw . Hence Z and W are
independent, as fZ,W (z, w) = fZ (z)fW (w).
If you are comfortable with the Jacobian, it is easy to verify that:
wz
x(z, w) = 1+z
w
y(z, w) = 1+z
And the Jacobian of this tranformation is:
∂x(z,w) ∂y(z,w)
∂z
∂z
J = ∂x(z,w)
∂y(z,w)
∂w
∂w
We know that for w > 0, z > 0,
w
=
(1 + z)2
fZ,W (z, w) = fX,Y (x(z, w), y(z, w))|J|
1
=
λ2 we−λw
(1 + z)2
, which is the same as before.
Problem 7.2
Consider random variable Z with transform MZ (s) =
8−3s
.
s2 −6s+8
(a) Find P (Z ≥ 0.5).
(b) Find E[Z] by using the probability distribution of Z.
(c) Find E[Z] by using the tranform of Z and without explicity using the probability distribution of Z.
(d) Find var(Z) by using the probability distribution of Z.
(e) Find var(Z) by using the tranform of Z and without explicity using the probability
distribution of Z.
Solution:
2
(a) We approach this problem by first finding the pdf of Z using partial fraction expansion:
A
B
8 − 3s
=
+
− 6s + 8
s−4 s−2
8 − 3s = −2
A = (s − 4)MZ (s)
=
s − 2 s=4
s=4
8
−
3s
B = (s − 2)MZ (s)
= −1
=
s − 4 s=2
s=2
MZ (s) =
MZ (s) =
s2
−2
−1
1 4
2
1
+
= (
+
) ⇒ fz (z) = (4e−4z + 2e−2z )(z ≥ 0)
s−4 s−2
2 4−s 2−s
2
Z
P (Z ≥ 0.5) =
∞
0.5
1 −4z
(4e
+ 2e−2z )dz
2
e−2 e−1
+
2
2
=
(b)
E[Z] =
=
=
=
∞
z −4z
(4e
+ 2e−2z )dz
2
0
Z ∞
Z ∞
1
−4z
2ze−2z dz)
4ze dz +
(
2 0
0
1 1 1
( + )
2 4 2
3
8
Z
(c)
E[Z] =
=
=
=
d
MZ (s)
ds
s=0
2
1 d
(
+
)
ds 4 − s 2 − s s=0
2
1
+
2
2
(4 − s)
(2 − s) s=0
3
8
(d) We know var(Z) = E[Z 2 ] − E[Z]2 , so:
3
Z
∞
− ( 38 ) =
11
64
z2
(4e−4z + 2e−2z )dz
2
0
Z ∞
Z ∞
1
2 −4z
2z 2 e−2z dz)
4z e dz +
(
2 0
0
1 2
2
( 2 + 2)
2 4
2
5
16
2
E[Z ] =
=
=
=
So we have var(Z) =
5
16
2
.
(e)
2
E[Z ] =
=
=
=
d2
M
(s)
Z
ds2
s=0
d2
2
1 (
+
)
ds2 4 − s 2 − s s=0
4
2
+
3
3
(4 − s)
(2 − s) s=0
5
16
var(Z) = E[Z 2 ] − E[Z]2
3 2
5
−( )
=
16
8
11
=
64
Problem 7.3
k e−λ
The number of customers K who shop at a supermarket in a day has the PMF pK (k) = λ k!
for k = 0, 1, 2, . . . and, independent of K, the number L of items purchased by any customer
l −µ
has the PMF pL (l) = µ el! for l = 0, 1, 2, . . .. Two ways the supermarket can obtain a 10%
increase in the expected value of the number of items sold are:
(a) To increase µ by 10%.
(b) To increase λ by 10%.
Which of these changes would lead to the smaller variance of the total items sold per day?
Solution:
4
We have two independent discrete random variables:
K = the number of customers in a day and has a Poisson PMF with mean λ
Li = the number of items purchased by ith customer and has Poisson PMF with mean µ
Letting R denote the number of items sold in a day, then
R = L1 + L2 + . . . + LK
and we recognize that R is the sum of a random number of independently and identically
distributed random variables. Therefore, the mean and variance of R can be found using the
mean and variance of K and Li ≡ L. Namely,
E(R) = E(K)E(L)
Var(R) = E(K)Var(L) + [E(L)]2 Var(K)
and
Since K and L have Poisson PMFs,
E(K) = Var(K) = λ
and
E(L) = Var(L) = µ.
Therefore, we have
E(R) = λµ
and it is indeed true that the market can obtain a 10% increase in E(R) by either
a. increasing µ by 10%, or
b. increasing λ by 10%.
From option a or b, we want to choose the option which results in a smaller variance of R,
where
Var(R) = λµ + µ2 λ = λµ(1 + µ)
If we increase µ by 10%, µa = 1.1µ, then
Var(Ra ) = 1.1λµ(1 + 1.1µ)
If we increase λ by 10%, λ′ = 1.1λ
Var(Rb ) = 1.1λµ(1 + µ)
Since λ > 0 and µ > 0 (by definition, the mean of a Poisson random variable is positive)
then var(Rb ) < var(Ra ) so we prefer option b , or to increase λ by 10%.
Problem 7.4
X and Y are continuous, independent random variables. The transform of X is given by
MX (s) = 1s (e4s − e3s ), and the distribution of Y is given by

 3c, for −2 ≤ y ≤ −1,
fY (y) =
c, for 0 ≤ y ≤ 2,

0, otherwise.
(a) Find the numerical value of the constant c.
5
(b) Compute the transform MY (s).
(c) Find the mean and variance of Y .
(d) Find the transform MW (s), where W = αX + βY + γ.
(e) Determine the PDF of W for the case where α = 1, β = 1, and γ = 0.
Solution:
(a) By normalization, we know:
Z +∞
Z
fY (y) dy =
−∞
−1
3c dy +
Z
2
c dy
0
−2
= 5c
Therefore, we must have c = 51 .
(b) As in the book’s treatment of uniform random variables, we find the transform expression
that is valid for s 6= 0, since the antiderrivative formula used only applies to s 6= 0.
MY (s) =
Z
=
Z
=
+∞
−∞
−1
esy fY (y) dy
2
1 sy
e dy
0 5
−2
1 2s
1 3 −s
−2s
e −e
+
e −1
s 5
5
3 sy
e dy +
5
Z
(c)
E[Y ] =
Z
+∞
y · fY (y) dy
−∞
Z −1
3
y dy +
5
−2
−9
4
=
+
10
10
1
= −
2
=
E[Y ] =
Z
=
Z
2
+∞
−∞
−1
=
=
2
0
1
y dy
5
y 2 fY (y) dy
3 2
y dy +
5
−2
4
21
+
15 15
5
3
6
Z
Z
0
2
1 2
y dy
5
var(Y ) = E[Y 2 ] − E[Y ]2
5
3
−
=
17
12
=
1
4
(d) Remember that the transform is linear on the PDF expression, but not on the random
variable itself, and thus you cannot write MW (s) = αMX (s)+βMY (s)+γ. For a further
explanation and a derivation of the property used below, see page 212 Example 4.4 in
the text.
MW (s) = esγ E [exp {sαX} exp {sβY }]
= esγ MX (αs)MY (βs)
1
1 3 −βs
1 4αs
−2βs
2βs
3αs
sγ
+
e
−e
e −1
(e
−e )
= e
MX (s) =
αs
βs 5
5
(e) In principle, we could take the huge expression above and manipulate it into known
transform pairs, and take an inverse transform. However, since the distributions involved
are uniform over finite supports, the resulting PDF will be piecewise linear over finite
supports, and so the transform manipulations will be cumbersome. Since X is clearly
uniform over [34], and W is a sum of two independent random variables, it will be much
easier to instead consider the convolution of the PDFs of X and Y :
fY (y) =



fX (x) =
3
5,
1
5,
for −2 ≤ y ≤ −1,
for 0 ≤ y ≤ 2,
otherwise.
0,
1, for 3 ≤ x ≤ 4,
0, otherwise.
We can perform the convolution graphically. The PDF fW will look like a triangle and
a trapezoid, with the shapes’ sizes given by the heights of the boxes in fY since their
maximum points will be determined by the maximum overlap of fX with each box in fY .
The endpoints of the shapes can be determined by inspection if we visualize “flipping
and dragging” fX and keeping fY stationary.
The boxes will just start to overlap when w = 1, and fW will be increasing with the
overlap until w = 2, when the fX box fully overlaps with the fY box which is over
[−2 − 1]. The overlap will then decrease until the boxes no longer overlap when w = 3, at
which point the fX box sits exactly between the two boxes in fY . There is then another
linear increase from w = 3 to w = 4, then a constant as the fX box fully overlaps the
longer fY box, and then a linear decrease from w = 5 to w = 6.
Therefore, we have the following functional from for fW (w):
7
fW (w) =















3
5 (w − 1),
3
5 (−w + 3),
1
5 (w − 3),
1
5,
1
5 (−w + 6),
0,
for 1 ≤ w < 2,
for 2 ≤ w < 3,
for 3 ≤ w < 4,
for 4 ≤ w < 5,
for 5 ≤ w ≤ 6,
otherwise.
Problem 7.5
Steve is trying to decide how to invest his wealth in the stock market. He decides to use
a probabilistic model for the share price changes. He believes that, at the end of the day,
the change of price Zi of a share of a particular company i is the sum of two components:
Xi , due solely to the company, and the other Y due to investors’ jitter. Assume that Y ∼
N (0, 1) is standard normal and independent of Xi . Find the PDF of Zi under the following
circumstances in part a) to c),
(a) X1 is Gaussian with a mean of 1 dollar and variance equal to 4.
(b) X2 is equal to -1 dollars with probability 0.5, and 3 dollars with probability 0.5.
(c) X3 is uniformly distributed between -2.5 dollars and 4.5 dollars (No closed form expression
is necessary.)
(d) Being risk averse, Steve now decides to invest only in the first two companies. He uniformly chooses a portion V of his wealth to invest in company 1 (V is uniform between 0
and 1.) Assuming that a share of company 1 or 2 costs 100 dollars, what is the expected
value of the relative increase/decrease of his wealth?
Solution:
(a) Because Z1 is the sum of two independent Gaussian random variables, X1 and Y , the
PDF of Z1 is also Gaussian. The mean and variance of Z1 are equal to the sums of the
expected values of X1 and Y and the sums of the variances of X1 and Y , respectively.
fZ1 (z1 ) = N (1, 5)
(b) X2 is a two-valued discrete random variable, so it is convenient to use the total probability theorem and condition the PDF of Z2 on the outcome of X2 . Because linear
transformations of Gaussian random variables are also Gaussian, we obtain:
1
1
fZ2 (z2 ) = N (−1, 1) + N (3, 1)
2
2
(c) We can use convolution here to get the PDF of Z3 .
Z ∞
fZ3 (z3 ) =
N (0, 1)fX3 (z3 − y)dy
−∞
8
Using the fact that X3 is uniform from -2.5 to 4.5, we can reduce this convolution to:
fZ3 (z3 ) =
Z
z3 +2.5
z3 −4.5
1
N (0, 1) dy
7
A normal table is necessary to compute this integral for all values of z3 .
(d) Given an experimental value V = v, we see v multiplies Z ∼ N (1, 5), and 1 − v multiplies
Z ∼ 0.5N (−1, 1) + 0.5N (3, 1).
E[Z] = E[E[Z | V ]] =
Z
1
E[Z | V = v]fV (v)dv
0
1
1
+ 3 · ] = v + (1 − v) = 1
2
2
Plugging E[Z | V = v] and fV (v) = 1 into our first equation, we get
E[Z | V = v] = v · 1 + (1 − v)[−1 ·
E[Z] =
Z
1
1 · 1dv = 1.
0
Since the problem asks for the relative change in wealth, we need to divide E[Z] by 100.
Thus the expected relative change in wealth is 1 percent.
Problem 7.6
Oscar is an electrical engineer, and he is equally likely to work between zero and one hundred
hours each week (i.e., the time he works is uniformly distributed between zero and one
hundred). He gets paid one dollar an hour.
If Oscar works more than fifty hours during a week, there is a probability of 1/2 that he
will actually be paid overtime, which means he will receive two dollars an hour for each hour
he works longer than fifty hours. Otherwise, he will just get his normal pay for all of his
hours that week. Independently of receiving overtime pay, if Oscar works more than seventy
five hours in a week, there is a probability of 1/2 that he will receive a one hundred dollar
bonus, in addition to whatever else he earns.
Determine the expected value and variance of Oscar’s weekly salary.
Solution:
Define the following events and RVs:
W = number of hours Oscar works in a week,
T = total amount of Oscar’s earnings in a week (including overtime and bonus).
Now, We want to find E[T ] and Var(T ).
From the tree diagram in Figure we use total expectation theorem,
E[T ] =
7
X
P(Ai )E[T |Ai ]
i=1
9
Value of e
1
w < 50
A
1/2
A
1/2
1/4
e=w
1
2
e=w
50 < w < 75
1/2
1/4
A3
e = 2(w-50) + 50
A
4
e = w + 100
A
e=w
1/4
1/4
75 < w < 100
5
1/4
A
6
e = 2(w-50) + 150
7
e = 2(w-50) + 50
1/4
A
Note that {A1 , A2 , ..., A7 } is mutually exclusive and collectively exhaustive.
For each Ai , the conditional PDF fT |Ai (t) is constant because any linear function aX + b
of a uniformly distributed RV X is also uniformly distributed. Therefore,
fT |A1 (t)
fT |A2 (t)
fT |A3 (t)
fT |A4 (t)
fT |A5 (t)
fT |A6 (t)
fT |A7 (t)
and
E[T |A1 ]
E[T |A3 ]
E[T |A5 ]
E[T |A7 ]
=
=
=
=
=
=
=
1
50
1
25
1
50
1
25
1
25
1
50
1
50
for
for
for
for
for
for
for
0 ≤ t ≤ 50
50 < t ≤ 75
50 < t ≤ 100
175 < t ≤ 200
75 < t ≤ 100
200 < t ≤ 250
100 < t ≤ 150
E[T |A2 ] = 125
2
E[T |A4 ] = 375
2
E[T |A6 ] = 225
= 25
= 75
= 175
2
= 125.
Using the total expectation theorem, the expected salary per week is then equal to
E[T ] =
1 125 1
1 375
1 175
1
1
1
· 25 + ·
+ · 75 +
·
+
·
+
· 225 +
· 125 = 68.75.
2
8 2
8
16 2
16 2
16
16
10
For the variance of T , we need to first find E[T 2 ].
E[T 2 ] =
7
X
P(Ai )E[T 2 |Ai ].
i=1
Using the fact that E[X 2 ] = (a2 + ab + b2 )/3 = ((a + b)2 − ab)/3 for any uniformly
distributed RV X ranging from a to b, we obtain
E[T 2 |A1 ]
E[T 2 |A3 ]
E[T 2 |A5 ]
E[T 2 |A7 ]
=
502 /3
= (1502 − 50 · 100)/3
= (1752 − 75 · 100)/3
= (2502 − 100 · 150)/3.
E[T 2 |A2 ] = (1252 − 50 · 75)/3
E[T 2 |A4 ] = (3752 − 175 · 200)/3
E[T 2 |A6 ] = (4502 − 200 · 250)/3
Therefore,
E[T 2 ] =
1 2500 1 11875 1 17500 1 105625 1 23125 1 152500 1 47500
101875
+
+
+
+
+
+
=
.
2 3
8 3
8 3
16 3
16 3
16 3
16 3
12
Var(T ) = E[T 2 ] − (E[T ])2 =
180625
≈ 3763.
48
Problem 7.7
The Kelly strategy Consider a gambler who at each gamble either wins or loses his bet
with probabilities p and 1 − p, independently of earlier gambles. When p > 1/2, a popular
gambling system, known as the Kelly strategy, is to always bet the fraction 2p − 1 of the
current fortune. Assuming p > 1/2, compute the expected fortune after n gambles of a
gambler who starts with x units and employs the Kelly strategy.
Solution:
The problem is simplified by looking at the fraction of the original stake that the gambler
has at any given moment. Because the expected value operation is linear, we can compute the
expected fraction of the original stake and multiply by the original stake to get the expected
total fortune (the original stake is a constant).
If the gambler has a at the beginning of a round, he bets a(2p − 1) on the round. If he
wins, he’ll have a + a(2p − 1) units. If he loses, he’ll have a − a(2p − 1) units. Thus at the
end of the round, he will have 2pa following a win, and 2(1 − p)a following a loss.
Thus, we see that winning multiplies the gambler’s fortune by 2p and losing multiplies it
by 2(1 − p). Therefore, if he wins k times and loses m times, he will have (2p)k (2(1 − p))m
times his original fortune. We can also compute the probability of this event. Let Y be the
number of times the gambler wins in the first n gambles. Then Y has the binomial PMF:
n y
pY (y) =
p (1 − p)n−y ,
y = 0, 1, . . . , n.
y
We can now calculate the expected fraction of the original stake that he has after n
gambles. Let Z be a random variable representing this fraction. We know that Z is related
to Y via
Z = (2p)Y (2(1 − p))n−Y .
11
We will calculate the expected value of Z using the PMF of Y .
E[Z] =
=
=
=
=
n
X
y
n−y n
(2p) [2(1 − p)]
Z(y)pY (y) =
py (1 − p)n−y
y
y=0
y=0
n
X
y y n−y
n−y n
2 p 2
(1 − p)
py (1 − p)n−y
y
y=0
n
X
n y
2n
py (1 − p)n−y
p (1 − p)n−y
y
y=0
n X
y n−y
n
n
2
p2
(1 − p)2
y
y=0
n
2n p2 + (1 − p)2 ,
n
X
where the last equality follows using the generalized binomial formula
n X
n
k=0
k
ak bn−k = (a + b)n .
Thus the gambler’s expected fortune is
2n p2 + (1 − p)2
n
x,
where x is the fortune at the beginning of the first round.
An alternative method for solving the problem involves using iterated expectations. Let
Xk be the fortune after the kth gamble. Again, we use the fact that the expected fortune
after the kth gamble is
Xk = 2 p2 + (1 − p)2 Xk−1 .
Therefore, using iterated expectations, the fortune after n gambles is
E[Xn ] = E [E[Xn |Xn−1 ]]
= 2 p2 + (1 − p)2 E[Xn−1 ]
= 2 p2 + (1 − p)2 E [E[Xn−1 |Xn−2 ]]
2
= 2 p2 + (1 − p)2
E[Xn−2 ]
2
= 2 p2 + (1 − p)2
E [E[Xn−2 |Xn−3 ]]
3
= 2 p2 + (1 − p)2
E[Xn−3 ]
= ···
=
2 p2 + (1 − p)2
n
= 2
n
2 n
2
p + (1 − p)
12
E[X]
x.