Professional Documents
Culture Documents
Sean Elvidge
Question 1
Let r1 and r2 be continuous random variables. Show that if r1 and r2 are independent then they are also
uncorrelated.
Solution 1
The step from equation (4) to equation (5) uses the fact that r1 and r2 are independent and hence E(r1 r2 ) =
E(r1 )E(r2 ). To see this suppose r1 is governed by p1 and r2 is governed by p2 , then
Z ∞Z ∞
E(r1 r2 ) = xyp(x, y)dxdy (7)
−∞ −∞
Z ∞Z ∞
= xp1 (x)yp2 (y)dxdy (8)
−∞ −∞
Z ∞ Z ∞
= yp2 (y) xp1 (x)dxdy (9)
−∞ −∞
Z ∞
= yp(y)E(r1 )dy = E(r1 )E(r2 ) (10)
−∞
Question 2
A bag contains 60 dice. 30 of the dice are fair dice (F ), 20 are weighted such that P (6) = 0.8, P (x) =
0.04, (n = 1, 2, 3, 4, 5) (these are referred to as type W1 ), and the remaining 10 are weighted such that
P (6) = 0.9, P (x) = 0.02, (n = 1, 2, 3, 4, 5) (these are refered to as type W2 ). A dice is chosen at random from
the bag and thrown.
1. Calculate P (6) the probability that the value on the dice is a 6?
2. Calculate the posterior probabilities P (F |6), P (W1 |6) and P (W2 |6) that the dice is of type F , W1 and
W2 , respectively, given that a 6 was thrown?
3. Therefore, if a 6 is thrown, what is the most probable type of dice that was selected?
1
Solution 2
P (6|F )P (F ) 1 1 1 1
P (F |6) = =( × )÷ = (15)
P (6) 6 2 2 6
P (6|W1 )P (W1 ) 4 1 1 8
P (W1 |6) = =( × )÷ = (16)
P (6) 5 3 2 15
P (6|W2 )P (W2 ) 9 1 1 3
P (W1 |6) = =( × )÷ = (17)
P (6) 10 6 2 10
(18)
Question 3
A dark room contains two bags, each of which contains red and white balls. The first bag B1 contains 20 red
balls and 5 white balls. The second bag B2 contains 8 red balls and 15 white balls. Because of the positions
of the bags in the room, people choose to take balls from B1 five times as often as people choose B2
A person goes into the room, chooses a bag and takes one ball and then a second ball from the same bag.
On leaving the room, the person sees that he has a red ball and a white ball.
1. Calculate the prior probabilities P (B1 ) and P (B2 ).
2. Calculate the probability that the person has a red ball and a white ball if the balls were selected from
bag B1 .
3. Calculate the probability of a red ball and a white ball if the balls were taken from bag B2 .
4. Calculate the probability that the person has a red ball and a white ball.
5. Calculate the probability of B1 , given that the experiment resulted in a red ball and a white ball.
6. Calculate the probability of B2 , given that the experiment resulted in a red ball and a white ball.
7. Which bag did the person most probably take the balls from?
Solution 3
5 1
1. P (B1 ) = 5 × P (B2 ) and P (B1 ) + P (B2 ) = 1. Hence P (B1 ) = 6 = 0.83 and P (B2 ) = 6 = 0.17.
2
2. Denote the outcome that the person has a white ball by w and a red ball by r. Then we need to
calculate P ({w, r}|B1 ), where the curly brackets }} indicate that the order is not important. There
are two possibilities. Either the person takes the white ball or the red ball first.
The probability of taking the white ball is
5 1
P (w|B1 ) = = (19)
25 5
20 5
But now there are only 24 balls in the bag and P (r|w, B1 ) = 24 = 6 Hence
1 5 1
P (w, r|B1 ) = P (w|B1 ) × P (r|w, B1 ) = × = (20)
5 6 6
Similarly, if a red ball is chosen first
4 5 1
P (r, w|B1 ) = P (r|B1 ) × P (w|r, B1 ) = × = (21)
5 24 6
1
Hence P ({r, w}|B1 ) = 3 = 0.33.
3. Similarly for B2
15 4 60
P (w, r|B2 ) = P (w|B2 ) × P (r|w, B2 ) = × = (22)
23 11 253
8 15 60
P (r, w|B2 ) = P (r|B2 ) × P (w|r, B2 ) = × = (23)
23 22 253
120
Hence P ({r, w}|B2 ) = 253 = 0.47.
4. Use the normal rule to calculate the probability:
7. Hence the bag that the balls were chosen from is most probable 1.
3
Question 4
Solution 4
Question 5
A subject looks at an image consisting of two simple objects, O1 and O2 , while an eye-tracker returns the
(x, y) coordinates of the focus of his gaze. When the subject looks at O1 , the x coordinate of the focus of
gaze is characterised by a Gaussian probability density function g1 with mean -5 and variance 5, while a
Gaussian probability density functiom g2 with mean 5 and variance 7 is used for object O2 . The probabilities
that the subject looks at objects O1 and O2 are P (O1 ) = 0.6 and P (O2 ) = 0.4.
4
1. Calculate the posterior probability P (O1 |x = 1)
2. Is it more probable that the subject was looking at object O1 or O2 ?
Solution 5
The prior probabilities are given as P (O1 ) = 0.6 and P (O2 ) = 0.4. Calculate the conditional probability
densities:
1 −(1−(−5))2
p(1|O1 ) = √
e 10 (44)
2π5
1
= √ e−3.6 (45)
10π
= 0.0049 (46)
1 −(1−5))2
p(1|O2 ) = √ e 14 (47)
2π7
1 16
= √ e− 14 (48)
14π
= 0.048 (49)
Hence
Hence
p(1|O1 )P (O1 )
P (O1 |1) = (53)
P (1)
0.6 × 0.0049
= (54)
0.022
= 0.132 (55)
Hence, since P (O1 |1) + P (O2 |1) = 1, P (O2 |1) = 0.868 and the subject is most probably looking at object
O2 .