You are on page 1of 5

Carthage University

INSAT
Department of Mathematics & Computer Sciences

Worksheet solution: Two discrete random variables.

Exercise 1: Let (X, Y ) be a random pair and below is its joint probability distribution

X⧹Y -1 0 1
1 1/8 1/4 1/8
2 1/4 1/8 1/8

1. Check whether the above table is a joint mass distribution function.


We just need to sum up all entries of PXY -only probabilities- and check that it worths 1.
n o
2. Compute P{X + Y ≤ 1}. First let us determine the set X + Y ≤ 1 , for this we can use
the next table of sums

X +Y −1 0 1
1 0 1 2
2 1 2 3
ans so
n o n o
X + Y ≤ 1 = (X, Y ) = (1, −1), (X, Y ) = (1, 0), (X, Y ) = (2, −1) ,

then
n o n o
P X +Y ≤1 = P (X, Y ) = (1, −1), (X, Y ) = (1, 0), (X, Y ) = (2, −1)
n o n o n o
= P (X, Y ) = (1, −1) + P , (X, Y ) = (1, 0) + P (X, Y ) = (2, −1)
= 1/8 + 1/4 + 1/4.

3. Determine the mass distribution function of Z = X + Y . You just need to ll up the next
table
Z =X +Y PZ n o n o
0 P{Z = 0} = P X + Y = 0 = P (X, Y ) = (1, −1) = 1/8
n o n o
1 P{Z = 1} = P X + Y = 1 = P (X, Y ) = (1, 0) or (X, Y ) = (2, −1) = 1/4 + 1/4
2 ···
3 ···

Random pair - Exercises'sheet 1 anis.rezguii@gmail.com


4. Determine the marginal mass distribution functions PX and PY .
X⧹Y −1 0 1 PX
1 1/8 1/4 1/8 1/2
2 1/4 1/8 1/8 1/2
PY 3/8 3/8 1/4

5. Determine the random variables E(Y |X) and V(Y |X).


We need rst to determine all conditional distributions of Y :
Y PY |X=1 Y PY |X=2
−1 1/4 −1 1/2
and
0 1/2 0 1/4
1 1/4 1 1/4

then we compute the conditional expectations, for instance E(Y |X = 1) = −1 × 1/4 + 0 ×


1/2 + 1 × 1/4 = 0, we obtain

E(Y |X) = φ(X) PX x φ(x)


E(Y |X = 1) 0 1/2 and 1 0
E(Y |X = 2) −1/4 1/2 2 −1/4
We do the same for the variance, for instance
V(Y |X = 1) = E(Y 2 |X = 1) − E(Y |X = 1)2 = 1/2 − 02 = 1/2, we obtain

V(Y |X) = ψ(X) PX x ψ(x)


V(Y |X = 1) 1/2 1/2 and 1 1/2
V(Y |X = 2) 2/3 1/2 2 2/3

6. Compute the correlation coecient ρXY and comment.


Recall that the linear correlation coecient expresses as follows
E(XY ) − E(X)E(Y )
ρXY = ,
σX σY
where σX and σY denote the standard deviation of X and Y respectively. The following
values' table is useful
X ×Y −1 0 1
1 −1 0 1
2 −2 0 2
and so
n o n o
E(XY ) = − 2 × PXY (2, −1) + (−1) × PXY (1, −1)
n o n o n o
+ 0 × [PXY (1, 0) + PXY (2, 0)] + 1 × PXY (1, 1) + 2 × PXY (2, 1)
= −1/4.

Finally we get ρXY = −0, 1601 and ρ2XY = 0, 0256. We note that ρ2XY ≪ 1 which means
that there is actually no linear correlation between X and Y or, in dierent terms,
X couldn't explain Y linearly.

Random pair - Exercises'sheet 2 anis.rezguii@gmail.com


7. Compute the determination coecient RY2 |X and comment.
Recall that the determination coecient expresses as follows

2 V(E(Y |X)) 1/2 ∗ 0, 0625 − 0, 0156


RXY = = = 0, 02564 = ρ2XY .
V (Y ) 0, 6094
This means actually that the best possible relation between X and Y is linear ! Note
that this doesn't contradict the comment in question 6 -as it seems- more precisely it says
that, although the best possible correlation is linear it is far a way to be sucient and/or
signicant.

Note:
Since we now know that E(Y |X) = φ(X) is linear we can use the values table of φ above, to
determine its expression. If we denote φ(x) = βx + α, we get
 
φ(1) = β + α = 0 β = −1/4
=⇒ .
φ(2) = 2β + α = −1/4 α = 1/4

And then we have the following


1−X
E(Y |X) = φ(X) = .
4
Exercise 2:
Exercise 2 is very similar to Exercise 1, we just need to recover the joint distribution from the
conditional ones, by using
n o n o n o
P X = xi and Y = yj = P X = xi × P Y = yj |X = xi .

Exercise 3:
First of all we should note that X and Y are correlated by construction since
X + Y ≤ 4.

1. Determine the joint mass distribution function of the random pair (X, Y ): for m + n ≤ 4
P{X = m, Y = n} = C4m C4−m
n
(90%)m (8%)n (2%)4−(m+n)
4! (4 − m)!
= (90%)m (8%)n (2%)4−(m+n)
m!(4 − m)! n!(4 − (m + n))!
4!
= (90%)m (8%)n (2%)4−(m+n)
m!n!(4 − (m + n))!
Finally we obtain the joint probability distribution
Y /X 0 1 2 3 4
0 0.0000 0.0000 0.0000 0.0000 0.0000
1 0.0000 0.0000 0.0000 0.0000 0.0000
2 0.0000 0.0001 0.0000 0.0000 0.0000
3 0.0000 0.0012 0.0097 0.0000 0.0000
4 0.0001 0.0023 0.0389 0.2916 0.0000

Random pair - Exercises'sheet 3 anis.rezguii@gmail.com


2. Determine the two marginal mass distribution functions of X and Y :
4−m
X
P{X = m} = P{X = m, Y = n}
n=0
4−m
X 4!
= (90%)m (8%)n (2%)4−(m+n)
m!n!(4 − (m + n))!
n=0
4−m
4! X 1
= (90%)m (8%)n (2%)4−(m+n)
m! n!(4 − (m + n))!
n=0
4−m
4! m
X (4 − m)!
= (90%) (8%)n (2%)(4−m)−n
m!(4 − m)! n!((4 − m) − n)!
n=0
4−m
X
= C4m (90%)m n
C4−m (8%)n (2%)(4−m)−n
n=0
m m
= C4 (90%) (8% + 2%)4−m = C4m (90%)m (10%)4−m ,

and so X ∼ B(4; 90%). The same computation leads to Y ∼ B(4; 8%).


3. Determine the random
 variables E(Y|X) and V(Y |X):
8%
Since PY |X=n ∼ B 4 − n, = B (4 − n, 80%) 1 , then
8% + 2%

E(Y |X = n) = 80%(4 − n) = φ(n) and V(Y |X = n) = 80%20%(4 − n) = ψ(n)

E(Y |X) = 80%(4 − X) and V(Y |X) = 80%20%(4 − X).

4. Compute the determination coecient of X and Y , RY2 |X . Comment.


V E(Y |X)
RY2 |X =
V(Y )

V 80%(4 − X)
=
8%92%4
(80%)2 V(X) (80%)2 90%10%4 (80%)2 90%10%
= = =
8%92%4 8%92%4 8%92%
≃ 0, 0736 = 7.36% ≪ 1.

This means that although, the dependence is linear between X and Y , but it is very weak
and/or insignicant.
5. Compute the correlation coecient of X and Y , ρXY . Comment.
Actually we don't need to compute the correlation coecient, since
√ E(Y |X) is linear in
X , which means that ρ2XY = RY2 |X = 0.782%, and then ρXY = − 0.782% = −8.84%.
1 If you want more details about the proof you can ask your colleague!

Random pair - Exercises'sheet 4 anis.rezguii@gmail.com


Exercise 4:
Suppose that you come to a bus station at the time zero and that a bus arrives every minute with
a probability p. An arrival bus corresponds to your destination with a probability q . Denote by
T the number of waiting minutes and by N the number of buses that came during your waiting
time.
1. Determine the mass distribution function of T .
T follows a geometric distribution since it, somehow, counts the position of the rst "suc-
cess" i.e the bus that corresponds to your destination. The probability of success is,
actually, the probability that a bus arrives and that corresponds i.e p × q , then for k ≥ 1

P{T = k} = (1 − pq)k−1 pq.

2. Deduce the joint mass distribution function of the couple (T, N ).


We need rst to determine all conditional distributions PN |T =k , since it counts how many
arrivals during k minutes and that all arrivals are independent, all conditional distributions
are binomial
(N |T = k) ∼ B(k; p).
We deduce that for 0 ≤ n ≤ k,

P{T = k; N = n} = (1 − pq)k−1 pq × Ckn pn (1 − p)k−n .

3. Deduce the marginal probability distribution of N .


X
P{N = n} = (1 − pq)k−1 pq × Ckn pn (1 − p)k−n
k≥n
pn X
= n
pq (1 − pq)k−1 Ckn (1 − p)k .
(1 − p)
k≥n

Actually, there exists a closed form for P{N = n} which is out of the scope of this course.
4. Determine the random variable E(N |T ).
Since (N |T = k) ∼ B(k; p) its expectations expresses E(N |T = k) = kp and so E(N |T ) =
pT .

Random pair - Exercises'sheet 5 anis.rezguii@gmail.com

You might also like