Last updated on June 12th, 2025
Most of us have wondered how mathematicians compare different datasets. Well, they use different methods and the z-test is one such method. The z-test can be used to assess the hypotheses concerning population proportions or averages. The z-test is usually applied to one sample, two samples, or proportions. It also has many real-life applications. For e.g., it can be used to compare the average weight of students belonging to one school to the weight of students from another school. This is done to check if there is any major variation between them. Let’s learn more about these tests.
It is a hypothesis test done to compare the sample's average to the average of the population. The result of the comparison is called z-score, which determines the total deviation of the sample average from the population average. This test is used when the size of the sample is greater than 30.
The formula for the z-score is:
z = (x - μ) / σ
Here: z = Z-score
x = the value being evaluated
μ = the mean
σ = the standard deviation
For example: The average height of 5th grade students from one school is 140 cm with a standard deviation of 6 cm; the average height of students of the same grade from another school is 120 cm. Find the z score.
Using the formula: z = (x - μ) / σ
Substituting the given values:
z = (120 –140) / 6 = -3.333
Here, the z-score tells us that the average height of students studying in the second school is 3.33 standard deviations below the average height of students from the first school.
Struggling with Math?
Get 1:1 Coaching to Boost Grades Fast !
Z tests are utilized in comparing one sample to another or with a population in various sectors. Let’s look at a few key takeaways:
Z tests come in various types. We will now see how each of them varies:
One-sample z-test: We use the one-sample test when a single sample differs extensively from a known population mean. To use this test, the population standard deviation should be known and the sample size must be more than 30.
Two-sample z-test: This test compares the means of two independent samples.
Let μ1 and μ2 be the population means; X1 and X2 are the sample mean.
The null hypothesis of the test could be:
Ho : μ1 – μ2 = 0
H1 : μ1 – μ2 ≠ 0
We calculate the z-test score using the formula:
Z = (X1 X2) (μ1 – μ2)σ 2n1 + σ 2n2
Here:
X sample mean
σ1 and σ2 standard deviation
n1 and n2 population sample sizes for p1 and p2
Z tests can be used in comparing proportions between a sample and a population, or two samples. For example: Determining whether the proportion of girls in a school differs significantly from the worldwide percentage.
Learning about the Z-test helps students compare datasets in real-world situations. The tips and tricks mentioned below will help us understand the concept easily:
Z tests are significantly used in various fields in comparing averages. Let’s explore a few of them:
We now understand how important it is to learn Z-tests; however, students make some errors in calculations, which can lead to incorrect results. We will now look at a few common mistakes to watch out for and the ways to avoid them:
Level Up with a Math Certification!
2X Faster Learning (Grades 1-12)
A researcher wants to compare the average scores of two groups of students. Group A (20 students) has an average test score of 60 with a standard deviation of 5, while Group B (25 students) has an average score of 65 with a standard deviation of 10. Test at a 1.5 significance level if there is a significant difference in the means.
We have insufficient evidence at the 1.5% level of significance to determine the variation of the scores.
In the problem, we have that:
Group A:
n1 = 20
X1 =60
S1 = 5
The Group B is given as:
n2= 25
X2 =65
S2 = 10
The significance level is given as 1.5 %: 𝛂 = 0.015
Now, state the hypothesis:
Ho : μ1 = μ2
H1 : μ1 ≠ μ2
Using the formula:
Z = (X1 - X2)/ √σ 2n1+σ 2n2
Z = (60 – 65)/ √(52/20 + 102/25)
Z = - 51.25 + 4
Z = - 55.25
Z = - 52.29 = – 2.18
We calculate the critical z-value for 𝛂 = 0.015 as ±2.42.
Since -2.18 > -2.42, we could not reject the null hypothesis at the 1.5% significance level. The evidence is insufficient to conclude a significant difference in test scores.
A fruit seller says that the apples in his shop weigh 200 grams on average. You and your friends pick 35 apples and find that their average weight is 150 grams. You also know that apples usually have a weight variation of 15 grams. Should we believe the fruit seller’s claim?
The possibility of getting a sample with an average weight of 150 grams if the true mean was 200 grams is exceedingly low. This shows the fruit seller’s assertion was low.
Given that,
Claimed average weight = 200 grams
Sample average weight = 150 grams
Standard deviation = 15 grams
Sample size = 35 apples
Here, we use the z-test formula:
z = (X1 - X2) σ 2n1+σ 2n2
= (150 - 200 15/35
= - 50 15/ 5.92
= - 50 2.53 = -19.76
Z = -19.76
Since Z is below any significance threshold, we should reject the null hypothesis and conclude that the fruit seller’s claim is likely false.
A company says their new running shoes help people run 5 minutes faster than usual. Your school tests these shoes on 35 students and finds that, on average, students run 5.5 minutes faster with a variation of 4.5 minutes. Can we believe the company?
As the value does not cross the critical value, we cannot reject the null hypothesis. Therefore, we cannot deny the company’s claim.
We have that:
n = 35
Claimed change = 5 minutes
Sample average change = 5.5 minutes
Standard deviation = 4.5 minutes
Step 1 is to formulate the hypotheses:
Null Hypothesis: The company’s claim is true.
H0 : μ = 5
Alternative hypothesis: The true mean could be different from 5 minutes.
H𝛼 : μ ≠ 5
Using t-test:
t = x̄ - μ0 s/n
t = 5.5 - 5 4.5/35
t = 0.50.76 = 0.66
To find the critical value:
For a two-tailed test with a significance threshold of 0.05, the crucial t-value for df = 34 (because df = n - 1) is ±2.03.
Now we make the decision: since the calculated value is 0.66 < 2.03
As the value does not cross the critical value, we cannot reject the null hypothesis. Therefore, we cannot deny the company’s claim.
Turn your child into a math star!
#1 Math Hack Schools Won't Teach!
Struggling with Math?
Get 1:1 Coaching to Boost Grades Fast !
Jaipreet Kour Wazir is a data wizard with over 5 years of expertise in simplifying complex data concepts. From crunching numbers to crafting insightful visualizations, she turns raw data into compelling stories. Her journey from analytics to education ref
: She compares datasets to puzzle games—the more you play with them, the clearer the picture becomes!