0% found this document useful (0 votes)
20 views16 pages

W5 Solution

Uploaded by

ishitatay
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)
20 views16 pages

W5 Solution

Uploaded by

ishitatay
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/ 16

Statistics for Data Science - 2

Week 6 graded Assignment


Solution

1. The joint pdf of two continuous ranodm variables X and Y is given by


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

Are X and Y independent?

1. Yes
2. No

Solution:
First we will calculate the marginal densities of X and Y .
For 0 ≤ x ≤ 1
Z 1
fX (x) = fXY (x, y)dy
0
Z 1
= 4xydy
0
1
2
= 2xy
0
= 2x

For 0 ≤ y ≤ 1
Z 1
fY (y) = fXY (x, y)dx
0
Z 1
= 4xydx
0
1

= 2x2 y
0
= 2y

Therefore,
fX (x).fY (y) = 4xy = fXY (x, y)
It implies that X and Y are independent random variables.
2. Let (X, Y ) ∼ Uniform(D), where D = {(x, y) : (x − k)2 + (y − k)2 ≤ r}. Calculate
P (X ≥ Y ).
Solution:

y=x
2

x
1 2

The region X ≥ Y will be the lower half part of the circle.

Therefore,
Area of lower half circle
P (X ≥ Y ) =
Area of the circle
π(1)2/2
=
π(1)2
1
=
2

3. Let (X, Y ) ∼ Uniform(D), where D = {(x, y) : y ≤ 2x, 0 < x < 1, 0 < y < 2} ∪ [1, 2] ×
[0, 2]. Find the marginal density of X.
(a) 
 2x + 2 0≤x≤2
fX (x) = 3 3
0 otherwise
(b) 
 2x + 1 0≤x≤2
fX (x) = 3 3
0 otherwise
(c) 
2x
3
 0≤x≤1
2
fX (x) = 3
1≤x≤2

0 otherwise

Page 2
(d) 
2x
3
 0≤x≤1
1
fX (x) = 1≤x≤2
3
0 otherwise

2 y = 2x

x
1 2

D denotes the area of the support(X, Y ).


Area of D = 12 × 1 × 2 + 1 × 2 = 3
Since (X, Y ) ∼ Uniform(D), it implies that
1
fXY (x, y) = , x, y ∈ D
3
R
We know that fX (x) = fXY (x, y)dy

For 0 < x < 1


Z 2x
1
fX (x) = dy
0 3
2x
1
= y
3
0
2x
=
3
For 1 < x < 2
Z 2
1
fX (x) = dy
0 3
2
1
= y
3
0
2
=
3

Page 3
Therefore, marginal density of X is given by

2x
3 0≤x≤1

fX (x) = 23 1 ≤ x ≤ 2

0 otherwise

4. The joint pdf of two random variables X and Y is given by


(
24xy 0 ≤ x ≤ 1, 0 ≤ y ≤ 1, x + y ≤ 1
fXY (x, y) =
0 otherwise

Choose the correct option(s).

(a) P (X + Y ≤ 41 ) = 1
2
(b) P (X + Y ≤ 12 ) = 1
16
(c) X and Y are independent random variables.
(d) X and Y are dependent random variables.

Solution:
Option (a)

x+y =1

0.25

x
0.25 1

x+y =1

Page 4
Orange region will denote X + Y ≤ 14 . Now,
Z 1/4 Z 1/4−y
1
P (X + Y ≤ ) = fXY (x, y)dxdy
4 y=0 x=0

Z 1/4 Z 1/4−y

= 24xydxdy
y=0 x=0

1/4−y
Z 1/4
2
= 12x y dy
y=0
x=0

Z 1/4  2
1
= 12y −y dy
y=0 4

Z 1/4
12
= y(1 − 4y)2 dy
y=0 16

Z 1/4
3
= y(1 + 16y 2 − 8y)dy
4 y=0

1/4
y2 8y 3
 
3 4
= + 4y −
4 2 3
y=0

 
3 1 1 1
= + −
4 32 64 24
3 1 1
= . =
4 192 256

Hence, option (a) is wrong.

Option (b)

Page 5
y

x + y = 0.5
0.5 x+y =1

x
0.5 1

Page 6
Orange region will denote X + Y ≤ 12 . Now,
Z 1/2 Z 1/2−y
1
P (X + Y ≤ ) = fXY (x, y)dxdy
2 y=0 x=0

Z 1/2 Z 1/2−y

= 24xydxdy
y=0 x=0

1/2−y
Z 1/2
2
= 12x y dy
y=0
x=0

Z 1/2  2
1
= 12y −y dy
y=0 2

Z 1/2
12
= y(1 − 2y)2 dy
y=0 4

Z 1/2

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

1/2
y2 4y 3
 
=3 + y4 −
2 3
y=0

 
1 1 1
=3 + −
8 16 6
2 1
=3× =
96 16

Hence, option (b) is correct.

Option (c) and (d)

Page 7
y

0.5 x+y =1

x
0.5 1

For 0 < x < 1


Z 1−x
fX (x) = fXY (x, y)dy
y=0
Z 1−x
= 24xydy
y=0
1−x
2
= 12xy
y=0
= 12x(1 − x)2

For 0 < y < 1


Z 1−y
fY (y) = fXY (x, y)dx
Zx=0
1−y
= 24xydx
0
1−y
2
= 12x y
x=0
= 12y(1 − y)2

Therefore, fX (x).fY (y) = 144xy(1 − x)2 (1 − y)2 ̸= fXY (x, y)

Hence, X and Y are not independent.

Page 8
5. The joint pdf of two random variables X and Y is given by
(
3xy(1 − x) 0 ≤ x ≤ 1, 0 ≤ y ≤ 2
fXY (x, y) =
0 otherwise

Calculate P (X > 12 |Y = 1).


Solution:
We know that
fXY (a < X < b, y)
P (a < X < b|Y = y) =
fY (y)
Now,
Z 1
fY (y) = 3xy(1 − x)dx
0
Z 1
= (3xy − 3x2 y)dx
0
1
3x2 y
 
= − x3 y
2
0
3y y
= −y =
2 2
1
Therefore, fY (1) = 2
Now,

1 fXY (X > 12 , Y = 1)
P (X > |Y = 1) =
2 fY (1)
1
= 2fXY (X > , Y = 1)
2
Z 1
= 2(3x(1 − x))dx
x= 12
Z 1
=6 (x − x2 )dx
1
2
1
x2 x3

=6 −
2 3 1
  2 
1 1 1 1 1 1
=6 − −6 − =1− =
2 3 8 24 2 2

6. The amount of milk (in litres) in a shop at the beginning of any day is a random amount
X from which a random amount Y (in litres) is sold during that day. Assume that the

Page 9
joint density function of X and Y is given by
(
1
0 ≤ x ≤ 10, 0 ≤ y ≤ x
fXY (x, y) = 50
0 otherwise
Find the probability that amount of milk left at the end of day is less than 5 litres. Write
your answer correct to two decimal points.
Solution:
y
y=x
10

5
x−y =5

x
5 10

X denotes the amount of milk at the beginning of any day and Y denotes the amount
of milk which is sold during that day.
Therefore, amount of milk left at the end of the day will be denoted by X − Y .

To find: P (X − Y < 5)

In the diagram above, brown region denotes X −Y < 5 and brown + blue region denotes
the support of X and Y .

1
Area of the support(X, Y ) = 2
× 10 × 10 = 50.

Area of brown region = Area of support(X, Y )− area of blue region

⇒ area of brown region = 50 − 12 × 5 × 5 = 75


2

Therefore,
area of brown region
P (X − Y < 5) =
area of support
75/2
=
50
75
=
100

Page 10
7. The joint pdf of two continuous random variables X and Y is given by
(
ke−(x+y) x ≥ 0, y ≥ 0
fXY (x, y) =
0 otherwise

Find the value of P (X ≥ 5, Y ≤ 5).

(a) e−10
(b) (e−5 − 1)e−5
(c) (1 − e−5 )e−5
(d) (e−5 + 1)e−5

Solution:
We know that Z Z
fXY dxdy = 1
Supp(X,Y )

Therefore,
Z ∞ Z ∞
(ke−(x+y) )dxdy = 1
y=0 x=0
Z ∞ Z ∞
⇒k e−y e−x dxdy = 1
y=0 x=0

Z ∞
−y −x
⇒k e (−e ) dy = 1
y=0
0
Z ∞
−y
⇒k e (0 + 1)dy = 1
Zy=0

⇒k e−y dy = 1
y=0

−y
⇒k(−e ) =1
0
⇒k(0 + 1) = 1
⇒k = 1

To find: P (X ≥ 5, Y ≤ 5)

Page 11
Now,
Z 5 Z ∞
P (X ≥ 5, Y ≤ 5) = (e−(x+y) )dxdy
y=0 x=5
Z 5 Z ∞
= e−y e−x dxdy
y=0 x=5

Z 5
= e−y (−e−x ) dy
y=0
5
Z 5
= e−y (0 + e−5 )dy
y=0
Z 5
−5
= (e ) e−y dy
y=0
5

= (e−5 )(−e−y )
0
= (e−5 )(−e−5 + 1)
= (e−5 )(1 − e−5 )

8. The joint pdf of two random variables X and Y is given by


(
1
(x + y) 0 ≤ x ≤ 2, 0 ≤ y ≤ 2
fXY (x, y) = 8
0 otherwise
 
1 1
Find the value of P ≤ y ≤ 1 | (X = ) . Write your answer correct to two decimal
2 2
points.
Solution:
We know that
fXY (X = x, a < Y < b)
P (a < Y < b|X = x) =
fX (x)
Now,
Z 2
1
fX (x) = (x + y)dy
0 8
2
y2

1
= xy +
8 2
0
2x + 2 x+1
= =
8 4

Therefore, fX ( 12 ) = 3
8

Page 12
Now,

1 1 fXY (X = 12 , 12 ≤ Y ≤ 1)
P ( ≤ Y ≤ 1|X = ) =
2 2 fX ( 12 )

Z 1   
8 1 1
= + y dy
1/2 3 8 2

Z 1  
1 1
= + y dy
1/2 3 2

1
y y2
 
= +
6 6 1/2

   
1 1 1 1
= + − +
6 6 12 24

1 1 5
= − = = 0.20
3 8 24

2 y

y = x/2

x
1 2

Page 13
y
100 D C

y = x − 30 F

30 A B
E

x
30 100

Use the following information to answer questions (9) and (10):

The joint density function of two random variables X and Y is given by



 2 (x + 1), for 0 < x < 1, 0 < y < 1
fXY (x, y) = 3
0, otherwise

9. Are X and Y independent?

(a) Yes
(b) No

Solution:
First we will calculate the marginal densities of X and Y .
For 0 < x < 1
Z 1
fX (x) = fXY (x, y)dy
0
Z 1
2
= (x + 1) dy
0 3
1
2
= (x + 1)y
3
y=0
2
= (x + 1)
3

Page 14
For 0 < y < 1
Z 1
fY (y) = fXY (x, y)dx
0
Z 1
2
= (x + 1) dx
0 3
1
2 x2

= +x
3 2
0
2 3
= × =1
3 2

Therefore,
2
fX (x).fY (y) = (x + 1) = fXY (x, y)
3
It implies that X and Y are independent random variables.

10. Find the value of P (X > Y ). Write your answer correct to two decimal places.

Solution:

2 y

x
1 2

Page 15
The shaded region here represents X > Y .

Z1 Z1
2
P (X > Y ) = (x + 1) dxdy
3
0 y
Z1 1
x2
 
2
= +x dy
3 2
0 y
Z1
3 y2
 
2
= − − y dy
3 2 2
0
1
y3 y2
 
2 3
= y− −
3 2 6 2
0
2 5
= × = 0.55
3 6

Page 16

You might also like