0% found this document useful (0 votes)
19 views12 pages

W5PS

Uploaded by

chetnasuthar987
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
19 views12 pages

W5PS

Uploaded by

chetnasuthar987
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 12

Statistics for Data Science - 2

Week 5 Practice Assignment Solution

1. Let X ∼ Bernoulli(0.6). Let (Y | X = 0) ∼ Exp(1) and (Y | X = 1) ∼ Exp(3). Find


the marginal of Y.

a) 0.6e−y + 0.4e−3y
b) 0.4e−y + 0.6e−3y
c) 0.6e−y + 1.2e−3y
d) 0.4e−y + 1.8e−3y

Solution:
Given that, X ∼ Bernoulli(0.6), therefore pX (1) = 0.6 and pX (0) = 0.4.
The marginal density of Y is given by
X
fY (y) = pX (x)fY |X=x (y)
x∈TX

= pX (1)fY |X=1 (y) + pX (0)fY |X=0 (y)


= 0.6 × 3e−3y + 0.4e−y
= 1.8e−3y + 0.4e−y

2. Let X ∼ Uniform{1, 2, 3}. Let (Y | X = 1) ∼ Exp(1), (Y | X = 2) ∼ Exp(2) and


(Y | X = 3) ∼ Normal(0, 4). What is the marginal of Y ?
1 2
a) e−y + 2e−2y + √ e−y /8
2 2π
1 −y 1 2
b) [e + 2e−2y + √ e−y /8 ]
3 2 2π
1 1 2
c) [e−y + e−2y + √ e−y /4 ]
3 2π
1 2
d) e−y + e−2y + √ e−y /4
2 2π
Solution:
Given that, X ∼ Uniform{1, 2, 3}, therefore pX (1) = pX (2) = pX (3) = 13 .

1
The marginal density of Y is given by
X
fY (y) = pX (x)fY |X=x (y)
x∈TX

= pX (1)fY |X=1 (y) + pX (2)fY |X=2 (y) + pX (3)fY |X=3 (y)


2
1 1 1 e−y /8
= × e−y + × 2e−2y + × √
3 3 3 2 2π
1 1 2
= [e−y + 2e−2y + √ e−y /8 ]
3 2 2π

3. Let X ∼ Uniform{1, 2}. Let (Y | X = 1) ∼ Exp(2) and (Y | X = 2) ∼ Exp(4). Find


the value of fX|Y =3 (2).

2e−12
a)
e−6 + 2e−12
e−6
b) −6
e + 2e−12
e−12
c) −6
e + e−12
e−6
d) −6
e + e−12
Solution:
Given that, X ∼ Uniform{1, 2}, therefore pX (1) = pX (2) = 21 .
The marginal density of Y is given by
X
fY (y) = pX (x)fY |X=x (y)
x∈TX

= pX (1)fY |X=1 (y) + pX (2)fY |X=2 (y)


1 1
= × 2e−2y + × 4e−4y
2 2
= e−2y + 2e−4y

And
pX (2)fY |X=2 (3)
fX|Y =3 (2) =
fY (3)
1
2
× 4e−4×3
= −2×3
e + 2e−4×3
2e−12
= −6
e + 2e−12

2
4. The joint density function of two continuous random variables X and Y is given as
(
kxy 0 < x < 4, 0 < y < 1
fXY (x, y) =
0 otherwise

Find the value of k. Enter your answer correct to two decimals accuracy.
Solution: R∞ R∞
We know that for joint PDF, −∞ −∞ fXY (x, y)dxdy = 1
Since fXY (x, y) is nonzero in the region 0 < x < 4, 0 < y < 1.
Z 1Z 4
⇒ fXY (x, y)dxdy = 1
0 0
Z 1Z 4
⇒ kxy dxdy = 1
0 0
Z 1
y2 4
⇒ kx dx = 1
0 2 0
Z 1
⇒ 8kxdx = 1
0
x2 1
⇒ 8k =1
2 0
1
⇒k= = 0.25
4

5. Let (X, Y ) ∼ Uniform(D), where D = {(x, y) : x + y < 4, x > 0, y > 0}. Find the value
of P (2X + Y > 2).
1
a) 8
7
b) 8
3
c) 4
1
d) 4

Solution:

(X, Y ) ∼ Uniform(D), therefore


(
1
8
(x, y) ∈ D
fXY (x, y) =
0 otherwise

3
1
Area of the lower shaded region (A) will be 2
×1×2=1

P (2X + Y > 2) = 1 − P (2X + Y ≤ 2)


|A|
=1−
|D|
1
=1−
8
7
=
8

6. The joint density function of the random variables X and Y is given by


(
x + y 0 < x < 1, 0 < y < 1
fXY (x, y) =
0 otherwise

Find the value of P (X + Y < 1).


1
a) 3
2
b) 3
1
c) 6
3
d) 4

Solution:

4
Z 1 Z 1−y
P (X + Y < 1) = (x + y)dxdy
0 0
Z 1 2 
x 1−y
= + xy dy
0 2 0
Z 1
(1 − y)2

= + (1 − y)y dy
0 2
1
(1 − y)3 y 2 y 3

= − + −
6 2 3
0
   
1 1 1
= − − −
2 3 6
1
=
3
7. The joint PDF of two continuous random variables X and Y is given by
(
2
(5x + 2y) 0 ≤ x ≤ 1, 0 ≤ y ≤ 1
fXY (x, y) = 7
0 otherwise
Find the marginal PDF of X.
a) (
2x 0 ≤ x ≤ 1
fX (x) =
0 otherwise
b) (
2
7
(5x + 1) 0 ≤ x ≤ 1
fX (x) =
0 otherwise
c) (
2
7
(3x + 2) 0 ≤ x ≤ 1
fX (x) =
0 otherwise

5
d) (
2
7
(5y + 1) 0 ≤ x ≤ 1
fX (x) =
0 otherwise

Solution:
For 0 ≤ x ≤ 1
Z 1
2
fX (x) = (5x + 2y)dy
0 7
1
2y 2

2
= 5xy +
7 2
0
2
= (5x + 1)
7

8. Let X and Y be jointly continuous random variables with joint PDF


(
k(2 − y) 0 < x < 4, 0 < y < 1
fXY (x, y) =
0 otherwise

Find the marginal PDF of Y.

a) (
3
2
y(2 − y) 0 < y < 1
fY (y) =
0 otherwise

b) (
2y 0<y<1
fY (y) =
0 otherwise

c) (
3
2
(1 − y2) 0 < y < 1
fY (y) =
0 otherwise

d) (
2
3
(2 − y) 0 < y < 1
fY (y) =
0 otherwise

Solution: R∞ R∞
We know that for joint PDF, −∞ −∞ fXY (x, y)dxdy = 1

6
Since fXY (x, y) is nonzero in the region 0 < x < 4, 0 < y < 1.
Z 1Z 4
⇒ fXY (x, y)dxdy = 1
0 0
Z 1Z 4
⇒ k(2 − y)dxdy = 1
0 0
Z 1 4
⇒ k(2 − y)x dy = 1
0 0
Z 1
⇒ 4k(2 − y)dy = 1
0
1
y2
 
⇒ 4k 2y − =1
2
0
3
⇒ 4k × = 1
2
1
⇒k=
6
For 0 < y < 1
Z 4
1
fY (y) = (2 − y)dx
0 6
1 4
= (2 − y)x
6 0
2
= (2 − y)
3

9. Let X and Y be two independent continuous random variables with PDFs fX (x) and
fY (y) given as
(
1 0≤x<1
fX (x) =
0 otherwise
(
y/2 0 ≤ y < 2
fY (y) =
0 otherwise
Find the value of P (2X + Y > 1).
1
a) 24
11
b) 12
1
c) 12
23
d) 24

7
Solution:
Given that X and Y be two independent continuous random variables,
therefore fXY (x, y) = fX (x)fY (y).
(
y/2 0 ≤ x < 1, 0 ≤ y < 2
fXY (x, y) =
0 otherwise
We have to find the value of P (2X + Y > 1).
And
P (2X + Y > 1) = 1 − P (2X + Y ≤ 1)
1−y
Z 1 Z
2 y
P (2X + Y ≤ 1) = dxdy
2
Z0 1 0
1−y
y 2
= x dy
0 2 0
Z 1
1
= y(1 − y)dy
0 4
1
1 y2 y3

= −
4 2 3
0
1
=
24
1 23
⇒ P (2X + Y > 1) = 1 − 24
= 24

10. The joint density function of two random variables X and Y is given by
(
8xy 0 ≤ x ≤ 1, 0 ≤ y ≤ x
fXY (x, y) =
0 otherwise

Are X and Y independent?

8
a) Yes
b) No

Solution:

Z x
fX (x) = 8xy dy
0
x
y2
= 8x
2
0
3
= 4x

Z 1
fY (y) = 8xy dx
0
1
x2
= 8y
2
0
= 4y

fX (x)fY (y) = 4x3 × 4y = 16x3 y 6= fXY (x, y).


Hence X and Y are not independent.

11. Let (X, Y ) ∼ Uniform(D), where D = [3, 5] × [2, 4]. Are X and Y independent?

a) Yes
b) No

Solution:
(X, Y ) ∼ Uniform(D), therefore

9
(
1
4
3 ≤ x ≤ 5, 2 ≤ y ≤ 4
fXY (x, y) =
0 otherwise

Z 4
1
fX (x) = dy
2 4
4
1
= y
4
2
1
=
2

Z 5
1
fY (y) = dx
3 4
5
1
= x
4
3
1
=
2
fX (x)fY (y) = 21 × 12 = 41 = fXY (x, y).
Hence X and Y are independent.

12. The joint PDF of two random variables X and Y is given by


(
4xy 0 < x < 1, 0 < y < 1
fXY (x, y) =
0 otherwise

Find the distribution of X | Y = 0.5. (fX|Y =0.5 (x))

a) (
2x 0 < x < 1
fX|Y =0.5 (x) =
0 otherwise

b) (
3x2 0<x<1
fX|Y =0.5 (x) =
0 otherwise

c) (
4x3 0<x<1
fX|Y =0.5 (x) =
0 otherwise

10
d) (
1 0<x<1
fX|Y =0.5 (x) =
0 otherwise
Solution:
For 0 < y < 1
Z 1
fY (y) = 4xy dx
0
1
x2
= 4y
2
0
= 2y
The distribution of X | Y = 0.5, (0 < x < 1) is given by

fXY (x, 0.5)


fX|Y =0.5 (x) =
fY (0.5)
4x × 0.5
=
2 × 0.5
= 2x

13. The joint PDF of two random variables X and Y is given by


(
x2 + xy
3
0 ≤ x ≤ 1, 0 ≤ y ≤ 2
fXY (x, y) =
0 otherwise

Find the value of P ( 14 < X < 1


2
| Y = 1).
83
a) 96
13
b) 96
13
c) 48
35
d) 48

Solution:
For 0 < y < 1
Z 1 xy 
fY (y) = x2 +
dx
0 3
 3 1
x x2 y
= +
3 6
0
1 1
= + y
3 6

11
fXY (x, 1)
fX|Y =1 (x) =
fY (1)
x + x×1
2
= 1 1 3
3
+ ×1
 6 x
= 2 x2 +
3

  Z 1/2 
1 1 x
P <X< |Y =1 = 2 x2 + dx
4 2 1/4 3
 3  1/2
x x2
=2 +
3 6
1/4
   
1 1 1 1
=2 + − +
24 24 192 96
 
1 1
=2 −
12 64
13
=
96

12

You might also like