29650 Engineering Mathematics 2 - Tutorial sheet 1: Solutions
Sean Elvidge
Question 1
Let P be the probability density function over the set {1, 2, 3, 4, 5, 6} defined by:
P (1) = P (6) = 0.3 (1)
P (2) = P (3) = P (4) = P (5) = 0.1 (2)
Let r be a discrete random variable governed by P . Calculate the expected value E(r) and variance V (r) of
r.
Solution 1
6
X 1 35
E(r) = xP (x) = (3 × 1 + 1 × 2 + 1 × 3 + 1 × 4 + 1 × 5 + 3 × 6) = = 3.5 (3)
n=1
10 10
6
X 1
V (r) = (x − E(r))2 P (x) = (3 × 2.52 + 1.52 + 0.52 + 0.52 + 1.52 + 3 × 2.52 ) (4)
n=1
10
1 42.5
= (3 × 6.25 + 2.25 + 0.25 + 0.25 + 2.25 + 3 × 6.25) = = 4.25 (5)
10 10
Question 2
Let r be a continuous random variable governed by a uniform probability density function over the interval
[2, 10]. Calculate the expected value and variance of r.
Solution 2
You can work this out from first principles, but from the lecture you know that if r is governed by a uniform
PDF over the interval [a, b] then
a+b
E(r) = (6)
2
(b − a)2
V (r) = (7)
12
64 16
In this case a = 2, b = 10 so E(r) = 6 and V (r) = 12 = 3
Question 3
Let r be a continuous or discrete random variable. Show that
V (r) = E(r2 ) − [E(r)]2 (8)
1
Solution 3
Suppose r is continuous and governed by a PDF p
Z ∞
V (r) = (x − E(r))2 p(x)dx (9)
−∞
Z ∞
= (x2 − 2xE(r) + E(r)2 )p(x)dx (10)
−∞
Z ∞ Z ∞ Z ∞
2 2
= x p(x)dx − 2E(r) xp(x)dx + E(r) p(x)dx (11)
−∞ −∞ −∞
= E(r ) − 2E(r)2 + E(r)2 = E(r2 ) − E(r)2
2
(12)
Question 4
Let r1 and r2 be uncorrelated random variables. Show that
V (r1 + r2 ) = V (r1 ) + V (r2 ) (13)
Solution 4
V (r1 + r2 ) = E((r1 + r2 )2 ) − E(r1 + r2 )2 (14)
= E(r12 + 2r1 r2 + r22 ) − [E(r1 ) + E(r2 )]2 (15)
= E(r12 ) + 2E(r1 r2 ) + E(r22 ) − E(r1 )2 − 2E(r1 )E(r2 ) − E(r2 )2
(16)
= E(r12 ) − E(r1 )2 + E(r22 ) − E(r2 )2 (17)
= V (r1 ) + V (r2 ) (18)
The step from equation (16) to (17) relies on the fact that r1 and r2 are uncorrelated.
Question 5
Let x be a continuous random variable. Let a, b ∈ R, a > 0. Define a new random variable q by
q = (a × x) + b (19)
Show that E(q) = aE(x) + b and V (q) = a2 V (x)
Solution 5
Z ∞ Z ∞ Z ∞
E(q) = (ax + b)p(x)dx = a xp(x)dx + b p(x)dx = aE(x) + b (20)
−∞ −∞ −∞
Z ∞ Z∞
V (q) = ((ax + b) − (aE(q) + b))2 p(x)dx = a2 (x − E(q))2 p(x)dx = a2 V (x) (21)
−∞ −∞
Question 6
Let p be the continuous PDF defined by
p(x) =
0, x < 0 (22)
sin(x)
p(x) = ,0 ≤ x ≤ π (23)
2
p(x) = 0, x > π (24)
2
Let r be a continuous random variable governed by p.
1. Verify that p is a PDF
2. Calculate E(r) and V (r).
Solution 6
To see that p is a PDF note that
Z ∞
1 π
Z
1
p(x)dx = sin(x)dx = [−cos(x)]π0 = 1 (25)
−∞ 2 0 2
π
It is fairly clear that E(r) = 2.
To show this formally:
1 π
Z
1 π
E(r) = xsin(x)dx = [sin(x) − xcos(x)]π0 = . (26)
2 0 2 2
1
Rπ dV
(Solve 2 0
xsin(x)dx using integration by parts with U = x and dx = sin(x))
For the variance,
Z π
1 π 2
V (r) = (x − ) sin(x)dx (27)
2 0 2
Apply integration by parts with U = (x − π2 )2 and dV
dx = sin(x) to get
Z π π Z π
1 π 2 1 π π
(x − ) sin(x)dx = − cos(x)(x − )2 + (x − )cos(x)dx (28)
2 0 2 2 2 0 0 2
Apply integration by parts again to solve the final integral. Set U = (x − π2 ) and dV
dx = cos(x) to get
Z π iπ Z π
π h π
(x − )cos(x)dx = (x − )sin(x) − sin(x)dx (29)
0 2 2 0 0
So,
Z π π Z π
1 π 1 π 2 π
(x − )2 sin(x)dx = − cos(x)(x − ) + (x − ) − sin(x)dx (30)
2 0 2 2 2 2 0 0
π
1 π π
= − cos(x)(x − )2 + (x − ) + cos(x) (31)
2 2 2 0
π2
1 π 2 1 π 2
= − (−1)( ) + 0 − 1] − [− (1)(− ) + 1 = −2 (32)
2 2 2 2 4