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

Stats2_week11

Ga python

Uploaded by

ggpsg19
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)
18 views

Stats2_week11

Ga python

Uploaded by

ggpsg19
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/ 13

Statistics for Data Science - 2

Graded assignment week 10

Use the following values of standard normal distribution if needed.

FZ (0.15) = 0.55962, FZ (−0.04) = 0.48405, FZ (−1.28) = 0.10027, FZ (1.96) = 0.975, FZ (−1.64) =


0.05, FZ (1.64) = 0.95, FZ (−1.28) = 0.01, FZ (2.74) = .99693, FZ (−1.36) = .08691, FZ (2.54) =
.99446, FZ (−2.8) = .00256, FZ (−2.58) = 0.005, FZ (2.58) = 0.995, FZ (−1.96) = 0.025, FZ (1.28) =
0.90

1. The average marks scored by students of a school in their board exams is reported to
be 400 with a standard deviation of 5. You suspect that the average may be lower,
possibly 390, and decide to sample students to find their marks.
(a) What sample size do you need for a test at the significance level 0.05 and power
0.95?
Answer: 3

Solution:
Let the random variable X represent the marks obtained by students in their
board exams with expected value µ and standard deviation σ.
Given µ = 400 and σ = 5.
Consider the Null and alternative hypothesis:
H0 : µ = 400
HA : µ < 400
Test Statistics: X
Test: Reject H0 , if X < c at α = 0.05
α = P (reject H0 |H0 is true)
 
X − 400 c − 400
=P √ < √
5/ n 5/ n
 
c − 400
=⇒ 0.05 = FZ √
5/ n
c − 400
=⇒ FZ−1 (0.05) = √
5/ n
c − 400
=⇒ −1.64 = √
5/ n
5
=⇒ c = −1.64 × √ + 400 · · · (1)
n

1
Again, when alternative hypothesis is true, we have

X − 390
√ ∼ Normal(0, 1)
5/ n

β = P (Accept H0 |HA is true)


P (X ≥ c | µ = 390)
 
X − 390 c − 390
P √ ≥ √
5/ n 5/ n
 
c − 390
=⇒ 0.05 = 1 − FZ √
5/ n
c − 390
=⇒ FZ−1 (0.95) = √
5/ n
c − 390
=⇒ 1.64 = √
5/ n
5
=⇒ c = 1.64 × √ + 390 · · · (2)
n

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


5 5
− 1.64 × √ + 400 = 1.64 × √ + 390
n n
5
=⇒ 2 × 1.64 × √ = 10
n
2
=⇒ n = 1.64 = 2.6896 ≈ 3

(b) Find the critical value c. Enter the answer correct to two decimal places.
394.73, [394.00, 396.00]
Solution: Substituting the value of c in (2), we get c = 394.73.

2. Suppose X ∼ Normal(µ, 9). For n = 100 iid samples of X, the observed sample mean
is 11.8. What conclusion would a z-test reach if the null hypothesis assumes µ = 10.5
(against an alternative hypothesis µ 6= 10.5)?

(a) Accept H0 at a significance level of 0.10.


(b) Reject H0 at a significance level of 0.10.
(c) Accept H0 at a significance level of 0.05.
(d) Reject H0 at a significance level of 0.05.

Solution:
Given, X ∼ Normal(µ, 9).

2
X1 , . . . , X100 ∼ iid X. For 100 iid samples of X, X̄ ∼ Normal(µ, 9/100)
Sample mean, X̄ = 11.8.
Consider the null and alternative hypotheses: Null hypothesis,

H0 : µ = 10.5

HA : µ 6= 10.5
Test for α = 0.05
Test: Reject H0 if |X̄ − µ| > c

α = P (| X̄ − 10.5 |> c|µ = 10.5)


!
X̄ − 10.5 c
⇒α=P | p |> p
9/100 9/100
!
c
⇒ α = P | z |> p
9/100
!
−c
⇒ 0.05 = 2Fz p
9/100
3 −1
=⇒ c = − F (0.025) = 0.5879 (1)
10 z
Since | 11.8 − 10.5 |> c, z-test at significance level (α) = 0.05, will reject H0 .

Test for α = 0.1


Test: Reject H0 if |X̄ − µ| > c

α = P (| X̄ − 10.5 |> c|µ = 10.5)


!
X̄ − 10.5 c
α=P | p |> p
25/100 9/100
!
c
α = P | z |> p
9/100
!
−c
0.1 = 2Fz p
9/100
3 −1
c=− F (0.05) = 0.4934 (2)
10 z
Since | 11.8 − 10.5 |> c, z-test at significance level (α) = 0.10, will reject H0 .
Hence, options (b) and (d) are correct.

3
3. Let X1 , . . . , X100 be a sample from a normal distribution having a variance of 25. We
wish to test the hypothesis H0 : µ = 0 versus HA : µ = 1.5. Consider a test that rejects
H0 for X̄ > c.
(a) Find the value of c at a significance level α = 0.05. Enter the answer correct to
two decimal places.
0.82
Solution:
Given, X ∼ Normal(µ, 25).
X1 , . . . , X100 ∼ iid X. For 100 iid samples of X, X̄ ∼ Normal(µ, 25/100)
The null and alternative hypothesis are
H0 : µ = 0
HA : µ > 0
Test for α = 0.05
Test: Reject H0 if X̄ > c
α = P (X̄ > c|µ = 0)
!
X̄ c
⇒α=P p >p
25/100 25/100
⇒ α = P (z > 2c)
⇒ 0.05 = 1 − Fz (2c)
1
⇒ c = Fz−1 (0.95) = 0.8224
2
(b) Find the power of the test. Enter the answer correct to two decimal places.
0.91309, [0.90, 0.93]
Solution:
Power = 1 − β = P (X̄ > c|µ = 1.5)
!
X − 1.5 c − 1.5
⇒1−β =P p >p
25/100 25/100
!
c − 1.5
⇒1−β =P z > p
25/100
⇒ 1 − β = 1 − Fz (2(c − 1.5))
Substituting the value of c from above problem,
1 − β = 1 − Fz (2(0.8224 − 1.5))
Therefore,
Power = 1 − β = 0.9123

4
4. A manufacturer supplies fuses, approximately 90% of which function properly. A new
process is initiated whose purpose is to increase the proportion of properly functioning
fuses. We obtain a random sample of 100 such fuses manufactured by the new process
and found out that 8 of them are not functioning properly. Let p denotes the proportion
of properly functioning fuses. (Use normal approximation to binomial)

(a) Define null hypothesis and alternative hypothesis.


i. H0 : p = 0.90, HA : p 6= 0.90
ii. H0 : p = 0.90, HA : p < 0.90
iii. H0 : p = 0.90, HA : p > 0.90
iv. H0 : X = 0.90, HA : X > 0.90
(b) Choose the correct options from the following:
i. Accept H0 at a significance level of 0.05.
ii. Reject H0 at a significance level of 0.10.
iii. Accept H0 at a significance level of 0.10.
iv. Reject H0 at a significance level of 0.05.

Solution:
X1 , . . . , X100 ∼ iid Bernoulli(p).
The null and alternative hypothesis are:

H0 : p = 0.9

HA : p > 0.9
92
Sample mean (X̄) = = 0.92
100
Test for α = 0.05
Test statistic, T = X1 + . . . + X100 ∼ Binomial(n, p) which can be normally approxi-
mated as
T ≈ Normal(100p, 100p(1 − p))
 
p(1 − p)
X ≈ Normal p,
100
Test: Reject H0 if X̄ > c
α = P (X̄ > c | p = 0.9)
 
 X̄ − p c−p 
α=P r
 p(1 − p) > r 
p(1 − p) 
n n

5
 
 c − 0.9 
α=P z > r 
 0.9 × 0.1 
100
 
c − 0.9
⇒ 0.05 = 1 − Fz
0.03
⇒ c = 0.9 + 0.03 × Fz−1 (0.95)
c = 0.9493
Since X̄ < c, z-test at significance level (α) = 0.05, will accept H0 .
Test for α = 0.10
Test statistic, T = X1 + . . . + X100 ∼ Binomial(n, p) which can be normally approxi-
mated as
T ≈ Normal(100p, 100p(1 − p))
 
p(1 − p)
X̄ ≈ Normal p,
100
Test: Reject H0 if X̄ > c
α = P (X̄ > c | p = 0.9)
 
 X̄ − p c−p 
α=P r
 p(1 − p) > r 
p(1 − p) 
n n
 
 c − 0.9 
α=P z > r 
 0.9 × 0.1 
100
 
c − 0.9
⇒ 0.10 = 1 − Fz
0.03
⇒ c = 0.9 + 0.03 × Fz−1 (0.90)
⇒ c = 0.9384
Since X̄ < c, z-test at significance level (α) = 0.10, we will accept H0 .
Hence, options (i) and (iii) are correct.

5. A commonly prescribed drug for relieving nervous tension is believed to be only 25%
effective. To determine if a new drug is superior in providing relief, suppose that 100
people who were suffering with nervous tension are chosen at random and inoculated.
If more than 36 of them are found to be relieved, we reject the null hypothesis that
p = 1/4 and the new drug will be considered superior to the one presently in use. (Use

6
normal approximation to binomial)

(a) Find the critical value c.


Answer: 36

Solution: Since, we will reject the null hypothesis if more than 36 out of 100
patients is found to be relieved, 36 is the critical value.
(b) Find P (Type I error). Enter the answer correct to four decimal places.
[0.0050, 0.0060]
Solution:

The null and alternative hypothesis are:

H0 : p = 0.25

HA : p > 0.25
Given, critical value (c) = 36
Test statistic, T = X1 + . . . + X100 ∼ Binomial(100, p) which can be normally
approximated as
T ≈ Normal(100p, 100p(1 − p))
Test: Reject H0 if T > c that is T > 36

α = P (T > c | p = 0.25)

α = P (T > 36 | p = 0.25)
!
36 − 100p
α=P z> p
100p(1 − p)
!
36 − 100(0.25)
α=P z>p
100 × 0.25(0.75)
 
11
α=P z> √
18.75
 
11
α = 1 − Fz √
18.75
α = 1 − Fz (2.54)
P (Type I error) = α = 0.0055

7
(c) Find P (Type II error) for p = 1/2. Enter the answer correct to four decimal
places.
[0.0020, 0.0030]

Solution:
P (Type II error) = β = P (T ≤ c | p = 0.5)
β = P (T ≤ 36 | p = 0.5)
!
36 − 100p
β=P z≤p
100p(1 − p)
!
36 − 100(0.5)
β=P z≤ p
100 × 0.5(0.5)
 
−14
β=P z≤ √
25
 
−14
β = Fz
5
β = Fz (−2.8)
P (Type II error) = β = 0.0025

6. The proportion of adults living in a small town who are college graduates is estimated
to be p = 0.6. To test this hypothesis against the alternative p < 0.6, you decide to
take a sample of adults from the town.

(a) What sample size do you need for a test (against the alternative hypothesis that
p = 0.4) at a significance level of 0.10 and power of 0.90?
40
Solution:
Null hypothesis, H0 : p = 0.6
Alternate hypothesis, HA : p < 0.6
Given, α = 0.10 and power 1 − β = 0.90
Test statistic, T = Binomial(n, p) which can be normally approximated as
T ≈ Normal(np, np(1 − p))
 
p(1 − p)
X ≈ Normal p,
n
Test: Reject H0 if T < c

8
α = P (X̄ < c|p = 0.4)
 
 X̄ − p c−p 
α=P r
 p(1 − p) < r 
p(1 − p) 
n n
 
 c−p 
α=P z < r 
 p(1 − p) 
n
 
 c − 0.6 
α=P z < r 
 0.6 × 0.4 
n
 
c − 0.6 
⇒ 0.10 = Fz  q
0.24
n
r
0.24 −1
⇒ c = 0.6 + F (0.10)
n z
0.6278
c = 0.6 − √ (3)
n
Now, power
1 − β = P (X̄ < c | p = 0.6)
 
 X̄ − p c−p 
1−β =P 
 r p(1 − p) < r p(1 − p) 

n n
 
 c−p 
1−β =P  z < r 
 p(1 − p) 
n
 
 c − 0.4 
1−β =P  z < r 
 0.4 × 0.6 
n
 
c − 0.4 
⇒ 0.90 = Fz  q
0.24
n

9
r
0.24 −1
⇒ c = 0.4 + F (0.90)
n z
0.6278
c = 0.4 + √ (4)
n
Solving equations (3) and (4),

n ≈ 39.41
n = 40
(b) Find the critical value at a significance level of 0.10. Enter the answer correct to
two decimal places.
[0.48, 0.52]
Solution:
Substitute n = 40 in equation (3),

c = 0.5
7. A random sample of 36 packets of marshmallow weighs, on average, 145 grams with
a standard deviation of 5 grams. Test the hypothesis that µ = 150 grams against the
alternative hypothesis, µ < 150 grams, at the 0.05 level of significance.
(a) On average, it weighs less than 150 grams.
(b) On average, it weighs 150 grams.
Solution:
The null and the alternative hypothesis are:
H0 : µ = 150
HA : µ < 150
Test: Reject H0 , if X < c.
Given α = 0.05, we have
α = P (X < c | µ = 150)
 
X − 150 c − 150
=⇒ 0.05 = P √ < √
5/ 36 5/ 36
 
c − 150
=⇒ 0.05 = FZ √
5/ 36
c − 150
=⇒ −1.64 = √ =⇒ c = 148.63
5/ 36

Since X = 145 < c, reject H0 .

10
8. A survey of 225 randomly selected students from a city revealed that 89.4% of them
have participated in extra curricular activities in their schools. Can we conclude at
1% level of significance that 90% of the students have participated in extra curricular
activities?

(a) Yes
(b) No

Solution:
Null hypothesis, H0 : p = 0.9
Alternate hypothesis, HA : p 6= 0.9
Given, α = 0.01 and n = 225

α = P (| X̄ − p |> c | µ = 0.9)
 
 X̄ − 0.9 c 
α=P| r |> r 
 0.9 × 0.1 0.9 × 0.1 
225 225
 
 c 
α=P | z |> r 
 0.9 × 0.1 
225
 
−15c
0.01 = 2Fz √
0.9 × 0.1

0.9 × 0.1
c=− × Fz−1 (0.005) = 0.0516
15
Since | X̄ − p |=| 0.894 − 0.9 |< c, z-test at significance level (α) = 0.01, will accept H0 .

9. A box of a certain brand of washing powder advertises that it weighs 2.5 kg, but the
actual weight is 2.4 kg with a standard deviation of 0.1 kg. The company wants to
test if the mean has changed. They take a random sample of 100 boxes and finds that
the average weight is 2.35 kg.

(a) Define null hypothesis and alternative hypothesis.


i. H0 : µ = 2.4, HA : µ 6= 2.4
ii. H0 : µ = 2.4, HA : µ > 2.4
iii. H0 : µ = 2.4, HA : µ < 2.4

11
iv. H0 : µ = 2.5, HA : µ 6= 2.5
(b) What conclusion should be made using a significance level of α = 0.05?
i. Accept H0 .
ii. Reject H0 and accept HA .
Solution:
The company wants to check if the mean has changed. So, null and alternative
hypothesis are given by
6 2.4
H0 : µ = 2.4, µ =
Define a test statistic T as T = X.

Test: reject the null hypothesis if |X − 2.4| > c.

X − 2.4 X − 2.4
By CLT, we can say that √ = ∼ Normal(0, 1).
0.1/ 100 1/100
Now,

α = P (|X − 2.4| > c)


 
X − 2.4 c
=⇒ 0.05 = P >
1/100 1/100
=⇒ 0.05 = P (|Z| > 100c)
=⇒ 0.05/2 = P (Z < −100c)
=⇒ −1.96 = −100c =⇒ c = 0.0196

Since |X − 2.4| = |2.35 − 2.4| = 0.05 > c, reject H0 .

10. It is claimed that the lifetimes of light bulbs are normally distributed with a mean of
800 hours and a standard deviation of 40 hours. We wish to test the hypothesis that
µ = 800 hours against the alternative that µ 6= 800 hours with a sample size of 30.

(a) If the acceptance region is defined as 780 ≤ X̄ ≤ 820, find the significance level.
Enter the answer correct to three decimal places.
0.006, [0.005, 0.007]
Solution:
Let the random variable X denote the lifetime of electric bulbs.
Given, X ∼ Normal(µ, 402 ).
X1 , . . . , X30 ∼ iid X.
For 30 iid samples of X, X̄ ∼ Normal(µ, 402 /30)
Null hypothesis, H0 : µ = 800
Alternate hypothesis, HA : µ 6= 800

12
α = P (Reject H0 | H0 is true)
α = P (X̄ > 820 or X̄ < 780 | µ = 800)
α = P (| X̄ − 800 |> 20)
!
X̄ − 800 20
α=P | p |> p
1600/30 1600/30
!
20
α = P | z |> p
1600/30
!
−20
α = 2Fz p
1600/30
α = 0.006
(b) Find the power of the test against the alternative that if the true mean life is 788
hours. Enter the answer correct to two decimal places.
[0.91, 0.94]
Solution:

Power = 1 − β = P (Reject H0 | HA is true)


1 − β = P (X̄ > 820 or X̄ < 780 | µ = 788)
1 − β = P (X̄ > 820 | µ = 788) + P (X̄ < 780 | µ = 788)
! !
X̄ − 788 820 − 788 X̄ − 788 780 − 788
1−β =P p >p +P p <p
1600/30 1600/30 1600/30 1600/30
! !
32 −8
1−β =P z > p +P z < p
1600/30 1600/30
! !
32 −8
1 − β = 1 − Fz p + Fz p
1600/30 1600/30
1 − β = 0.1366

Join here to get direct answers pdf:-


https://chat.whatsapp.com/GRVxtSQW4HK4RiwsVyv

13

You might also like