Htest2 Sol
Htest2 Sol
Htest2 Sol
Solution: The population we are interested in is all bottles filled by the machine (past
and future); the mean fill level of the population is µ, and the standard deviation of
the fill level of the population is σ = 0.05. Our null and alternative hypotheses are as
follows:
H0 : µ = 2
Ha : µ 6= 2.
Solution: Our test statistic is based on the sample of n = 100 bottles. Let x̄ denote
the mean fill level from this sample. Our test statistic is
x̄ − µ0 x̄ − 2 x̄ − 2
z= √ = √ = .
σ/ n (.05)/ 100 (.005)
Solution: Since this is a 2-sided alternative, we reject for large values of |z|, specif-
ically when |z| > zα/2 . Since we are testing at the 5% significance level, we have
α = .05 and zα/2 = 1.96 ≈ 2. We reject H0 when
|z| > 2.
Solution: We are assuming that the sample bottles were drawn independently with-
out bias from the population.
(e) What is the result of the test?
Page 2
2. Before Facebook’s recent redesign, the mean number of ad clicks per day was 100K, and the
standard deviation was 35K. In the 49 days after the redesign, the mean number of ad clicks
per day was 105K. Is there significant evidence that the redesign affected ad clicks? Perform a
test at the 5% level, assuming the redesign did not affect the population standard deviation.
(a) What are the null and alternative hypotheses?
Solution: There are two populations of interest here. The first population is the
daily ad clicks (past and future), in a (hypothetical) world where Facebook does not
redesign their cite. The second population is the daily ad clicks (past and future) in
the world where Facebook redesigns their cite. Let µ0 be the mean clicks per day in
the first population, and µ be the mean clicks per day. Assume that the standard
deviation of the number of clicks per day is the same for both populations, σ.
We use “thousands of clicks” as the units for all relevant quantities. The problem tells
us that µ0 = 100 and σ = 35.
The null hypothesis is that there is no difference between the two populations (i.e., the
redesign had no effect); the alternative hypothesis is that the two populations have
different means:
H0 : µ = 100
Ha : µ 6= 100
Solution: The test statistic is based on the sample, the observed clicks in the n = 49
days after the redesign. Let x̄ denote the mean clicks per day in the sample. Our test
statistic is
x̄ − µ0 x̄ − 100 x̄ − 100
z= √ = √ = .
σ/ n 35/ 49 5
Solution: Since this is a 2-sided test, we reject when |z| is large, specifically when
|z| > zα/2 . The problem asks for a test at level 5%, so α = .05 and zα/2 = 1.96 ≈ 2.
We will reject H0 if |z| > zα/2 , i.e.
|z| > 2.
Solution: We need to assume that the sample elements were drawn independently
from the population. (The population we refer to is the world in which Facebook does
the website redesign, not the hypothetical world where they don’t.)
Admittedly, the assumption does not hold, since there is strong selection bias in the
sample: we are sampling days right after the website redesign with higher probability
Page 3
than days far into the future. For example, we have no chance of sampling a day three
years into the future.
Since the assumption does not hold, we are in a bit of an awkward position. The
hypothesis test may not be valid. One way in which it may not be valid is the following:
it usually takes people a few weeks to adjust to a website redesign, so the ad click
behavior in our sample of 49 days may not be representative of all future ad click
behavior.
Solution: Despite the caveats mentioned in part (d), we will proceed with the test.
Using the observed value x̄ = 105, we compute
105 − 100
z= = 1.
5
Since |z| ≤ 2, the statistic is not in the rejection region, so we do not reject H0 at
significance level 5%.
Page 4
Tests on the population mean (unknown variance)
3. This is a variation of problem 1. A certain population has unknown mean µ and unknown
standard deviation σ. You want test (at significance level 5%) the null hypothesis H0 : µ = 2
against the alternative Ha : µ 6= 2. To this end, you collect a sample of size n = 100. The
sample mean is x̄ = 1.985 and the sample standard deviation is s = 0.5.
(a) What is the test statistic?
Solution:
x̄ − µ0 x̄ − 2 x̄ − 2
t= √ = √ = .
s/ n (.05)/ 100 (.005)
Solution: Since this is a 2-sided alternative, we reject for large values of |t|, specifically
when |t| > tα/2 . We have n − 1 = 99 degrees of freedom. Since we are testing at the
5% significance level, we have α = .05 and tα/2 ≈ 2. We reject H0 when
|t| > 2.
Solution: We are assuming that the samples are drawn independently from the pop-
ulation.
Page 5
One-sided alternatives
4. The average nicotine content of a brand of cigarettes must be less than 0.5 mg for it to qualify
as a Low Nicotine brand. The manufacturer of Lucky Strikes Cigarettes claims that it is a Low
Nicotine brand. To test this claim, the FDA takes a random sample of 20 cigarettes (one pack)
of Lucky Strikes. They find an average nicotine content of 0.4 mg, with a sample standard
deviation of 0.2 mg. Test the manufacturer’s claim, at the 1% level of significance. Assume
that the nicotine measurements are normally distributed.
(a) What are the population and the sample?
Solution: The population is the nicotine contents of all Low Nicotine cigarettes man-
ufactured by Lucky Strike. The sample is the n = 20 sampled cigarettes.
Solution: Let µ be the average nicotine contents (in mg) of all cigarettes in the
population.
H0 : µ = 0.5
Ha : µ > 0.5
X̄ − 0.2
T = √
S/ n
Solution: We assume that the sample is unbiased. Also, since n < 30, we need to
assume that the population is normally distributed.
Page 6
Since this is not in the rejection region, we do not reject the null hypothesis.
Page 7