College of Computing & Mathematics
Department of Mathematics
Chapter 8
Statistical Interval for Single Sample
Chapter Goals:
After completing this chapter, you should be able to:
o Distinguish between a point estimate and a confidence interval estimate.
o Construct and interpret a confidence interval estimate for a single population mean.
o Form and interpret a confidence interval estimate for a single population proportion.
o Determine the required sample size to estimate a single population parameter within
a specified margin of error.
King Fahd University of Petroleum & Minerals
2 Department of Mathematics
8.1 Point and Interval estimates
Assume X1, X2, …, Xn be a random sample selected from a population, then we can
estimate the population parameters with sample statistics as follows
σ𝑥
✓ The sample mean 𝑥ҧ = is a point estimator of the population mean µ
𝑛
σ 𝑥 2 −𝑛𝑥ҧ 2
✓ The sample standard deviation s = is a point estimator of the population 𝜎
𝑛−1
𝑥
✓ The sample proportion 𝑝Ƹ = 𝑛 is a point estimator of the population p
Assume X1, X2, …, Xn be a random sample selected from a normal population, with
unknown mean 𝜇 and known standard deviation 𝜎
Then, from the results of chapter 7, we know that the sample mean is normally
𝜎
distributed with mean 𝜇𝑥ҧ = 𝜇 and standard error 𝜎𝑥ҧ = 𝑛
We can standardize the sample mean using the formula
𝑥ҧ − 𝜇𝑥ҧ 𝑥ҧ − 𝜇 𝑛
𝑍= =
𝜎𝑥ҧ 𝜎
The random variable 𝑍 has a standard normal distribution with mean zero and variance one.
King Fahd University of Petroleum & Minerals
3 Department of Mathematics
Student-t distribution
Assume X1, X2, …, Xn are sample points randomly selected from a normal population, with
✓ Unknown mean 𝜇
✓ unknown standard deviation 𝜎
Then, the sample mean has student-t distribution with
✓ mean of sample mean 𝜇𝑥ҧ = 𝜇
𝑠
✓ standard error 𝜎𝑥ҧ =
𝑛
then the random variable
𝑥ҧ − 𝜇𝑥ҧ 𝑥ҧ − 𝜇 𝑛
𝑇= =
𝜎𝑥ҧ 𝑠
has student-t distribution with degrees of freedom 𝑣 = 𝑛 − 1
King Fahd University of Petroleum & Minerals
4 Department of Mathematics
Properties of student-t distribution
✓ Student-t distribution has bell shape like normal distribution.
✓ it has the same properties as the normal distribution, mean = median = mode.
✓ Its parameter is called the “degrees of freedom” (𝑣 = 𝑛 − 1).
✓ as n increases, student-t distribution approaches the standard normal distribution.
The meaning of degrees of freedom
As an example: suppose the mean of three values is 8
If x1 = 7 and x2 = 8 , then x3 must be 9 ( x3 is not free to vary)
2 values can be selected freely, but the third is not free to vary for a given mean
King Fahd University of Petroleum & Minerals
5 Department of Mathematics
The critical value using student-t distribution
The critical value is a t value given an area to the right under the student-t curve equal to
𝛼 for some degrees of freedom
𝑡𝛼,𝑛−1 = 𝑎 such that
𝑃 𝑇𝑛−1 > 𝑎 = 𝛼
Example (student-t table) Find the following
1. 𝑡0.05,13 = 1.771
2. 𝑡0.025,25 = 2.06
3. 𝑡0.005,29 = 2.756
4. 𝑃 𝑇12 > 1.356 = 0.1
5. 𝑃 𝑇20 > 3.99 < 0.0005
6. 𝑃 𝑇18 > 1.98 =
0.025 < 𝑃 𝑇18 > 1.8 < 0.05
King Fahd University of Petroleum & Minerals
6 Department of Mathematics
Comparison between student-t and standard normal
As the sample size n increases , student-t distribution approaches a standard normal
distribution
t,10 t,20 t,30 z
0.2 1.372 1.325 1.310 1.28
0.1 1.812 1.725 1.697 1.645
0.05 2.228 2.086 2.042 1.96
0.01 3.169 2.845 2.750 2.575
King Fahd University of Petroleum & Minerals
7 Department of Mathematics
Developing the Confidence interval
When you make an estimate in statistics, there is always uncertainty around the estimate
because the number is based on a sample from the population you are studying
Assume X1, X2, …, Xn be a random sample selected from a normal population, with
Unknown mean 𝜇 and Known standard deviation 𝜎
Then, from the results of chapter 7, we know that the sample mean is normally
𝜎
distributed with mean 𝜇𝑥ҧ = 𝜇 and standard error 𝜎𝑥ҧ = 𝑛
A confidence interval estimate for the population mean μ is an interval of the form
𝑙≤𝜇≤𝑢
where the end points 𝑙 & 𝑢 are computed from the sample data
✓ There is a probability of 1-α of selecting a sample for which the C.I will contain the true
value of μ
✓ The endpoints or bounds 𝑙 & 𝑢 are called the lower and the upper confidence limits
✓ 1-α is called the confidence coefficient
King Fahd University of Petroleum & Minerals
8 Department of Mathematics
Developing the Confidence interval
Let X1, X2, …,Xn be a sample selected from normal distribution with
o unknown mean 𝜇
o known standard deviation 𝜎
ҧ
𝑥−𝜇 𝑛
because 𝑍 = has a standard normal distribution, we may write
σ
𝑃 𝑙 ≤𝜇 ≤𝑢 =1−𝛼
𝑥ҧ − 𝜇 𝑛
𝑃 −𝑧𝛼 ≤ ≤ 𝑧𝛼 = 1 − 𝛼
2 𝜎 2
𝜎 𝜎
𝑥ҧ − 𝑧𝛼 ≤ 𝜇 ≤ 𝑥ҧ + 𝑧𝛼
2 𝑛 2 𝑛
where
𝑥:ҧ the point estimator of μ
𝜎
𝑧𝛼 𝑛: the margin of error
2
𝜎
𝑛
: the standard error of the sample mean
𝑧𝛼 : is the critical value
2
King Fahd University of Petroleum & Minerals
9 Department of Mathematics
Meaning of the Confidence Interval
An interval gives a range of values:
✓ Based on observation from One sample.
✓ That you expect your estimate to fall between a certain percentage of time if you run the
experiment a gain.
✓ Takes into consideration variation in sample statistics from sample to sample.
✓ Gives information about closeness to unknown population parameters.
✓ Stated in terms of level of confidence, the percentage of time if you run the experiment a gain.
✓ In practice you do not know µ so you do not know if the interval actually contains µ
✓ Based on the one sample you actually selected, you can be 1 − 𝛼 100% confident your interval
will contain µ (this is a 1 − 𝛼 100% confidence interval)
King Fahd University of Petroleum & Minerals
✓ Never 100% sure. 10 Department of Mathematics
Confidence Level and Precision of Estimate
• If 𝑋ത is used as an estimate of the population mean 𝜇, we can be 1 − 𝛼 100%
confident that the error 𝑥ҧ − 𝜇 will not exceed a specified amount 𝑒
• The length (width) of the interval
ℓ = 2𝑒
• The length of the interval is a measure of the precision of the estimate.
• Half – length of the C.I is the bound of the error in estimation of the parameter
King Fahd University of Petroleum & Minerals
11 Department of Mathematics
The margin of error
The amount added and subtracted to the point estimate to form the confidence interval
𝜎
𝑒 = 𝑧𝛼
2 𝑛
Factors Affecting Margin of Error
King Fahd University of Petroleum & Minerals
12 Department of Mathematics
Cases for Confidence interval for the true population mean
Case 1
If the population is normally distributed with known standard deviation, a 1 − 𝛼 100%
confidence interval for μ is given by
𝜎
𝑥ҧ ± 𝑧𝛼
2 𝑛
Case 2
If the population is normally distributed with unknown standard deviation and the
sample size is large 𝑛 ≥ 30 , a 1 − 𝛼 100% confidence interval for μ is given by
𝑠
𝑥ҧ ± 𝑧𝛼
2 𝑛
Case 3
If the population is normally distributed with unknown standard deviation and the
sample size is small 𝑛 < 30 , a 1 − 𝛼 100% confidence interval for μ is given by
𝑠
𝑥ҧ ± 𝑡𝛼,𝑛−1
2 𝑛
2.0
King Fahd University of Petroleum & Minerals
13 Department of Mathematics
E
Example
A sample of 11 circuits from a large normal population has a mean resistance of 2.20
ohms. We know from past testing that the population standard deviation is 0.35 ohms.
1. Find the standard error of the sample mean resistance.
Given that 𝑛 = 11 & 𝑥ҧ = 2.2 & 𝑠 = 𝑖𝑠 𝑛𝑜𝑡 𝑔𝑖𝑣𝑒𝑛 & 𝜎 = 0.35
Since the sample is selected from a normal distribution, the sample mean is also
𝜎 0.35
normally distributed with 𝜇𝑥ҧ (unknown) and 𝜎𝑥ҧ = 𝑛 = 11
2. Determine a 92% confidence interval for the true mean resistance (of the population)
Since 𝜎 is known, the C.I is given by
𝜎
𝑥ҧ ± 𝑧𝛼
2 𝑛
𝛼
Where 1 − 𝛼 = 0.92 → 𝛼 = 0.08 → = 0.04 → 𝑧𝛼 = 𝑧0.04 = 1.75
2 2
0.35
2.2 ± 1.75
2.0 11
2.015 𝑜ℎ𝑚𝑠 ≤ 𝜇 ≤ 2.384 𝑜ℎ𝑚𝑠
King Fahd University of Petroleum & Minerals
15 Department of Mathematics
Example
A sample of 11 circuits from a large normal population has a mean resistance of 2.20
ohms. We know from past testing that the population standard deviation is 0.35 ohms.
3. Interpret your answer in part 2.
We are 92%, confident that the true mean resistance is between 2.015 and 2.384 ohms
OR
Although the true mean may or may not be in this interval, 92% of intervals formed in
this manner will contain the true mean
4. Based on your answer in part two above, If you have earlier claimed that the true
population mean is equal to 2.4, Is your claim rejected or not? Explain?
Is 𝜇 = 2.4?
Since 2.4 ∉ (2.015, 2.384), the claim is rejected with 92% confidence level
2.0
King Fahd University of Petroleum & Minerals
16 Department of Mathematics
Example
A sample of 11 circuits from a large normal population has a mean resistance of 2.20
ohms. We know from past testing that the population standard deviation is 0.35 ohms.
5. Would a 99% CI calculated from the same sample data be longer or shorter than 92% C.I?
Since 𝑧𝛼 = 𝑧0.005 = 2.58, the interval will be longer.
2
6. With what degree of confidence could we say that the mean resistance is between 2.03 and
2.37 𝜎
2.37 = 𝑥ҧ + 𝑧𝛼
2 𝑛
0.35
2.37 = 2.2 + 𝑧𝛼
2 11
2.37−2.2 11
𝑧𝛼 = = 1.61
2 0.35
𝛼 𝛼
𝑧𝛼 = 𝑃 𝑍 > 1.61 = → 𝑃 𝑍 < −1.61 =
2 2 2
𝛼
= 0.0537 → 𝛼 = 0.1074 → 1 − 𝛼 = 0.8926
2
2.0
The degree of confidence 1 − 𝛼 100% = 89.26%
King Fahd University of Petroleum & Minerals
17 Department of Mathematics
Example
Below are 26 overall miles driven per gallon (MPG) of 2022 small SUV’s
24 23 22 21 22 22 18 18 26 26 27 19 20
19 21 21 21 21 21 18 19 21 22 22 16 16
Construct a 95% confidence interval estimate for the population mean MPG of 2022 small
SUVs, assuming a normal distribution.
𝑥ҧ = 21 & 𝑠 = 2.7857
Since the sample size 𝑛 = 26, small and the population standard deviation unknown, the C.I
given by 𝑠
𝑥ҧ ± 𝑡𝛼,𝑛−1
2 𝑛
𝛼
Where 1 − 𝛼 = 0.95 → 𝛼 = 0.05 → = 0.025 → 𝑡𝛼,𝑛−1 = 𝑡0.025,25 = 2.060
2 2
2.7857
21 ± 2.060
15
19.518 𝑀𝑃𝐺 ≤ 𝜇 ≤ 22.482 MPG
2.0
King Fahd University of Petroleum & Minerals
18 Department of Mathematics
8.1.2: Determining the required sample size
The required sample size can be found to reach a desired margin of error (e) and level of
confidence (1 – )
The sample size depends on:
1. the cost.
2. the confidence levels.
3. the margin error.
4. the standard deviation.
Required sample size, σ known:
𝑧𝛼/2 𝜎 2
𝑛≥
𝑒
Required sample size, σ unknown:
If unknown, σ can be estimated when using the required sample size formula.
➢ Use a value for σ that is expected to be at least as large as the true σ.
➢ Select a pilot sample and estimate σ with the sample standard deviation, s.
Then
2
𝑧𝛼/2 𝑆
𝑛≥
2.0 𝑒
King Fahd University of Petroleum & Minerals
19 Department of Mathematics
Example
Suppose that it is known that the population standard deviation is 40. If you wish to estimate
the population mean using a 95% C.I estimate with a margin of error ± 2.5. What sample size
will be required?
Given 𝜎 = 40, 1 − 𝛼 = 0.95 𝑎𝑛𝑑 𝑒 = ±2.5
𝛼
1 − 𝛼 = 0.95 → 𝛼 = 0.05 → = 0.025 → 𝑧𝛼 = 𝑧0.025 = 1.96
2 2
𝑧𝛼 𝜎 2
2
𝑛≥
𝑒
1.96 40 2
𝑛≥ 2.5
= 983.449 (rounded up ALWAYS)
The minimum size is 984
2.0
King Fahd University of Petroleum & Minerals
20 Department of Mathematics
Example
The stock price for a company is thought to be fairly normal. The stock prices for 7 days are
9.8 10.2 10.4 9.8 10 10.2 and 9.6
1. Find and interpret a 95 % confidence interval for the true mean stock prices
Since 𝜎 𝑖𝑠 𝑢𝑛𝑘𝑜𝑤𝑛 𝑎𝑛𝑑 𝑛 = 7, the sample mean =10 and 𝑠 = 0.2828 , the C.I is given by
𝑠
𝑥ҧ ± 𝑡𝛼,𝑛−1
2 𝑛
𝛼
where 1 − 𝛼 = 0.95 → 𝛼 = 0.05 → 2
= 0.025 → 𝑡0.025,6 = 2.447
0.2828
10 ± 2.447
7
9.738 ≤ 𝜇 ≤ 10.262
With a 95% level, we are confident that the population mean stock price will be between
9.738 and 10.262
2.0
King Fahd University of Petroleum & Minerals
21 Department of Mathematics
Example
The stock price for a company is thought to be fairly normal. The stock prices for 7 days are
9.8 10.2 10.4 9.8 10 10.2 and 9.6
2. You want to estimate the population mean stock prices with 99% confidence with error
margin at most 0.05. Find the minimum sample size necessary for this estimation
𝛼
1 − 𝛼 = 0.99 → 𝛼 = 0.01 → = 0.005 → 𝑧0.005 = 2.58
2
2
2.58(0.2828)
𝑛≥
0.05
𝑛 ≥ 212.94
The minimum sample size is 213
2.0
King Fahd University of Petroleum & Minerals
22 Department of Mathematics
8.4 The Confidence interval for the population proportion
Recall that the Sample proportion
𝑥
Represented by 𝑝Ƹ = 𝑛, is the ratio of items in the sample with characteristic of interest
The sampling distribution for 𝑝Ƹ
These two conditions MUST be both satisfied; if 𝑛𝑝Ƹ ≥ 5 AND 𝑛 1 − 𝑝Ƹ ≥ 5, the sample
proportion 𝑝Ƹ is approximately normal with a
1. mean of (𝜇𝑝ො = 𝑝), and a
𝑝 1−𝑝
2. standard error of 𝑛
𝑋 𝑝ො 1−𝑝ො
3. But since 𝑝 = 𝑁 is unknown, we can estimate the standard error by 𝜎ො𝑝ො = 𝑛
The Confidence interval for the population proportion
a 1 − 𝛼 100% confidence interval for the population proportion p is given by
𝑝Ƹ 1 − 𝑝Ƹ
Where 𝑝Ƹ ± 𝑧𝛼
2 𝑛
𝑧𝛼 2
2
2.0 𝑛 ≥
1. The sample size: 𝑒
𝑝 1−𝑝
2. p can be estimated with a pilot sample, or if necessary use 𝑝 = 0.5
King Fahd University of Petroleum & Minerals
23 Department of Mathematics
Example
A well-known pharmacy in one of the cities wants to know the percentage of doctors who
prefer to recommend a particular painkiller. To help the manager, a random sample of 300
doctors revealed that 180 said that they would recommend the painkiller.
1. Form a 95% confidence interval for the true percentage of doctors who recommend the
painkiller
180
Given that 𝑛 = 300 & 𝑥 = 180 𝑝Ƹ = = 0.6
300
Since 𝑛𝑝Ƹ = 300 0.6 = 180 > 5 and 𝑛 1 − 𝑝Ƹ = 300 0.4 = 120 > 5, the C.I given by
𝑝Ƹ 1 − 𝑝Ƹ
𝑝Ƹ ± 𝑧𝛼
2 𝑛
𝛼
Where 1 − 𝛼 = 0.95 → 𝛼 = 0.05 → = 0.025 → 𝑧𝛼 = 𝑧0.025 = 1.96
2 2
0.6 0.4
0.6 ± 1.96
300
0.5446 ≤ 𝑃 ≤ 0.6554
We are 95% confident that the true proportion of doctors who recommend the painkiller will be between
54.46% and 65.54%
King Fahd University of Petroleum & Minerals
25 Department of Mathematics
Example
A well-known pharmacy in one of the cities wants to know the percentage of doctors who
prefer to recommend a particular painkiller. To help the manager, a random sample of 300
doctors revealed that 180 said that they would recommend the painkiller.
2. It is known that the number of doctors working in the city is 3,000 doctors, form a 95%
confidence interval for the number of doctors who recommend the painkiller in this city
since the percentage of doctors who recommend the painkiller will be between 54.46% and 65.54%
0.5446 ≤ 𝑝 ≤ 0.6554
A 95% C.I for the number of doctors who recommend the painkiller will be
3000 0.5446) ≤ 𝑝 ≤ (0.6554 3000
1634 ≤ 𝑋 ≤ 1967
3. What is the minimum required sample if we want to be 95% confident that the error
when using the sample proportion to estimate the true value of 𝑝 is less than 5%?
𝑧𝛼 2 2
2 1.96 180 180
𝑛≥ 𝑝Ƹ 1 − 𝑝Ƹ = 1− = 368.79 ≈ 369
𝑒 0.05 300 300
4. How large must the sample be if we wish to be 95% confident that the error in
estimating the true proportion is less than 5% regardless of the true value of p ?
𝑧𝛼 2 2
2 1.96 1
𝑛≥ 𝑝Ƹ 1 − 𝑝Ƹ = = 384.16 ≈ 385
𝑒 0.05 4
King Fahd University of Petroleum & Minerals
26 Department of Mathematics
Summary
𝜋 𝜋
2.0
King Fahd University of Petroleum & Minerals
27 Department of Mathematics
College of Computing & Mathematics
Department of Mathematics
Thank You!
General Discussion / Q&A
23 July 2024 King Fahd University of Petroleum & Minerals
28 Department of Mathematics