0% found this document useful (0 votes)
27 views

W4PS

Uploaded by

Sara
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)
27 views

W4PS

Uploaded by

Sara
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/ 8

Statistics for Data Science - 2

Week 4 Practice Assignment Solution

1. The probability density function of a continuous random variable X is shown in Figure


4.1.P.

Figure 4.1.P: Probability Density Function graph of X

The PDF is defined as follows:


(
e−x x≥0
fX (x) =
0 x<0
Find P (− < X < 0), where  is a very small positive number.

(a) e
(b) 0
(c) e−
(d) e−2

Answer: b
Solution: R0
We know that P (− < X < 0) = − fX (x)dx
But the value of fX (x) is zero in the range − to zero.
Therefore, P (− < X < 0) = 0.
Therefore, option b is the correct option.

1
2. Which of the following statements is/are true for a continuous random variable with
PDF fX (x)?

(a) If fX (2) = 2fX (1), then P (2 −  < X < 2 + ) = 2P (1 −  < X < 1 + ) for a small
.
(b) If fX (2) = 2fX (1), then P (2 −  < X < 2 + ) ≈ 2P (1 −  < X < 1 + ) for a small
.
(c) P (X = x0 ) = 0 for any value of x0 .
(d) CDF FX (x) is continuous in the domain [−∞, ∞].

Answer: b, c, and d

Solution:
Option a: We know that for small , P (x −  < X < x + ) ∝ fX (x).
Therefore, P (1 −  < X < 1 + ) ∝ fX (1) and P (2 −  < X < 2 + ) ∝ fX (2)
But P (x −  < X < x + ) is not exact linear function of fX (x).
Therefore when fX (2) = 2fX (1), then P (2 −  < X < 2 + ) 6= 2P (1 −  < X < 1 + )
but P (2 −  < X < 2 + ) ≈ 2P (1 −  < X < 1 + )
Hence option a is wrong but option b is correct.
Option c: The probability at an instant (PX (x)) for a continuous random variable is
zero as there is no sudden spike in the CDF function for any value of x. Hence option
c is correct.
Option d: For a continuous random variable CDF is always continuous.

3. If 
 1 (x2 − 8x + 16) 1 ≤ x ≤ 7
fX (x) = 18
0 otherwise
What is the value of P (X ≤ 4)? Enter the answer correct to one decimal accuracy.
R xa+1
( xa dx = )
a+1
Answer: 0.5

Solution: R
4
P (X ≤ 4) = −∞ fX (x)dx
R4
⇒ P (X ≤ 4) = 1 fX (x)dx, since fX (x) = 0 for x < 1.
R4 1 2
⇒ P (X ≤ 4) = 1 ( 18 (x − 8x + 16))dx
1 3
⇒ P (X ≤ 4) = (x /3 − 8x2 /2 + 16x/1)|41
18
1 1
⇒ P (X ≤ 4) = (43 /3 − 4 ∗ 42 + 16 ∗ 4) − (13 /3 − 4 ∗ 12 + 16 ∗ 1)
18 18
⇒ P (X ≤ 4) = 0.5

2
4. If X ∼ Normal(10, 4), then what is the value of P (X ≥ 8|X ≤ 9)? Use the standard
normal distribution tables if necessary. Enter the answer up to two decimals accuracy.
Use the following CDF values of standard normal distribution.
FZ (−2) = 0.02275, FZ (−1.5) = 0.06681, FZ (−1) = 0.15866, FZ (−0.5) = 0.30854, FZ (0) =
0.5, FZ (0.5) = 0.69146, and FZ (1) = 0.84134
Answer: 0.485 accepted range 0.48 to 0.49

Solution:
Given µ = 10, σ 2 = 4 ⇒ σ = 2
We need to find P (X ≥ 8|X ≤ 9).
P (X ≥ 8 ∩ X ≤ 9)
P (X ≥ 8|X ≤ 9) =
P (X ≤ 9)
FX (9) − FX (8)
P (X ≥ 8|X ≤ 9) =
FX (9)
Converting present normal distribution to standard distribution to get values of FX (x).
x−µ 8 − 10
For x = 8, z = = = −1, ⇒ FX (8) = FZ (−1)
σ 2
x−µ 9 − 10
For x = 9, z = = = −0.5, ⇒ FX (9) = FZ (−0.5)
σ 2
FX (9) − FX (8)
P (X ≥ 8|X ≤ 9) =
FX (9)
0.30854 − 0.15866
⇒ P (X ≥ 8|X ≤ 9) = = 0.485
0.30854

Use the following information to answer the questions 5 and 6.


The CDF of random variable X is given below:


 0 x≤0

2 1
2x 0 ≤ x ≤ 2



FX (x) = 12 1
2
≤x≤1
 x
1≤x≤2




 2
1 x≥2

Use the following derivative formula:

d(xa )
= axa−1
dx
5. Which of the following statements is/are correct?

(a) X is a continuous random variable.


(b) X is a discrete random variable.
(c) The PDF of X is not defined as X is discrete random variable.

3


 0 x≤0
0 ≤ x ≤ 12

4x



1
(d) The PDF of random variable X is fX (x) = 0 2
≤x≤1
 x

 1≤x≤2
2



0 x>2


 0 x<0

2x
2
0 ≤ x ≤ 12



1
(e) The PDF of random variable X is fX (x) = 0 2
<x<1
 x
1≤x≤2




 4
0 x>2

Answer: a, d
Solution:
d(FX (x))
We know that fX (x) =
dx
Given 
0
 x≤0

2x
2
0 ≤ x ≤ 12



1 1
FX (x) = 2 2
≤x≤1
 x
1≤x≤2




 2
1 x≥2
d(0


 =0 x≤0



 dx



d(2x2 )


1
= 4x 0≤x≤


2




 dx



 1
d( 2 )
⇒ fX (x) = =0 1
<x≤1
2


 dx



d( x2 )


= 12


 1<x≤2
dx







 d(1) = 0



x>2
dx

4



 0 x≤0
4x 0 ≤ x ≤ 21





1
Therefore, fX (x) = 0 2
<x≤1
 1
1<x≤2





 2
0 x>2
Since, FX (x) is continuous in the given domain, hence X is a continuous random
variable.

6. What is the value of P (X ≥ 1|X ≤ 1.5)? Enter the answer correct to two decimals
accuracy.
Answer: 0.33, accepted range 0.31 to 0.35
Solution:
FX (1.5) − FX (1) 1.5/2 − 1/2
P (X ≥ 1|X ≤ 1.5) = = = 1/3
FX (1.5) 1.5/2
7. The time taken by Rohith to complete a race follows the exponential distribution with
an expected time of completion of 10 minutes. What is the probability that Rohith
takes less than 20 minutes but more than 10 minutes to complete the race? Enter the
e−ax
answer correct to 2 decimals accuracy. ( e−ax dx =
R
)
−a
Answer: 0.2325, accepted range: 0.23 to 0.235
Solution:
Given E[X] = 10 minutes.
We know for a exponential distribution E[X] = λ1
⇒ λ1 = 10, λ = 0.1
For exponential distribution FX (x) = 1 − e−λx
The probability that athlete takes more than 10 minutes is,
FX (10) = 1 − e−0.1×10 = 1 − e−1
The probability that athlete takes more than 20 minutes is,
FX (20) = 1 − e−0.1×20 = 1 − e−2
The probability that athlete takes more than 10 minutes but less than 20 minutes to
complete race is FX (20) − FX (10) = e−1 − e−2 = 0.232 approximately.

8. The CDF of a random variable X is given as:



0 x x<0


FX (x) = 0 ≤ x ≤ ln 2
 ln 4
1 − e−x ln 2 ≤ x < ∞

Derivative formulas required to solve the problem:

d(ax)
=a
dx

5
d(e−ax )
= −ae−ax
dx
The PDF of the random variable X is:


 0 x<0
1

(a) fX (x) = 0 ≤ x < ln 2
 ln 4
 −x

e ln 2 ≤ x < ∞

0
 x<0
(b) fX (x) = 1 0 ≤ x < ln 2

 −x
e ln 2 ≤ x < ∞


 0 x<0
1

(c) fX (x) = 0 ≤ x ≤ ln 2
 ln
 −x
 2
e ln 2 < x < ∞


0 x<0
1

(d) fX (x) = 0 ≤ x < ln 2
 lnx 2


e ln 2 ≤ x < ∞

Answer: a
Solution:
d(FX (x))
We know that fX (x) =
dx
Given, 
0 x<0


x
FX (x) = 0 ≤ x ≤ ln 2
 ln 4
1 − e−x

ln 2 ≤ x < ∞
Therefore,
d(0)


 =0 x<0



 dx



 x
d( )

fX (x) = ln 4 = 1 0 ≤ x ≤ ln 2
 dx ln 4






−x
 d(1 − e ) = e−x



ln 2 ≤ x < ∞
dx
Hence option a is correct.
Use the following information to answer (9), (10) and (11):

6
Let X be a continuous random variable with the PDF given by

cx
 0≤x<1

c 1≤x≤2
fX (x) =


 −cx + 4c 2≤x<3

0, otherwise
9. Find the value of c. Write your answer correct to two decimal places.
Solution:
R∞
Using the basic properties of PDF i.e −∞ fX (x)dx = 1
R∞ R1 R2 R3
⇒ −∞ fX (x)dx = 0 cxdx + 1 cdx + 2 −cx + 4cdx = 1
c 5c
⇒ +c− + 4c = 1
2 2
1
Solving this equation, we get c =
3
10. Find the CDf of X.
Solution:
CDF is calculated as the integral of PDF

For x < 0, FX = 0 as PDF for x < 0 is 0


Rx R0 Rx x x2
For 0 ≤ x < 1, FX = −∞ fX (x)dx = −∞ 0dx + 0 dx =
3 6
Rx R0 R1 x Rx x−1 1
For 1 ≤ x ≤ 2, FX = −∞ fX (x)dx = −∞ 0dx + 0 dx + 1 cdx = +
3 3 6
 
Rx R0 R1 x R2 R x −x 4
For 2 ≤ x ≤ 3, FX = −∞ fX (x)dx = −∞ 0dx + 0 dx + 1 cdx + 2 + dx =
3 3 3
4x x2 3
− −
3 6 2

For x ≥ 3, FX = 1
Therefore, the required CDF is


 0, forx < 0
2
x




 , for0 ≤ x < 1
6


x−1 1
FX (x) = + , for1 ≤ x < 2
 3 2
6
4x x 3


− − , for2 ≤ x < 3



3 6 2



1, forx ≥ 3

7
11. If X1 , X2 and X3 are three independent observations from X, find the probability that
exactly one of the samples is larger than 2.5? Enter the answer correct to two decimal
places.
Solution:

X1 , X2 , X3 are independent.
To calculate: P (Xi > 2.5), here i can be 1 or 2 or 3

Probability that exactly one of the three samples is larger than 2.5 equals P (X1 >
2.5)×P (X2 < 2.5)×P (X3 < 2.5)+P (X1 < 2.5)×P (X2 > 2.5)×P (X3 < 2.5)+P (X1 <
2.5) × P (X2 < 2.5) × P (X3 > 2.5)

Now, P (X1 > 2.5) = 1 − P (X1 < 2.5)

Rx R0 R1 x R2 1 R 2.5 −x 4
P (X1 < 2.5) = f (x)dx =
∞ X −∞
0dx + 0
dx + 1
dx + 2
( + )dx
3 3 3 3

After Calculation P (X1 < 2.5) = 0.80


So, Probability that exactly one of the three samples is larger than 2.5 equals P (X1 >
2.5)×P (X2 < 2.5)×P (X3 < 2.5)+P (X1 < 2.5)×P (X2 > 2.5)×P (X3 < 2.5)+P (X1 <
2.5) × P (X2 < 2.5) × P (X3 > 2.5) = 3 × (0.80 × 0.20 × 0.80) = 0.384

You might also like