MATH 11300 Probability AUTUMN 2010: Problem Sheet 6 - Solutions
MATH 11300 Probability AUTUMN 2010: Problem Sheet 6 - Solutions
x 1 2 3 4
pX (x) 14 41 41 14
y 0 1
6−x x
pY | X (y | x) 6 6
pX,Y (x,y)
(c) pX,Y (x, y) = pX | Y (x | y)pY (y), so pX | Y (x | y) = pY (y)
.
x 1 2 3 4
1 2 3 4
pX | Y (x | 1) 10 10 10 10
*2. (a) Using equally likely outcomes, or using the multiplication lemma,
(b) The marginal distribution pX (x) is given by the final column of the table.
pX,Y (x,0) 2256
(c) pX | Y (x | 0) = pY (0)
. Note that by symmetry pY (0) = pX (0) = 52×51
.
x 0 1 2
1892 352 12
pX | Y (x | 0) 2256 2256 2256
(d) X and Y are not independent, since it is not the case that pX,Y (x, y) = pX (x)pY (y)
for all x and y. For example
2
12
pX,Y (2, 2) = 0 6= pX (2)pY (2) = .
2652
*3. Let X be the number of attempts of the husband, and Y the number of attempts of the
wife.
Both X and Y take values in the range 1,2,3,. . . .
Since they are independent,
Therefore
∞
X ∞
X
P(B) = P(Bx ) = (1 − p1 )x p2 (1 − p2 )x−1
x=1 x=1
∞
X (1 − p1 )p2
= (1 − p1 )p2 [(1 − p1 )(1 − p2 )]m = .
m=0
1 − (1 − p1 )(1 − p2 )
*4. (a) An elementary outcome is ω = (r, g) with r, g = 1, 2, . . . , 6. There are 36 equally likely
sample points.
X takes values in 2,3,. . . ,12. Y takes values in 1, 2, . . . , 6.
By counting sample points we find the following joint pmf:
(b) The marginal pmfs of X and Y are given by the final row and column respectively.
1
(c) E(X) = 36 (2×1+3×2+4×3+5×4+6×5+7×6+8×5+9×4+10×3+11×2+12×1) = 7.
E(Y ) = 36 (1 × 1 + 2 × 3 + 3 × 5 + 4 × 7 + 5 × 9 + 6 × 11) = 161
1
36
.
(d) omega <- sample(1:6,2,replace=TRUE) samples a random sample point.
X <- function(omega) sum(omega) and Y <- function(omega) max(omega) cre-
ate the functions that correspond to the random variables X and Y defined above.
omegas <- matrix(sample(1:6,2*n.trials,replace=T),n.trials,2), as in pre-
vious sheets, rolls the dice 2*n.trials times and stores the values in a matrix with
n.trials rows and 2 columns.
X.vals <- apply(omegas,1,X) and Y.vals <- apply(omegas,1,Y) evaluate the
random variables at each sample point. Note that the nth X.val is jointly distributed
with the nth Y.val since they are both calculated from the same row of the omegas
matrix (i.e. they are both functions of the same sample point).
tabulate(X.vals)/n.trials and tabulate(Y.vals)/n.trials is an alternative to
looking at a histogram to see the marginal pmfs.
mean(X.vals) and mean(Y.vals) give the marginal sample means, which should be
close to E(X) and E(Y ) evaluated above.
5. Let X be the number of heads in the first 10 flips, and Y the total number of heads. X
takes values in 0, 1, . . . , 10. We want to know
Firstly, notice that Y is the number of headsin 20 flips, so Y ∼ Bin(20, 21 ). Hence pY (y) =
20 1 y
(1 − 12 )20−y and therefore pY (12) = 20 1
y 2 12 220
.
We now find the values of pX,Y (x, 12) for x = 0, 1, . . . , 10.
Remember that pX,Y(x, y) = P(X = x, Y = y) = P(X = x)P(Y = y | X = x), and note
that P(X = x) = 10 1
x 210
since X ∼ Bin(10, 12 ).
Also note that you can represent Y as X + Z where Z ∼ Bin(10, 21 ) is the number of heads
in the last 10 flips, and so is independent of X. Therefore
10 1
y−x 210
y = x, x + 1, . . . , x + 10
pY | X (y | x) = P(Z = y − x | X = x) = pZ (y − x) =
0 o.w.
10 1 10 1
x 210 12−x 210
2 ≤ x ≤ 10
Hence pX,Y (x, 12) = pX (x)pY | X (12 | x) =
0 o.w.
[NB X ∼ Poi( 10
2
) — this is not an accident!]
Hence y 1 y
× e−10 10y!
y−x
x 2y −5 5
pY | X (y | x) = x = e
e−5 5x! (y − x)!
and
P(Y ≤ 13 | X = 10) = pY | X (10 | 10) + pY | X (11 | 10) + pY | X (12 | 10) + pY | X (13 | 10)
−5 25 125
= e 1+5+ +
2 3!
= 0.265.