ELEN90054 Probability and Random Models: X S K K
ELEN90054 Probability and Random Models: X S K K
In this question time-slots are brought into play, at each time-slot the 5 computers each
connect to one of the three servers. We read the question as “what is the number of
time-slots before at least one of the 5 computers connects to S1 ?”
From the Tutorial Workshop of week 4 Question 5a) we know that the probability that
none of the 5 computers connects to S1 equals (0.8)5 . Now define Y as the random
variable that counts the number of time-slots until (and including) at least one of the 5
computers connects to S1 . Then Y ∼ Geometric(1 − (0.8)5 ). As a result
1
E[Y ] = ≈ 1.49
1 − (0.8)5
The question asks for the expected # of time-slots BEFORE at least one of the 5 com-
puters connects to S1 . This equals E[Y − 1] = E[Y ] − 1 ≈ 0.49.
Now let’s find E[X 2 ] and then solve for the variance.
X 1 1 1 1 1 1 91
E[X 2 ] = x2 P [X = x] = 12 · + 22 · + 32 · + 42 · + 52 · + 62 · = =
x∈SX
6 6 6 6 6 6 6
2
2 91 2 7 182 − 147 35
Var(X) = E[X ] − (E[X]) = − = =
6 2 12 12
1
4.
X 1 1
E[W ] = P [W = wi ] · wi = · (−1) + · 1 = 0.
wi ∈SW
2 2
X 2
E[X] = P [X = xi ] · xi = (0.1) · (−2) + (0.9) · = 0.
xi ∈SX
9
X 1 1
E[Y ] = P [Y = yi ] · yi = · 0 + · 2 = 1.
yi ∈SY
2 2
X 7 7 27 7 + 243 25
E[Z] = P [Z = zi ] · zi = (0.1) · + (0.9) · 3 = + = = .
zi ∈SZ
9 90 10 90 9
Now let’s solve for the variance by solving for the following first:
X 1 1
E[W 2 ] = · (−1)2 + · 12 = 1
P [W = wi ] · wi2 =
wi ∈SW
2 2
2
2
X
2 2 2 4 4 4
E[X ] = P [X = xi ] · xi = (0.1) · (−2) + (0.9) · = + = .
xi ∈SX
9 10 90 9
X 1 1
E[Y 2 ] = P [Y = yi ] · yi2 = · 02 + · 22 = 2.
yi ∈SY
2 2
2
2
X
2 7 49 81 49 + 812 6610
E[Z ] = P [Z = zi ] · zi = (0.1) · + (0.9) · 32 = + = =
z ∈S
9 810 10 810 810
i Z
Notice that W and X are zero mean, while Y and Z are not. Also notice, that while
their means are different, W and Y have the same variance. In addition, X and Z have
the same variance.
25
With closer examination, we can easily see that Y = W + 1 and Z = X + 9
. Thus,
Adding a constant changes the mean but not the variance and therefore Var(W ) =
Var(Y ) and Var(X) = Var(Z) .
2
5. The first thing you should do is plot the CDF so you can use the plot to help visualize
and obtain the answers.
function in its PDF which is the derivative of the cdf FX (x). We now plot the
pdf fX (x) as a function of x: Note that the generalized derivative of the unit step
3
6. (a) The given pdf has 3 separate regions (below 0, 0 to 2, and above 2), so the CDF
will have 3 regions as well. The 3 cases for FX (x) = P [X ≤ x] are:
Case 1: x < 0 =⇒ FX (x) = 0
Case 2: 0 ≤ x < 2
x x
x
u2 x2
Z Z
u
FX (x) = fX (u)du = du = =
−∞ 0 2 4 0 4
0.16
(b) P [X > 0.4] = 1 − P [X ≤ 0.4] = 1 − FX (0.4) = 1 − 4
= 0.96
(1)2
(c) P [− 12 < X ≤ 1] = FX (1) − FX (− 12 ) = 4
−0= 1
4
(d) P [X > 1 | X < 21 ] = 0. This is just from using common sense. If X < 12 , then
it cannot be greater than 1. Another way to do this is to expand the conditional
probability formula and the intersection of (X > 1) and (X < 12 ) is the empty
set, whose probability is 0.
(e) Let’s first find the mean. Then we’ll use the alternative calculation for the vari-
ance, so we need to find E[X 2 ].
∞ 2
2
x3
Z Z
x 8 4
E[X] = xfX (x)dx = x · dx = = =
−∞ 0 2 6 0 6
3
∞
2 2
x4
Z Z
2 2 x 162
E[X ] = x fX (x)dx = x · dx = = =2
−∞ 0 2 8 0 8
2
2 2 4 16 2
Var(X) = E[X ] − (E[X]) = 2 − =2− =
3 9 9
7. a. The given pdf has 4 separate regions, so the cdf will have the same. The 4 cases are:
4
Case 3: 0 ≤ x < 1 =⇒ fX (x) = |x| = x
Z x Z 0 Z x
FX (x) = fX (u)du = fX (u)du + fX (u)du
−∞ −∞ 0
Z x x
1 u2 1 x2
= FX (0) + udu = + = +
0 2 2 0 2 2
Next, let Y ∼ Exp(λ). Then E[Y ] = 1/λ (the last step uses integration by parts, find
out for yourself):
Z ∞ Z ∞
1
E[Y ] = yfY (y)dy = yλe−λy dy = .
−∞ 0 λ
In order to get the variance of Y , let us first compute E[Y 2 ], using, again, integration
by parts:
Z ∞ Z ∞ Z ∞
−λy 2 −λy ∞ 2 2
2
E[Y ] = 2
y fY (y)dy = 2
y λe dy = −y e |0 +2 ye−λy dy = 0+ E[Y ] = 2 .
−∞ 0 0 λ λ
5
Then
2 1 1
Var(Y ) = E[Y 2 ] − (E[Y ])2 = 2
− 2 = 2.
λ λ λ
As λ gets larger, both the expectation and the variance gets smaller.
9. Let X ∼ U (3, 5) and Y ∼ U (2, 6). Clearly their means are the same (µ = 4) but the
variance of Y is 4 times as large as the variance of X. If you plot the two PDFs, you
can see that Y is more “spread out” as it is uniform over a larger range. This is what
gives it a larger variance. Remember that we can interpret the variance as the empirical
average of the squared distance from the mean in a large experiment.
10. X ∼ U [−1, 3] and Y = X 2 . The CDF of X is linear and easily written down as
0 , x < −1
1+x
FX (x) = 4
, −1 ≤ x < 3
1, x≥3
(a)
∞ 3
3
x2
Z Z
1 9 1
E[X] = xfX (x)dx = x dx = = − =1
−1 4 8 −1 8 8
−∞
Z ∞ Z 3 3
2 2 21 x3 27 −1 28
E[X ] = x fX (x)dx = x dx = = − =
−∞ −1 4 12 −1 12 8 12
28 16 4
Var(X) = E[X 2 ] − (E[X])2 = − (1)2 = =
12 12 3
(b)
28 7
E[Y ] = E[X 2 ] = =
12 3
Z ∞ 3
3
x5 243 −1
Z
2 4 4 41 244
E[Y ] = E[X ] = x fX (x)dx = x dx = = − =
−∞ −1 4 20 −1
20 20 20
2
244 7
Var(Y ) = E[Y 2 ] − (E[Y ])2 = − ≈ 6.75555
20 3
(c) For an arbitrary y we have
FY (y) = P [Y ≤ y] = P [X 2 ≤ y].
Clearly for y < 0 it follows that FY (y) = 0 and for y ≥ 9 it follows that FY (y) = 1.
For 0 ≤ y ≤ 9 we have
FY (y) = P [Y ≤ y] = P [X 2 ≤ y]
√ √
= P [− y ≤ X ≤ y]
√ √
= FX ( y) − FX (− y)
√
1+ y √
= − FX (− y).
4
6
√
To get the value of FX (− y), we need to distinguish two cases:
Case 1: 0 ≤ y < 1 : √
√ 1− y
FX (− y) =
4
Case 2: 1 ≤ y < 9 :
√
FX (− y) = 0.
Finally, we can now put it all together and write:
0, y<0
√
y
2 , 0≤y<1
FY (y) = √
1+ y
4
, 1≤y<9
1, x≥9
11. It is clear that Y can only have non-zero probability density in [0, 2].
= P [−y ≤ X − 2 ≤ y]
= P [−y + 2 ≤ X ≤ y + 2]
= FX (y + 2) − FX (2 − y)
y+2 2−y
= −
4 4
y
=
2
7
Thus
0, y < 0
y
FY (y) = 2
, 0≤y≤2
1, y > 2
12. Clearly, the random variable Z can only have non-zero probability density in [0, 3].
FZ (z) = P [Z ≤ z] = P [|X − 1| ≤ z]
= P [−z ≤ X − 1 ≤ z]
= P [1 − z ≤ X ≤ z + 1]
= FX (z + 1) − FX (1 − z)
z+1
= − FX (1 − z)
4
To get the value of FX (1 − z), we need to distinguish two cases:
Case 1: 0 ≤ z ≤ 1 :
1−z
FX (1 − z) =
4
Case 2: 1 < z ≤ 3 :
FX (1 − z) = 0.
Finally, we can now put it all together and write:
0, z < 0
z, 0≤z≤1
2
FZ (z) = z+1
4
, 1<z≤3
1, z > 3
13. (a) The first thing you should notice is that for x < −2, FX (x) = 0, and for x > 2,
FX (x) = 1. Further,
Z x
for −2 < x < 0: FX (x) = = (1/2 + u/4) du
−2
x
u2 x x2 1
= u/2 + = + +
8 −2 2 8 2
8
Z x Z x
For 0 < x < 2: FX (x) = fX (x)dx = FX (0) + 1/2 − u/4 du
−∞ 0
1 x x2
= + −
2 2 8
(b)
(c)
1 1 1 1
P [− < X ≤ ] = P [X ≤ ] − P [X ≤ − ]
2 4 4 2
1 1
= FX − FX −
4 2
12
1 (− 12 )2 1
1 4 1
= − + − − + +
8 8 2 4 8 2
43
= ≈ 0.336
128
(d)
1 1 1
P |X| > = P X> +P X <−
3 3 3
1 1
= 1 − FX + FX −
3 3
1 1 1 1 1 1
= 1− − + + − + +
6 9·8 2 6 9·8 2
= 0.69
(e) The pdf is an even function (meaning that fX (x) = fX (−x)), so the mean equals
zero.
9
(b)
Z ∞
E[X] = x · fX (x)dx
−∞
Z −2 Z 4
1 1
= x · dx + x · dx
−4 4 2 4
−2 4
x2 x2
= +
2 · 4 −4 2 · 4 2
(−2)2 (−4)2 (4)2 (2)2
= − + −
8 8 8 8
= 0
This can also be obtained by noticing that the pdf in part a is an even function: fX (x) =
fX (−x).
(c)
P [|X| ≤ 3] = 1−P [|X| > 3] = 1−2P [X > 3] = 1−2(1−P [X ≤ 3]) = 2FX (3)−1
10
15. (a)
1 1
P X≤ = FX
5 5
2
1 1
= +
8 5
= 0.165
(b)
(c) This is at a point of continuity on the CDF (no jumps), so it must be 0 probability.
Here is just a check to be sure.
−
1 1 1
P X= = FX − FX
2 2 2
" 2 #
3 1 1
= − +
8 8 2
= 0
(d)
P [X = 1] = FX (1) − FX (1− )
1 1 3
= + −
2 8 8
1
=
4
(e)
(f)
11
Notice there is a jump at x = 0 for FX (x), therefore X cannot be a continuous random
variable. The same is true at x = 1.
Also, the cdf is not piecewise constant, ie it increases continuously in the intervals
[0, 1/2) and [1, 4). So X cannot be a discrete random variable either. It is therefore a
mixed random variable.
1
8
δ(x), x=0
1
2x, 0<x<
2
dFX (x)
1
fX (x) = = 4
δ(x − 1), x=1
dx
1
8
, 1<x<4
0,
else
(g)
Z ∞
E(X) = x · fX (x)dx
−∞
Z 0+ 1
Z Z 1+ Z 4
2 1
= 0 · fX (x) dx + x · 2x dx + 1 · fX (x) dx + x · dx
0− 0 1− 1 8
1 4
2x3 2 1 x2
= 0 + + +
3 0 4 16 1
3
2 1 1 42 12
= · + +( − )
3 2 4 16 16
1 1 1 61
= + +1− =
12 4 16 48
16. (a)
Z 0 Z 2
1 2 1
E[Z] = E[g(X)] = −x · dx + x2 ·
−2 4 0 4
= 0.
This can also be obtained by noticing that fX (x) is an even function but g(x) is an odd
function, so that the product function fx (x)g(x) is an odd function. Integrating this
from x = −2 to x = 2 gives zero.
(b) Z takes on values between [−4, 4] only. Therefore, FZ (z) = 0 for z < −4, and
FZ (z) = 1 for z ≥ 4. We must now find the CDF for −4 ≤ z < 4. This needs to
12
be split up into two cases because the function has a change at 0. The two cases are
−4 ≤ z < 0, and 0 ≤ z < 4.
Case 1: −4 ≤ z ≤ 0
Case 2: 0 ≤ z < 4
We can now take the derivative with respect to z to get the PDF:
0 z < −4
√1
−4 ≤ z < 0
8 −z
fZ (z) = 1
√
8 z
0<z<4
0 z≥4
Note that for z approaching 0 the value of fZ (z) approaches ∞. This does not matter,
all that matters is that fZ (·) is an integrable function. Do for yourself: plot the CDF
and the PDF as a function of z.
When y ≥ 0, we have
Z 0 Z byc+0.5
FY (y) = x/2
e /4dx + e−x/2 /4dx = 1 − e−(byc+0.5)/2 /2
−∞ 0
13
Its pmf is
pY (y) = P [Y = y] = P [y − 0.5 ≤ X < y + 0.5]
Case 1: y = 0. We have
Z 0.5 Z 0.5
−|x|/2
pY (0) = e /4dx = 2 e−x/2 /4dx = 1 − e−1/4
−0.5 0
Case 2: y = 1, 2, 3, . . ..
Z y+0.5
pY (y) = e−x/2 /4dx = e−y/2 (e1/4 − e−1/4 )/2
y−0.5
by symmetry.
(b)
P [Z ≤ z] = P [X − round(X) ≤ z]
Notice that Z ∈ [−1/2, 1/2). Let’s consider the event {Z ≤ z}, where −1/2 ≤ z <
1/2. This is equivalent to:
∞
[
{Z ≤ z} = (X ∈ (i − 0.5, i + z])
i=−∞
For every integer i, there will be some region where Z ≤ z. Each region is disjoint, so
we have a union of disjoint events.
" ∞ #
[
P [Z ≤ z] = P i − 0.5 < X ≤ i + z
i=−∞
∞
X
= P [i − 0.5 < X ≤ i + z]
i=−∞
−1 Z
X i+z ∞ Z
X i+z Z z
−x/2
= ex/2
/4dx + e /4dx + e−|x|/2 /4dx
i=−∞ i−0.5 i=1 i−0.5 −0.5
e−|z|/2
z/2
cosh(z/2) e /4 if z ≤ 0 cosh(z/2)
fZ (z) = + = +
2(e1/2 − 1) e−z/2 )/4 if z ≥ 0 2(e1/2 − 1) 4
14