Study guide
Z Test for Mean Worked Example (Car Petrol MCQ), Non Parametric Test and Spearman Rank
The z = 4.04 car petrol consumption MCQ solved as a one-sample z test, plus hypothesis testing steps, non parametric tests, measures of dispersion and Spearman rank correlation for STA215, STA169 and STA154.
2026-10-24 | notesharu team
A common practice question goes like this: a car company introduces a new car claimed to have lower petrol consumption than the existing car, a sample of 50 new cars gives a mean of 30 km/l with standard deviation 3.5, and the options are z = 4.04, z = 1.15, z = 2.58 or none of the above. It is a one-sample z test for a mean, and it comes from the hypothesis testing unit of TU BSc CSIT STA215 Statistics II, Unit 2 "Testing of hypothesis". Three related short questions from the same papers are covered here too: what a non parametric test means (STA215 Unit 3 "Non parametric test"), the definition of measures of dispersion (STA169 Statistics I Unit 2 "Descriptive Statistics") and how to find Spearman's rank correlation coefficient (STA169 Unit 7 "Correlation and Linear Regression").
BIT students meet the same topics in STA154 Basic Statistics: Unit 4 "Measures of Central Tendency and Dispersion", Unit 8 "Correlation and Regression Analysis" and Unit 9 "Statistical Hypothesis Testing and Applications". This guide works the car question completely, then covers the other three topics in exam-ready form.
The car petrol consumption question as a one-sample z test
The question as it is usually copied omits the mean of the existing car. Without it, no z value can be computed, so we state the assumption: the existing car averages 28 km/l. We will see below that this is the value that makes one of the options come out exactly.
The claim is that the new car uses less petrol, which in km/l terms means it travels farther on a litre, so its mean is higher than 28. The null hypothesis is that the new car is no better, and the alternative is the claim. The sample is large (n = 50), so the sampling distribution of the mean is approximately normal and the sample standard deviation can stand in for the unknown population value.
$$H_0: \mu = 28 \qquad H_1: \mu > 28 \ (\text{right-tailed})$$
Take the level of significance as 5%. For a right-tailed z test the critical value is 1.645, so H0 is rejected if the computed z exceeds 1.645.
The standard error of the mean is
$$SE = \frac{s}{\sqrt{n}} = \frac{3.5}{\sqrt{50}} = \frac{3.5}{7.071} = 0.495$$
and the test statistic is
$$z = \frac{\bar{x} - \mu_0}{s/\sqrt{n}} = \frac{30 - 28}{0.495} = 4.04$$
Since 4.04 is greater than 1.645, we reject H0. The sample gives strong evidence that the new car's mean consumption figure is better than the existing car's.
Why the options are what they are: every option is just the difference divided by the same standard error of 0.495. A z of 4.04 corresponds to a difference of 4.04 x 0.495 = 2 km/l (existing mean 28). A z of 2.58 corresponds to 1.28 km/l, and a z of 1.15 to 0.57 km/l. So with an existing mean of 28 km/l the intended answer is z = 4.04. If your paper gives a different existing mean, only the numerator changes, and you compute the same way.
Hypothesis testing basics in the order you write them
A hypothesis test compares a claim about a population with evidence from a sample. In the exam, write the solution in this sequence, one line each.
First state the null hypothesis H0 (no difference, with an equals sign) and the alternative H1 (the claim to be supported, with a less than, greater than or not equal sign, which fixes whether the test is left-tailed, right-tailed or two-tailed). Second, state the level of significance, usually 5% or 1%. Third, write the test statistic. For a mean with large n or known sigma:
$$z = \frac{\bar{x} - \mu_0}{\sigma/\sqrt{n}}$$
and when sigma is unknown and n is small (under about 30) with a normal population, use the t statistic with n - 1 degrees of freedom:
$$t = \frac{\bar{x} - \mu_0}{s/\sqrt{n}}$$
Fourth, give the critical value from the table: 1.645 (one-tailed) and 1.96 (two-tailed) at 5% for z, and 2.33 (one-tailed) and 2.58 (two-tailed) at 1%. Fifth, decide: if the computed value falls in the rejection region, reject H0, otherwise do not reject it, and then state the conclusion in words in the context of the problem. A type I error is rejecting a true H0, and its probability is the level of significance.
Non parametric test: meaning and when to use one
A non parametric (distribution-free) test is a hypothesis test that makes no assumption about the form of the population distribution, such as normality, and often works on ranks or signs instead of the raw values. Use one when the sample is small and the population is clearly not normal, when the data are ordinal (ranks, ratings) rather than measured, or when there are outliers that distort a mean. The price is that, when the normal assumptions do hold, a parametric test is more powerful.
The tests in the syllabus, in one line each: the sign test compares paired or single observations using only the plus and minus signs of the differences; the Wilcoxon signed-rank test also uses the size ranks of the paired differences; the Mann-Whitney U test compares two independent samples using ranks; the chi-square test checks goodness of fit or independence of attributes using frequencies; and Kruskal-Wallis extends the rank idea to more than two samples.
Measures of dispersion: definition and formulas
A measure of dispersion tells how far the observations spread around the centre of the data. Two data sets can have the same mean and very different spread, so the average alone is not enough. Absolute measures carry the units of the data, and relative measures are pure numbers used to compare data sets.
$$\text{Range} = L - S \qquad QD = \frac{Q_3 - Q_1}{2} \qquad MD = \frac{\sum |x - \bar{x}|}{n}$$
$$SD = \sigma = \sqrt{\frac{\sum (x - \bar{x})^2}{n}} \qquad CV = \frac{\sigma}{\bar{x}} \times 100%$$
Here L and S are the largest and smallest values, Q1 and Q3 the quartiles, MD the mean deviation about the mean, SD the standard deviation (use n - 1 in the denominator for a sample estimate) and CV the coefficient of variation. The standard deviation is the most used measure because it takes every value into account and suits further algebra, and the smaller the CV, the more consistent the data set.
Spearman's rank correlation coefficient
Spearman's coefficient measures the strength of the relationship between two variables when the data are ranks, or are converted to ranks. It lies between -1 and +1. For n pairs with no tied ranks:
$$r_s = 1 - \frac{6 \sum d^2}{n(n^2 - 1)}$$
where d is the difference between the two ranks of each pair. To find it, rank each variable (1 for the largest, say, using the same rule for both), find d for each pair, square and add, then substitute.
Worked example. Five students have marks in Mathematics X and Statistics Y: (70, 55), (60, 60), (80, 80), (50, 45), (90, 70). Ranking from the highest, the Mathematics ranks are 3, 4, 2, 5, 1 and the Statistics ranks are 4, 3, 1, 5, 2. The differences are -1, 1, 1, 0, -1 and the squares 1, 1, 1, 0, 1, so $\sum d^2 = 4$ and n = 5.
$$r_s = 1 - \frac{6 \times 4}{5(25 - 1)} = 1 - \frac{24}{120} = 0.8$$
There is a strong positive relationship between the two sets of marks. With tied ranks, give each tied value the average of the ranks it occupies and add a correction term to the formula, but the question rarely asks for it.
How to write it in the exam
For the z-test numerical, write the hypotheses with the tail direction, the level of significance, the formula with substituted numbers, the critical value, and a decision sentence in plain words. For "non parametric test", give the definition, two reasons to use one and one-line examples of the tests. For dispersion, give a one-sentence definition and the five formulas. For Spearman, state the formula, show the ranking table and finish with the interpretation.
Practice with the STA215 Testing of hypothesis notes and the Non parametric test notes. The descriptive statistics and correlation units are on the STA169 Descriptive Statistics notes and the Correlation and Linear Regression notes. Subject pages: STA215, STA169 and BIT STA154.
Put it into practice
Browse all subjectsMore articles
Study guide
2D Geometric Transformation in Computer Graphics: Matrices and a Solved Numerical
2026-10-24
Study guide
6 Advantages of Cloud Computing, Availability and Programming Models: Exam Guide
2026-10-24
Study guide
Common Bus System in Computer Architecture with Diagram: Registers, Selection Table, Answer
2026-10-24
Study guide
Exception Handling in C++: try, catch, throw, Rethrow with Traced Examples and new/delete
2026-10-24
Study guide
Data Transfer Instructions in Computer Architecture: Mnemonic Tables, Types and Example
2026-10-24
Study guide
Definition of Constitution by Different Scholars and Government Power Distribution in Nepal 2015
2026-10-24