You are on page 1of 11

Statistics for Data Science - 2

Week 2 Practice Assignment


Multiple random variables

1. Consider an experiment of tossing a fair coin twice. Let X be the number of heads that
occurs in the two tosses and Y be the number of tails that occurs in the two tosses.
Based on the given information, choose the correct statements.

(a) X and Y are independent random variables.


(b) X and Y are dependent random variables.
1
(c) fXY (1, 1) = .
2
1
(d) fY |X=0 (1) = .
4
Solution:
X denotes the number of heads that occurs in the two tosses and Y denotes the number
of tails that occurs in the two tosses.
First we will make the table of the joint pmf of X and Y .

X
0 1 2
Y
1
0 0 0 4

1
1 0 2
0

1
2 4
0 0

Joint pmf of X and Y .

From the table, we have


1 1
fX (0) = 0 + 0 + =
4 4
1 1
fY (0) = 0 + 0 + =
4 4
and
fXY (0, 0) = 0

It is clear that
fXY (0, 0) 6= fX (0).fY (0)
It implies that X and Y are dependent random variables.
So, option (a) is incorrect and option (b) is correct.

Now, from table


1
fXY (1, 1) =
2
So, option (c) is correct.

fXY (0, 1)
fY |X=0 (1) = = 0 (Since, fXY (0, 1) = 0)
fX (0)
So, option (d) is incorrect.

2. Two fair dice are thrown simultaneously. Let X be the outcome on the first die and Y
be the sum of the outcomes on both the dice. Find the value of P (Y − X ≥ 6).
1
(a)
6
1
(b)
12
5
(c)
12
1
(d)
24
Solution:
X denotes the outcome on the first die and Y denotes the sum of the outcomes on both
the dice.
Notice that Y − X will denote the outcome on the second die.
Let Z = Y − X, then Z ∼ Uniform({1, 2, 3, 4, 5, 6})

P (Y − X ≥ 6) = P (Z ≥ 6)
P (Y − X ≥ 6) = P (Z = 6)
1
P (Y − X ≥ 6) =
6

3. Let X and Y denote the number of cars and number of bikes reaching a street corner
during a certain 15-minute time period, respectively. Joint distribution of X and Y is
given as
9
fXY (x, y) =
16(4x+y )
Choose the correct option(s).
3
(a) Marginal pmf of X is fX (x) = .
4x+1

Page 2
3
(b) Marginal pmf of X is fX (x) = .
4x
(c) X and Y are independent random variables.
(d) X and Y are dependent random variables.

Solution:
X and Y denote the number of cars and number of bikes reaching a street corner during
a certain 15-minute time period, respectively.
Range of X and Y will be TX , TY = {0, 1, 2, ..., ∞}

Joint distribution of X and Y is given as


9
fXY (x, y) =
16(4x+y )

Now,

X
fX (x) = fXY (x, y)
y=0

X 9
=
y=0
16(4x+y )

9 X 1
=
16.4x y=0 4y
 
9 1 1
= 1 + + 2 + ...
16.4x 4 4
 
9 1
=
16.4x 1 − 14
 
9 4
=
42 .4x 3
3
= x+1
4

Therefore, option (a) is correct and option (b) is incorrect.

Similarly, we can show that


3
fY (y) = y+1
4

Now, Choose two arbitrary points x and y in the range of X and Y , respectively, then

Page 3
3 3
fX (x).fY (y) = .
4x+1 4y+1
9
⇒ fX (x).fY (y) =
16(4x+y )
⇒ fX (x).fY (y) = fXY (x, y)

Hence, X and Y are independent random variables.


Therefore, option (c) is correct and option (d) is incorrect.

4. Let X1 , X2 , X3 and X4 be four independent and identically distributed Poisson random


variables with λi = 4 for all i. Find the probability that exactly one of the Xi equals 0
and exactly one of the Xi equals 1?

(a) 24e−8 (1 − 25e−8 )


(b) 24e−8 (1 − 5e−4 )2
(c) 48e−8 (1 − e−8 )
(d) 48e−8 (1 − 5e−4 )2

Solution:
First we will find the probability such that X1 = 0, X2 = 1 and other two random
variables do not take value 0 and 1.

Since all four random variable are independent, we have

P (X1 = 0, X2 = 1, X3 6= {0, 1}), X4 6= {0, 1}) =


P (X1 = 0).P (X2 = 1).P (X3 6= {0, 1})P (X4 6= {0, 1})....(1)

Now,
e−4 40
P (X1 = 0) = = e−4
0!
e−4 41
P (X2 = 1) = = 4e−4
1!

P (X3 6= {0, 1}) = 1 − P (X3 = {0, 1})


= 1 − [P (X3 = 0) + P (X3 = 1)]
= 1 − [e−4 + 4e−4 ] = 1 − 5e−4

P (X4 6= {0, 1}) = 1 − P (X4 = {0, 1})


. = 1 − [P (X4 = 0) + P (X4 = 1)]

Page 4
. = 1 − [e−4 + 4e−4 ] = 1 − 5e−4

Putting all these values in equation (1), we get

P (X1 = 0, X2 = 1, X3 6= {0, 1}), X4 6= {0, 1}) = e−4 (4e−4 )(1 − 5e−4 )2

We can choose such pairs of Xi for which exactly one Xi equals 0 and exactly one Xi
equals 1 in 4P2 ways.
Therefore,
probability that exactly one of the Xi equals 0 and exactly one of the Xi equals 1 is
given by
4
P2 e−4 (4e−4 )(1 − 5e−4 )2
= 48e−8 (1 − 5e−4 )2

5. A person tosses a fair coin until it shows a head and rolls a fair die until it shows the
number six. Assume that tossing the coin is independent of rolling the die. What is the
probability that number of tosses to get first head is equal to number of rolls to get the
first six? Write your answer correct to two decimal places.
Solution
Let X denote the number of tosses of the coin to get the first head and let Y denote the
number of rolls of the die to get the first six.
1 1
Clearly, X ∼ Geometric( ) and Y ∼ Geometric( ).
2 6

Number of tosses to get first head will be equal to number of rolls to get the first six if

Page 5
(X = 1, Y = 1) or (X = 2, Y = 2) or (X = 3, Y = 3) or so on. Therefore,

P (X = Y ) = P (X = 1, Y = 1) + P (X = 2, Y = 2) + P (X = 3, Y = 3) + . . .
X∞
= P (X = i, Y = i)
i=1

X
= P (X = i)P (Y = i)
i=1
∞  i  i−1
X 1 5 1
=
i=1
2 6 6
∞  i−1  i−1
1 X 1 5
=
12 i=1 2 6
∞   i−1
1 X 5
=
12 i=1 12
"  2 #
1 5 5
= 1+ + + ...
12 12 12
 
1 1
=
12 1 − 5/12
1
=
7

6. Let X and Y be i.i.d. Geometric(p), where p ∈ [0, 1] is a constant. Find the value of
P (X = 6|X + Y = 10). Write your answer correct to two decimal places.
Solution:
Given that X and Y are i.i.d. Geometric(p).
To find: P (X = 6|X + Y = 10).

P (X = 6, X + Y = 10)
P (X = 6|X + Y = 10) =
P (X + Y = 10)
P (X = 6, Y = 4)
=
P (X + Y = 10)
P (X = 6)P (Y = 4)
= ...(1)
P (X + Y = 10)

Page 6
Now,
9
X
P (X + Y = 10) = P (X = i, Y = 10 − i)
i=1
X9
= P (X = i)P (Y = 10 − i)
i=1
9
X
= (1 − p)i−1 p.(1 − p)9−i p
i=1
9
X
= p2 (1 − p)8
i=1
= 9p2 (1 − p)8 ...(2)

From equation (1) and (2), we have


(1 − p)5 p.(1 − p)3 p
P (X = 6|X + Y = 10) =
9p2 (1 − p)8
(1 − p)8 p2
= 2
9p (1 − p)8
1
=
9

7. Two dice are rolled simultaneously. Let X denote the greatest outcome (if both the
outcomes are same, then X will be that outcome) and Y denote the lowest outcome (if
both the outcomes are same, then Y will be that outcome). Choose the correct options.
(a) X is uniformly distributed.
(b) Y is uniformly distributed.
(c) X and Y are independent random variables.
(d) X and Y are not independent.
(e) Joint distribution of X and Y is Uniform{1, 2, 3, 4, 5, 6}.
Solution:
Given that X denotes the greater outcome and Y denotes the lower outcome.
Clearly, TX = TY = {1, 2, . . . , 6}.

First, we will find the joint distribution of X and Y .


Note that if x < y, fXY (x, y) = 0.

Page 7
If x > y, fXY (x, y) = P (any one of the two outcomes is x and another one is y)
1 1
=2× =
36 18
If x = y, fXY (x, y) = P (both the outcomes are same (x = y) )
1
=
36

X
1 2 3 4 5 6
Y
1 1 1 1 1 1
1
36 18 18 18 18 18
1 1 1 1 1
2 0
36 18 18 18 18
1 1 1 1
3 0 0
36 18 18 18
1 1 1
4 0 0 0
36 18 18
1 1
5 0 0 0 0
36 18
1
6 0 0 0 0 0
36

Joint distribution of X and Y .

Option (a):
1 3
From the table, we know that fX (1) = , fX (2) = and so on.
36 36
It implies that X is not uniformly distributed.
Hence, option (a) is incorrect.

Option (a):
11 9
From the table, we know that fY (1) = , fY (2) = and so on.
36 36
It implies that Y is not uniformly distributed.
Hence, option (b) is incorrect.

Option (c) and (d):


From the table, we know that fXY (1, 2) = 0
1 9
fX (1) = and fY (2) = .
36 36

Therefore fXY (1, 2) 6= fX (1).fY (2).


It implies that X and Y are not independent. Hence, option (c) is incorrect and option

Page 8
(d) is correct.

Option(e):
It is clear from the table that joint distribution of X and Y is not uniformly distributed.

8. Let X and Y be i.i.d. Uniform{−1, 0, 1}. Find the value of P (X = 0 | |X + Y | = 1).


Solution:
Given that X and Y are i.i.d. Uniform{−1, 0, 1}
To find: P (X = 0 | |X + Y | = 1).
Let Z = |X + Y |

P (X = 0, |X + Y | = 1)
P (X = 0 | Z = 1) =
P (|X + Y | = 1)
P (X = 0, |Y | = 1)
=
P (|X + Y | = 1)
P (X = 0, Y = ±1)
=
P (|X + Y | = 1)
P (X = 0, Y = 1) + P (X = 0, Y = −1)
=
P (X = 0, Y = 1) + P (X = 0, Y = −1) + P (X = 1, Y = 0) + P (X = −1, Y = 0)
1
9
+ 19
= 1
9
+ 19 + 19 + 19
1
=
2

9. The joint distribution of X and Y is given by


1
fXY (x, y) = ,
2x+y
where TX and TY are both {1, 2, 3, . . .}. Find the probability mass function of max{X, Y }.
1 2k − 1
(a) fmax{X,Y } (k) = +
4k 2k−1
1 2k − 1
(b) fmax{X,Y } (k) = k + k−1
2 2
1 2k−1 − 1
(c) fmax{X,Y } (k) = 2k +
2 2k−2
1 2k−1 − 1
(d) fmax{X,Y } (k) = 2k + 2k−2
2 2

Page 9
Solution:
The joint distribution of X and Y is given by
1
fXY (x, y) = ,
2x+y

Let Z = max{X, Y }.
Clearly, range of Z will be TZ = {1, 2, 3, . . .}.

Now, choose k ∈ TZ . Then

fZ (k) = P (max{X, Y } = k)
= P (X = k, Y = k) + P (X = k, Y < k) + P (X < k, Y = k)
k−1
X k−1
X
= fXY (k, k) + fXY (k, i) + fXY (i, k)
i=1 i=1
k−1 k−1
1 X 1 X 1
= 2k + +
2 i=1
2k+i i=1 2k+i
k−1
1 X 1
= + 2
22k i=1
2k+i
k−1
1 2 X 1
= +
2k 2k i=1 2i
 
1 1 1 1 1
= + + + . . . + k−1
2k 2k−1 2 22 2
 
1 1 1 1
= + 1 + + . . . + k−2
2k 2k 2 2
 
1 1 1 − /2 1 k−1
= 2k + k
2 2 1 − 1/2
 k−1 
1 2 2 −1
= 2k + k
2 2 2k−1
1 2k−1 − 1
= 2k + 2k−2
2 2

10. Let X ∼ Binomial(5, 1/2) and Y ∼ Binomial(4, 1/4) be two independent random vari-
ables. Find the value of P (max{X, Y } = 1). Write your answer correct to two decimal
points.

Page 10
Solution:
Given that X ∼ Binomial(5, 1/2) and Y ∼ Binomial(4, 1/4) are two independent ran-
dom variables.

To find: P (max{X, Y } = 1)

P (max{X, Y } = 1) = P (X = 1, Y = 1) + P (X < 1, Y = 1) + P (X = 1, Y < 1)


= P (X = 1).P (Y = 1) + P (X < 1).P (Y = 1) + P (X = 1).P (Y < 1)
= P (X = 1).P (Y = 1) + P (X = 0).P (Y = 1) + P (X = 1).P (Y = 0)
   4 !    3 !  5 !    3 !
5 1 1 4 1 3 5 1 4 1 3
= C1 C1 + C0 C1
2 2 4 4 2 4 4
   4 !  4 !
1 1 3
+ 5 C1 4
C0
2 2 4
20 × 33 4 × 33 5 × 34
= + +
25 × 44 25 × 44 25 × 44
33
= 5 [20 + 4 + 15]
2 × 44
27 × 39
= = 0.128
32 × 256

Page 11

You might also like