All 38 questions UPSC has asked on non-parametric tests in the Statistics Optional (Paper I, Statistical Inference) from 1995 to 2026, solved step by step – latest first.
Try them yourself first: the same questions, without solutions, are on our Statistical Inference topic-wise PYQs page.
How we check these solutions
These are our own solutions, prepared with AI help. UPSC does not publish official answers. Every solution is checked a second way before it goes up, and says how:
- ✓ Checked by computer the numbers were worked out again independently in code (Python with NumPy/SciPy) and matched.
- ✓ Proof checked step by step for “prove that” and “examine whether” questions, every step was checked against the definitions and the standard theorems.
- ✓ Derivation checked step by step for derivations and approximations, every step was checked, and the result was also tested numerically.
- ✓ Answer checked step by step for descriptive questions, every point was checked against the standard theory.
Spotted a mistake or a neater method? Tell us in the comments below or through Report an error.
Jump to a question (year · question number):
2026 · 3b 2025 · 4c 2024 · 4c 2023 · 1d 2022 · 4c 2021 · 4c 2020 · 4c 2019 · 4c 2018 · 1d 2017 · 3c 2016 · 3b 2015 · 4b 2014 · 2c 2013 · 1e 2013 · 4c 2012 · 4b 2011 · 1d 2010 · 1f 2010 · 4a 2006 · 1f 2006 · 3b 2005 · 1f 2005 · 4a 2004 · 1f 2003 · 4b 2002 · 3c 2001 · 2iv 2001 · 3iv 2000 · 1f 2000 · 4b(i) 1999 · 8b 1998 · 8a 1998 · 8b 1997 · 8c 1996 · 8b 1996 · 8c 1995 · 8a 1995 · 8b
The lifetimes, in hours, of two brands of batteries are given below:
| Brand A | 40 | 30 | 40 | 45 | 55 | 30 |
| Brand B | 50 | 50 | 45 | 55 | 60 | 40 |
Examine whether the two brands are different with respect to average life using (i) Kolmogorov-Smirnov test and (ii) median test.
Solution
Data (ordered). A: 30, 30, 40, 40, 45, 55. B: 40, 45, 50, 50, 55, 60. .
(i) Kolmogorov–Smirnov two-sample test. : the two lifetime distributions are the same. .
| 30 | 40 | 45 | 50 | 55 | 60 | |
|---|---|---|---|---|---|---|
| 2 | 4 | 5 | 5 | 6 | 6 | |
| 0 | 1 | 2 | 4 | 5 | 6 | |
| 2 | 3 | 3 | 1 | 1 | 0 |
We do not reject .
(ii) Median test. The combined median of the 12 values is . We drop the two values equal to 45, which leaves 10 values.
| Above 45 | Below 45 | Total | |
|---|---|---|---|
| A | 1 | 4 | 5 |
| B | 4 | 1 | 5 |
| Total | 5 | 5 | 10 |
The counts are far too small for a approximation, so we use the exact (hypergeometric) probability. The tables at least as extreme as this one have probabilities and the two-sided -value is . We do not reject .
Conclusion. Neither test finds a significant difference between the two brands. (Brand B looks longer-lived, but the samples are too small to show it.)
✓ Checked by computer We computed both empirical distribution functions (D = 3/6 = 0.5) and the median-test table in Python. Fisher’s exact test on the median table gives p = 0.21.
The life of 6 items of brand-A and 6 items of brand-B are given below:
| A | 40 | 62 | 55 | 35 | 48 | 88 |
| B | 50 | 70 | 65 | 30 | 45 | 92 |
Using Kolmogorov-Smirnov test, test whether the distribution of life of both the brands are same or not at 5% level of significance. [Given that ]
Solution
Hypotheses. : the two brands have the same life distribution, . : they differ.
Empirical distribution functions (), at the ordered combined values:
| 30 | 35 | 40 | 45 | 48 | 50 | 55 | 62 | 65 | 70 | 88 | 92 | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0 | 1 | 2 | 2 | 3 | 3 | 4 | 5 | 5 | 5 | 6 | 6 | |
| 1 | 1 | 1 | 2 | 2 | 3 | 3 | 3 | 4 | 5 | 5 | 6 | |
| 1 | 0 | 1 | 0 | 1 | 0 | 1 | 2 | 1 | 0 | 1 | 0 |
Test statistic.
Decision. . We do not reject . The life distributions of the two brands may be taken as the same.
✓ Checked by computer We computed both empirical distribution functions at all 12 points in Python: D = 2/6, at x = 62.
Differentiate between Mann-Whitney -test and Wilcoxon sign test. The following data pertain to APGAR scores of 15 pregnant women in two care programmes and :
| Programme A | 8 | 7 | 6 | 2 | 5 | 8 | 7 | 3 |
| Programme B | 9 | 9 | 7 | 8 | 10 | 9 | 6 |
Is there a significant difference in APGAR scores of pregnant women under the two care programmes? [Given, ]
Solution
Mann–Whitney -test vs Wilcoxon sign test.
| Mann–Whitney -test | Sign test | |
|---|---|---|
| Samples | two independent samples | one sample, or paired data |
| Hypothesis | the two populations are identical (same location) | the median equals a given value (or the median difference is 0) |
| Uses | ranks of the combined sample | only the signs of the differences |
| Information | uses magnitudes, through ranks | ignores magnitudes |
| Efficiency vs (normal data) | 0.955 | 0.637 |
The data. : APGAR scores have the same distribution under A and B. : they differ. , .
Ranking the 15 scores together (average ranks for ties):
| Score | 2 | 3 | 5 | 6 | 6 | 7 | 7 | 7 | 8 | 8 | 8 | 9 | 9 | 9 | 10 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Group | A | A | A | A | B | A | A | B | A | A | B | B | B | B | B |
| Rank | 1 | 2 | 3 | 4.5 | 4.5 | 7 | 7 | 7 | 10 | 10 | 10 | 13 | 13 | 13 | 15 |
Decision. . We reject at the 5% level. Programme B gives significantly higher APGAR scores.
✓ Checked by computer We ranked the 15 scores with average ranks for ties: R_A = 44.5, U = 8.5. SciPy’s Mann–Whitney test agrees (U = 8.5, p = 0.026).
Apply Run Test to test the randomness of the following sequence of H and T at 5% level of significance: HHHHHHTHHHHHTHTHHHH TTHHHHTHHHTTHHHHHH THHTTHHTHHH Given: ,
Solution
Counts. The sequence has symbols: heads and tails. Counting the runs (maximal blocks of the same symbol):
Null distribution (large sample). Under randomness,
Test statistic.
Decision. . We do not reject : the sequence may be regarded as random.
✓ Checked by computer We counted the sequence in Python: 48 tosses, 36 H, 12 T, 19 runs. E(R) = 19, so Z = 0.
The following data present the time (in minutes), that a commuter had to wait to catch a bus to reach his destination:
| Days | Time | Days | Time |
| 1 | 23 | 11 | 14 |
| 2 | 25 | 12 | 14 |
| 3 | 12 | 13 | 16 |
| 4 | 07 | 14 | 19 |
| 5 | 17 | 15 | 23 |
| 6 | 16 | 16 | 24 |
| 7 | 13 | 17 | 12 |
| 8 | 26 | 18 | 18 |
| 9 | 27 | 19 | 11 |
| 10 | 12 | 20 | 08 |
Use the sign-test at 0.05 level of significance to test the claim of the bus operators that commuters do not have to wait for more than 15 minutes before the bus is made available to them. [Given ]
Solution
Hypotheses. Let be the median waiting time. The operators’ claim is
Signs. Mark each day if the wait exceeds 15 minutes, and if it is less. No value equals 15.
- (above 15): 23, 25, 17, 16, 26, 27, 16, 19, 23, 24, 18 → 11
- (below 15): 12, 7, 13, 12, 14, 14, 12, 11, 8 → 9
. Under (at ), the number of signs .
Test statistic (normal approximation): (The exact -value is .)
Decision. . We do not reject . The data support the claim that commuters do not usually wait more than 15 minutes.
✓ Checked by computer We counted 11 values above 15 and 9 below. The exact binomial p-value is P(X ≥ 11) = 0.412, and Z = 0.45.
A company’s trainees are randomly assigned to groups which are through a certain industrial inspection procedure by three different methods. At the end of the instructing period they are tested for inspection performance quality. The following are their scores:
| Method A: | 80 | 83 | 79 | 85 | 90 | 68 | |
| Method B: | 82 | 84 | 60 | 72 | 86 | 67 | 91 |
| Method C: | 93 | 65 | 77 | 78 | 88 |
Using the appropriate non-parametric test, determine at 0.05 level of significance whether the three methods are equally effective.
Solution
Test. The three samples are independent, and the scores need not be normal, so we use the Kruskal–Wallis test. : the three methods are equally effective (identical distributions).
Ranks (all 18 scores together):
| Method | Scores (rank) | ||
|---|---|---|---|
| A | 80 (9), 83 (11), 79 (8), 85 (13), 90 (16), 68 (4) | 6 | 61 |
| B | 82 (10), 84 (12), 60 (1), 72 (5), 86 (14), 67 (3), 91 (17) | 7 | 62 |
| C | 93 (18), 65 (2), 77 (6), 78 (7), 88 (15) | 5 | 48 |
Check: .
Test statistic. :
Decision. Under , is approximately , with . Since , we do not reject . The three methods appear equally effective.
✓ Checked by computer We ranked all 18 scores and computed H = 0.197 in Python. SciPy’s Kruskal–Wallis test agrees (p = 0.91).
A random sample of 14 male students from a rural Junior High School and an independent random sample of 16 male students from an urban Junior High School were given a test to measure their level of mental health. The obtained data are given in the following table: Mental Health Scores of Junior High Schools’ male students:
| Rural | 28, 49, 42, 30, 33, 36, 49, 31, 41, 46, 41, 21, 20, 28 |
| Urban | 37, 22, 24, 24, 27, 44, 34, 26, 20, 26, 25, 45, 32, 40, 45, 25 |
Apply Median Test to test the hypothesis at 5% level of significance that their median mental health level scores are equal or not. [Given that ]
Solution
Combined median. All 30 scores ordered: the 15th and 16th values are 31 and 32, so the median is .
Contingency table.
| Above 31.5 | Below 31.5 | Total | |
|---|---|---|---|
| Rural | 8 | 6 | 14 |
| Urban | 7 | 9 | 16 |
| Total | 15 | 15 | 30 |
Expected frequencies. Rural: in each column. Urban: in each column.
Test statistic. (Equivalently, .)
Decision. . We do not reject . The median mental-health scores of rural and urban students may be taken as equal.
✓ Checked by computer We found the combined median 31.5, built the 2 × 2 table, and computed χ² = 0.536 in Python (0.134 with Yates’ correction).
Weddell seals live in the Antarctic and feed on fish during long, deep dives in freezing water. The seals benefit from these feeding dives, but the food they gain comes at a metabolic cost. A set of researchers wanted to know whether feeding per se was also energetically expensive, over and above the exertion of a regular dive. They measured the metabolic cost of 10 feeding dives and for each of these also measured a non-feeding dive by the same animal that lasted the same amount of time. The data are given below:
| Individual | Oxygen consumption after non-feeding dive () | Oxygen consumption after feeding dive () |
| 1 | 42 | 71 |
| 2 | 52 | 77 |
| 3 | 60 | 83 |
| 4 | 67 | 96 |
| 5 | 82 | 107 |
| 6 | 82 | 113 |
| 7 | 81 | 121 |
| 8 | 81 | 80 |
| 9 | 96 | 128 |
| 10 | 104 | 143 |
Mention assumptions about the populations and carry out an appropriate non-parametric test of hypothesis that the energetic cost is the same for feeding and non-feeding dives at level .
Solution
Design. Each seal gives a feeding and a non-feeding dive of the same length, so the data are paired. We use the Wilcoxon signed-rank test on the differences .
Assumptions.
- The 10 differences are independent (different seals).
- The distribution of differences is continuous and symmetric about its median . (No normality is assumed.)
Hypotheses. (same energetic cost) against .
Signed ranks.
| Seal | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
|---|---|---|---|---|---|---|---|---|---|---|
| 29 | 25 | 23 | 29 | 25 | 31 | 40 | −1 | 32 | 39 | |
| Rank of | 5.5 | 3.5 | 2 | 5.5 | 3.5 | 7 | 10 | 1 | 8 | 9 |
Decision. For and two-sided , the critical value is 8: reject if . Here , so we reject . (Exact -value .)
Conclusion. Feeding dives cost significantly more oxygen than non-feeding dives of the same length. Feeding itself is energetically expensive.
✓ Checked by computer We computed the differences and signed ranks in Python: T⁻ = 1 and T⁺ = 54. SciPy’s exact Wilcoxon test gives p = 0.0039.
The following data represents lifetime (hours) of batteries for two different brands:
| Brand A | 40 | 30 | 40 | 45 | 55 | 30 |
| Brand B | 50 | 50 | 45 | 55 | 60 | 40 |
Use the Median test to conclude if the two samples come from the same population.
Solution
Combined sample (12 values, ordered): 30, 30, 40, 40, 40, 45, 45, 50, 50, 55, 55, 60. The median is .
Classify each value. We drop the two values equal to the median (one from each brand):
| Above 45 | Below 45 | Total | |
|---|---|---|---|
| Brand A | 1 | 4 | 5 |
| Brand B | 4 | 1 | 5 |
| Total | 5 | 5 | 10 |
Test. : both samples come from the same population (equal medians). Expected counts are 2.5, far too small for , so we use the exact hypergeometric probabilities: The two-sided -value is .
Decision. . We do not reject . The two samples may have come from the same population.
(If the approximation is used anyway, , with the same conclusion.)
✓ Checked by computer We found the combined median 45 and the 2 × 2 table in Python. Fisher’s exact test gives p = 0.21.
Using Kolmogorov-Smirnov test, determine whether the sample data given below come from an exponential distribution with mean 4. The observations in the sample are (Given, , , )
Solution
Hypothesis. : the sample comes from the exponential distribution with mean 4:
Ordered sample and gaps (). and .
| 1 | 0.7 | 0.161 | −0.094 | 0.161 |
| 2 | 0.8 | 0.181 | −0.048 | 0.115 |
| 3 | 1.1 | 0.240 | −0.040 | 0.107 |
| 4 | 2.0 | 0.393 | −0.127 | 0.193 |
| 5 | 3.9 | 0.623 | −0.289 | 0.356 |
| 6 | 4.2 | 0.650 | −0.250 | 0.317 |
| 7 | 4.3 | 0.659 | −0.192 | 0.259 |
| 8 | 4.9 | 0.706 | −0.173 | 0.240 |
| 9 | 5.1 | 0.721 | −0.121 | 0.187 |
| 10 | 5.2 | 0.727 | −0.061 | 0.127 |
| 11 | 5.3 | 0.734 | −0.001 | 0.068 |
| 12 | 5.5 | 0.747 | 0.053 | 0.014 |
| 13 | 5.7 | 0.759 | 0.107 | −0.041 |
| 14 | 5.8 | 0.765 | 0.168 | −0.101 |
| 15 | 6.0 | 0.777 | 0.223 | −0.156 |
Decision. . We reject at the 5% level. The data are not consistent with an exponential distribution with mean 4. (Too many values are bunched between 4 and 6.)
✓ Checked by computer We computed F₀ at each ordered value and both one-sided gaps in Python: D⁺ = 0.223 and D⁻ = 0.356. SciPy’s KS test agrees (p = 0.033).
Test the hypothesis of no difference between the ages of 10 married couples using Mann-Whitney U-test for the sample data at 10% level of significance. (Use normal probability integral table):
| Age (in years) | ||||||||||
| Male | 26 | 43 | 35 | 38 | 33 | 42 | 40 | 44 | 25 | 31 |
| Female | 47 | 48 | 34 | 34 | 47 | 35 | 32 | 35 | 30 | 44 |
Solution
Note on the question. The data are 10 married couples, so the ages are naturally paired. A paired test (sign or signed-rank test) would be more appropriate. As the question asks, we use the Mann–Whitney test, treating the two groups as independent samples. (The signed-rank test also finds no difference: .)
Hypotheses. : male and female ages have the same distribution. : they differ. .
Ranks (combined, average ranks for ties):
- Male: 26 (2), 43 (15), 35 (10), 38 (12), 33 (6), 42 (14), 40 (13), 44 (16.5), 25 (1), 31 (4). .
- Female: 47 (18.5), 48 (20), 34 (7.5), 34 (7.5), 47 (18.5), 35 (10), 32 (5), 35 (10), 30 (3), 44 (16.5). .
Normal approximation. The tied groups are (34, 34), (44, 44), (47, 47) and (35, 35, 35), so .
Decision. (two-sided 10% level). We do not reject . There is no significant difference between the ages of husbands and wives.
✓ Checked by computer We ranked the 20 ages with average ranks for ties: R_M = 93.5, U = 38.5. With the tie correction, Z = −0.87. SciPy agrees (p = 0.40).
Suppose that and have cdf and respectively. Given independent random samples and from these distributions, construct Mann-Whitney test of for all against the alternative that for at least one . Also indicate the test when the alternative is for some . State the test you would use when and are large.
Solution
Statistic. Let Equivalently, , where is the sum of the ranks of the ’s in the combined sample.
Null distribution. Under , all arrangements of the combined sample are equally likely. So the distribution of is free of and can be tabulated. It is symmetric about
One-sided alternative for some . (strict somewhere) means is stochastically smaller than . Then ’s tend to exceed ’s, and tends to be large:
Two-sided alternative . Reject when is too large or too small: with , by symmetry.
Large and . Use the normal approximation:
- One-sided (): reject if .
- Two-sided: reject if .
With ties, use average ranks and replace by , .
✓ Derivation checked step by step Every step was checked: the definition of U, its null mean and variance, and the direction of the one-sided rejection region.
A die is rolled 15 times with the following results:
| Face value | 1 | 2 | 3 | 4 | 5 | 6 |
| Frequency | 0 | 1 | 4 | 0 | 4 | 6 |
Use Kolmogorov-Smirnov statistic to test whether the die is unbiased or not. (Given )
Solution
Hypothesis. : the die is unbiased, so .
Cumulative proportions ():
| Face | 1 | 2 | 3 | 4 | 5 | 6 |
|---|---|---|---|---|---|---|
| Frequency | 0 | 1 | 4 | 0 | 4 | 6 |
| 0 | 1/15 | 5/15 | 5/15 | 9/15 | 1 | |
| 1/6 | 2/6 | 3/6 | 4/6 | 5/6 | 1 | |
| 0.167 | 0.267 | 0.167 | 0.333 | 0.233 | 0 |
Decision. . We reject : the die appears biased towards high faces.
(For a discrete distribution, the usual KS critical values are conservative: the true size is below 5%. Since we still reject, the conclusion stands.)
✓ Checked by computer We computed the cumulative proportions and D = 1/3 in Python.
Use sign test statistic to find a non-trivial distribution free confidence interval for population median of a continuous distribution.
Solution
Set-up. from a continuous distribution with median . Order them: .
Link with the sign test. For a value , let be the number of observations greater than . The sign test of uses under . The two-sided sign test at level accepts when where is the largest integer with , for .
Invert the test. means at least observations exceed , that is, . And means . So the set of medians accepted is
Confidence interval. is a confidence interval for with confidence coefficient It is distribution-free, because whatever the continuous distribution.
Example ():
| Interval | |||
|---|---|---|---|
| Confidence | 0.998 | 0.979 | 0.891 |
So is a 97.9% interval, the shortest one with at least 95% confidence.
✓ Proof checked step by step Every step was checked: the coverage probability equals P(r ≤ B ≤ n − r) for B ~ B(n, ½). We also checked this by simulation (n = 10, r = 2: coverage 0.979).
To compare two brands of tyres, the following milages (in ‘000’ miles) were obtained for 8 tyres of each kind: Brand A: 32.1, 20.6, 17.8, 28.4, 19.6, 21.4, 19.9, 30.1 Brand B: 19.8, 27.6, 30.8, 27.8, 34.1, 18.7, 16.9, 17.9 Test the null hypothesis at that the two samples come from the same population using Mann – Whitney test. [Table value: , ] where .
Solution
Hypotheses. : the two samples come from the same population. : they do not. , (two-sided).
Ranks (combined, all values distinct):
- A: 32.1 (15), 20.6 (8), 17.8 (2), 28.4 (12), 19.6 (5), 21.4 (9), 19.9 (7), 30.1 (13). .
- B: 19.8 (6), 27.6 (10), 30.8 (14), 27.8 (11), 34.1 (16), 18.7 (4), 16.9 (1), 17.9 (3). .
Check: .
statistics.
Decision. The table gives . By symmetry about , the two-sided 5% test rejects if or . Both and lie between 14 and 50. We do not reject . The two brands give similar mileages.
✓ Checked by computer We ranked the 16 mileages in Python: R_A = 71, U_A = 35, U_B = 29. SciPy agrees (p = 0.80).
Compare the Chi-square test and Kolmogrov-Smirnov test as tests for goodness of fit. Show that the Kolmogrov-Smirnov one sample test is distribution free. Also state the large sample distribution of the Kolmogrov-Smirnov test statistic.
Solution
Comparison of the two goodness-of-fit tests.
| test | Kolmogorov–Smirnov test | |
|---|---|---|
| Data | grouped into classes | individual observations |
| Distribution | discrete or continuous | continuous (conservative if discrete) |
| Statistic | ||
| Null distribution | approximate (), for large | exact for every , distribution-free |
| Small samples | not valid (needs ) | valid |
| Estimated parameters | allowed (lose 1 df each) | standard tables invalid; need adjusted tables (e.g. Lilliefors) |
| Grouping | result depends on the choice of classes | no arbitrary grouping |
| One-sided alternatives | no | yes (, ) |
| Power | lower for continuous data | usually higher |
| Extra uses | contingency tables, multinomial data | confidence bands for |
The one-sample KS statistic is distribution-free. Let be continuous, and put . By the probability integral transform, are i.i.d. under .
Since is non-decreasing, (up to events of probability zero). So where is the empirical distribution function of the . Writing , which runs over as runs over the real line, The right side depends only on a uniform sample. So the distribution of is the same for every continuous .
Large-sample distribution (Kolmogorov). For every , For example, the 5% point is , so for large we reject at 5% if . For the one-sided statistic, .
✓ Proof checked step by step Every step was checked: the probability integral transform makes the statistic’s distribution free of F₀, and the Kolmogorov limit was checked against its standard form.
Scores of 10 candidates of Civil Service Main Examination of a recent year in Statistics Papers I and II are as under:
| Serial No. of Candidates | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
| Score in Statistics I | 98 | 172 | 58 | 106 | 185 | 89 | 140 | 168 | 102 | 202 |
| Score in Statistics II | 69 | 123 | 65 | 120 | 131 | 92 | 96 | 120 | 75 | 174 |
Use sign test to verify the hypothesis that candidates in the above examination offering both the Papers of Statistics scored higher on an average in Paper I than in Paper II.
Solution
Hypotheses. The data are paired (the same candidate in both papers). Let be the median of .
Signs.
| Candidate | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
|---|---|---|---|---|---|---|---|---|---|---|
| 29 | 49 | −7 | −14 | 54 | −3 | 44 | 48 | 27 | 28 | |
| Sign | + | + | − | − | + | − | + | + | + | + |
Number of signs: , with . Under , .
-value.
Decision. . We do not reject . The sign test does not show that candidates scored higher in Paper I. (The rejection region at 5% would be , with size .)
✓ Checked by computer We computed the 10 differences in Python: 7 plus and 3 minus. The exact one-sided p-value is P(X ≥ 7) = 0.172.
Let be the number of ’s those are smaller than ’s in independent random samples and . Find .
Solution
Definition. counts the pairs in which a is smaller than an :
Expectation. Each indicator has the same expectation, . By linearity, where and are the distribution functions of and .
Under (same continuous distribution). by symmetry (ties have probability 0). So
Example: if and , then , and .
✓ Proof checked step by step Every step was checked: U is a sum of indicators, and each indicator has expectation P(Y < X).
The following is a random sample of 10 numbers lying between : 0·22 0·90 0·96 0·78 0·66 0·18 0·73 0·58 0·11 0·97 We wish to test the hypothesis : sample comes from uniform distribution on . Explain, how you will use Kolmogorov-Smirnov test of goodness of fit for . Obtain the value of test statistic.
Solution
Method.
- : the data come from , so for .
- Order the sample, and compare the empirical distribution function with at each observation, from both sides:
- Reject at level if (from the KS table: ).
Computation.
| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | |
|---|---|---|---|---|---|---|---|---|---|---|
| 0.11 | 0.18 | 0.22 | 0.58 | 0.66 | 0.73 | 0.78 | 0.90 | 0.96 | 0.97 | |
| −0.01 | 0.02 | 0.08 | −0.18 | −0.16 | −0.13 | −0.08 | −0.10 | −0.06 | 0.03 | |
| 0.11 | 0.08 | 0.02 | 0.28 | 0.26 | 0.23 | 0.18 | 0.20 | 0.16 | 0.07 |
Decision. . We do not reject : the sample is consistent with the uniform distribution on .
✓ Checked by computer We computed D⁺ = 0.08 and D⁻ = 0.28 in Python. SciPy agrees (D = 0.28, p = 0.35), and the exact 5% critical value for n = 10 is 0.409.
Explain run test. The following arrangement of defective (d) and non-defective (n) pieces produced in the given order by a certain machine was observed nnnnn dddd nnnnnnnnnn dd nn dddd n dd nn Test for randomness at 0.01 level of significance. (Area under standard normal curve from 0 to 2.575 is 0.495)
Solution
Run test. A run is a maximal block of identical symbols. For a sequence of symbols of one kind and of the other, too few runs suggest clustering (trend), and too many suggest alternation. Under randomness, the number of runs has and for large samples is approximately .
The data. nnnnn | dddd | nnnnnnnnnn | dd | nn | dddd | n | dd | nn.
Computation.
Decision. At the 1% level (two-sided), the critical value is . , so we reject randomness. There are too few runs: defectives tend to come in clusters, which suggests the machine goes out of adjustment for spells.
(With a continuity correction, , just inside the acceptance region. The result is borderline at 1%, but clearly significant at 5%.)
✓ Checked by computer We counted the sequence in Python: 20 n’s, 12 d’s and 9 runs; E(R) = 16, V(R) = 6.774, Z = −2.69 (−2.50 with a continuity correction).
Describe Wilcoxon signed-rank test and derive the approximate distribution of the test statistic.
Solution
The test. (or paired differences ) come from a continuous distribution symmetric about . To test :
- Form , and drop any zeros.
- Rank from 1 to (average ranks for ties).
- = sum of the ranks of the positive ; .
- Reject for large (if ), small (if ), or either extreme (two-sided). Exact critical values come from tables.
Null distribution. Under , by symmetry, the sign of each is independent of , and is or with probability each. So where if the observation with rank is positive, and the are i.i.d. Bernoulli.
Mean and variance.
Approximate distribution. is a sum of independent, bounded terms , none of which dominates: . By the Lyapunov (or Lindeberg) central limit theorem, For above about 20, reject if (two-sided). With tied , subtract from the variance.
(The distribution of under is symmetric about , which helps the normal approximation.)
✓ Derivation checked step by step Every step was checked: the null representation of T⁺ as a sum of independent terms, its mean and variance, and the Lyapunov CLT.
Indicate the use of Wald-Wolfowitz run test and state the test-statistic along with its mean and variance under the null hypothesis.
Solution
Use. The Wald–Wolfowitz run test is used:
- Two-sample problem: to test whether two independent samples come from the same continuous distribution, , against any difference (location, spread or shape).
- Randomness: to test whether a sequence of two kinds of symbols (H/T, defective/good, above/below the median) is in random order.
Two-sample version. Combine the ’s and ’s, arrange them in increasing order, and label each value or . The test statistic is If the distributions differ, values from the same sample cluster together, giving few runs. So reject if .
Null mean and variance (with ):
Large samples. and reject if . (For a test of randomness, use both tails.)
✓ Answer checked step by step Every formula was checked against the standard null distribution of the number of runs.
Let be i.i.d. random variables with p.d.f. having median . Show that for testing against alternatives , the sign test is uniformly most powerful.
Solution
Set-up. i.i.d. with density and median ; is otherwise unknown. Test against . Let
The sign test. Under , , so . The sign test rejects for large :
It is UMP. Fix any alternative density with median . Let .
Step 1: a least favourable null distribution. Construct a density with median 0 that has the same shape as on each side of 0: Then is a density with , so belongs to .
Step 2: the MP test of against . The likelihood ratio is which increases with , because . By the Neyman–Pearson lemma, the MP test of against rejects for large . With size under (where ), this is exactly the sign test .
Step 3: has level for all of . For every null distribution (median 0), , so .
Step 4: conclusion. Any level- test of the composite has . By Step 2, . This holds for every alternative , and does not depend on . So the sign test is UMP for against , among all tests of level for the nonparametric hypothesis.
✓ Proof checked step by step Every step was checked: the reduction to the signs, the MLR of the binomial in the number of positive signs, and the minimisation over F within the alternative.
Outline the Wilcoxon-Mann-Whitney test for the two-sample problem. Also, give the relevant large-sample test-statistic.
Solution
Problem. Independent samples from and from , both continuous. Test against a location shift (, , or one-sided).
Procedure.
- Rank all observations together (average ranks for ties).
- Wilcoxon rank sum: sum of the ranks of the ’s.
- Mann–Whitney: . The two forms are equivalent.
- Under , all rankings of the ’s are equally likely, so the distribution of is distribution-free and tabulated.
- Reject if is too large ( tends to be larger), too small, or either (two-sided).
Large-sample test. Under , and Reject if (two-sided), or for : stochastically larger. In terms of : , with the same variance.
Merits. The asymptotic relative efficiency against the -test is for normal data, never below 0.864, and can be much larger than 1 for heavy-tailed data.
✓ Answer checked step by step Every step was checked: the statistic, its relation to the rank sum, and the large-sample normal form with mean mn/2 and variance mn(m + n + 1)/12.
Discuss Wilcoxon-Mann-Whitney test and examine its consistency.
Solution
The test. As above: . Reject for large when testing against “ stochastically larger”. (The two-sided version rejects for large .)
Consistency. A test is consistent against an alternative if its power tends to 1 as .
Let . Under , .
Step 1: estimates . . Its variance is where and . This is . By Chebyshev’s inequality, .
Step 2: the critical value. Under , is approximately , so the critical value for is
Step 3: power. Under any alternative with , , while the critical value tends to . So
Conclusion. The Wilcoxon–Mann–Whitney test is consistent exactly against alternatives with (in the corresponding direction). This includes all location shifts, and all cases where is stochastically larger than . It is not consistent against alternatives with , such as two distributions with the same median but different spreads. For those, use the Kolmogorov–Smirnov or a scale test.
✓ Proof checked step by step Every step was checked: U/mn is an unbiased U-statistic for P(X < Y), its variance is O(1/min(m, n)), and Chebyshev’s inequality gives consistency.
Discuss Wilcoxon signed rank test, and examine its consistency.
Solution
The test. i.i.d. from a continuous distribution symmetric about . To test : rank , and let be the sum of the ranks of the positive . Reject for large (against ), small (against ), or either.
Under : and . The distribution is exact and tabulated for small , and approximately normal for large .
Consistency. Write in terms of Walsh averages: (Indeed, the rank of among those with counts the with , which is exactly the number of with and .)
Dividing by : because the second term is a U-statistic, with variance .
- Under (symmetry about 0), , and the critical value of tends to .
- Under an alternative with (for example, a shift of a symmetric distribution), , so the power tends to 1.
Conclusion. The Wilcoxon signed-rank test is consistent against all alternatives with , in particular against all location shifts of a symmetric distribution. It is not consistent against alternatives with .
✓ Proof checked step by step Every step was checked: T⁺ is a linear combination of U-statistics estimating P(X₁ + X₂ > 0), with null value ½, and the variance of the normalised statistic tends to 0.
An unbiased coin is tossed 30 times and the following sequence of heads (H) and tails (T) is observed: HHHTTTHHTTTHHHTTHHHTTTTHHTHHT Find out the number of runs (r). Also find the mean .
Solution
Note on the question. The printed sequence has 29 symbols, not 30. We work with the sequence as printed.
Runs. HHH | TTT | HH | TTT | HHH | TT | HHH | TTTT | HH | T | HH | T
Mean number of runs. Under randomness, given and ,
(For tosses of a fair coin without conditioning on the numbers of heads and tails, each of the adjacent pairs starts a new run with probability , so : 15 for , and 15.5 for .)
The observed 12 runs is somewhat below the expected 15.5. With , , which is not significant at 5%.
✓ Checked by computer We counted the sequence in Python: it has 29 symbols (15 H, 14 T) and 12 runs; E(r) = 15.48.
What are the advantages and disadvantages of non-parametric inference procedures over corresponding parametric procedures?
Solution
Advantages of non-parametric procedures.
- Few assumptions. They do not assume a particular distribution (such as the normal). Usually only continuity, or symmetry, is needed.
- Distribution-free. The null distribution of the test statistic is the same for every continuous population, so significance levels are exact.
- Robust. Being based on ranks or signs, they are not affected much by outliers or heavy tails.
- Ordinal data. They can be used with ranks, grades or preferences, where only order is meaningful.
- Small samples. Exact tests are available even for very small samples.
- Simple. The calculations are easy and the ideas intuitive.
- Efficiency. Some are nearly as efficient as parametric tests even for normal data (Wilcoxon: 0.955), and far more efficient for heavy-tailed data.
Disadvantages.
- Waste of information when the parametric assumptions do hold: the sign test has efficiency only 0.637 against the -test for normal data.
- Less power for the same sample size when the data really are normal.
- Hypotheses are less specific. They test equality of distributions or medians, not specific parameters, and estimates (such as of effect size) are less natural.
- Tables. Exact null distributions need special tables, which differ for each test and sample size.
- Ties in discrete data complicate the exact distributions.
- Fewer methods for complex designs (interactions, multiple regression).
✓ Answer checked step by step Every point was checked against the standard comparison of parametric and non-parametric methods.
Develop the Mann-Whitney-Wilcoxon test and obtain the mean and variance of the test statistic. How is the test carried out for large samples?
Solution
The test statistic. Samples from and from , continuous. Test . Define (Equivalently, , where is the rank sum of the ’s in the combined sample.) Large suggests tends to exceed .
Mean under . , so
Variance under .
- , with such terms.
- Same , different ’s: , so the covariance is . There are such ordered pairs.
- Same , different ’s: also , with ordered pairs.
- No index in common: the covariance is 0.
Small samples. Under , all arrangements are equally likely, which gives the exact distribution of . Reject if (one-sided), or if is in either tail (two-sided).
Large samples. Reject if , or for the one-sided alternative. (A continuity correction of and a tie correction to the variance can be added.)
✓ Derivation checked step by step Every step was checked: the indicator representation, E(U) = mn/2, and the variance from the covariances of the indicators (1/3 − 1/4 = 1/12).
Let and be independent random samples from the continuous distribution functions and , respectively, where F is unknown. It is required to test . Write down the median test statistic T and its asymptotic distribution under .
Solution
Note on the question. “” should read (no shift).
Median test statistic. Let , and let be the median of the combined sample. Define Let be the total number of observations above ( for even , and for odd ).
Exact null distribution. Under , all ways of choosing which observations are the ’s are equally likely. So, given , is hypergeometric:
Asymptotic distribution. For even (): and . As with , Equivalently, is the statistic of the table (above or below , by sample), approximately .
Test. For (’s shifted up), fewer ’s lie above , so reject if . Two-sided: .
✓ Derivation checked step by step Every step was checked: the conditional hypergeometric distribution of T given the combined median, and its normal limit.
Describe Kolmogorov-Smirnov test of goodness of fit, stating necessary assumptions, for both one-sided and two-sided alternatives.
Solution
Purpose. To test whether a random sample comes from a completely specified continuous distribution .
Assumptions.
- are i.i.d. (a random sample).
- The population distribution is continuous.
- is completely specified, with no parameters estimated from the data. (If parameters are estimated, the standard tables are conservative, and adjusted tables such as Lilliefors’ are needed.)
Empirical distribution function.
Two-sided test. for all , against for some . Reject if (from tables). For large , and .
One-sided tests.
- for some (the data are stochastically smaller): use
- for some (stochastically larger): use Reject for large values. and have the same null distribution, and for large , so (for example at 5%).
Properties. The statistics are distribution-free (by the probability integral transform). The test is exact for all , consistent against every alternative, and can be inverted into a confidence band for the whole distribution function.
✓ Answer checked step by step Every point was checked: the statistics, the assumptions, and the one-sided limit 1 − e^(−2λ²) and two-sided Kolmogorov limit.
Explain the main difference between the parametric and non-parametric approaches to the theory of statistical inference. Specify the underlying assumptions and the null hypothesis in median, sign and U tests.
Solution
Parametric vs non-parametric inference.
- Parametric: the population is assumed to belong to a family indexed by a few parameters (for example, normal with mean and variance ). Inference is about those parameters, and the tests (, , ) depend on the assumed form.
- Non-parametric (distribution-free): no specific form is assumed, only general conditions such as continuity or symmetry. Hypotheses concern the whole distribution or its median and other quantiles, and tests use signs, ranks or counts. Their null distributions do not depend on the unknown population.
The main difference is the amount of assumption about the population form. Parametric methods are more efficient when their assumptions hold. Non-parametric methods are valid much more generally.
| Test | Assumptions | Null hypothesis |
|---|---|---|
| Sign test | i.i.d. (or independent pairs) from a continuous distribution | , the median equals a given value (paired data: median difference = 0), so |
| Median test | two (or more) independent random samples from continuous distributions | : the populations have the same median (often ) |
| Mann–Whitney -test | two independent random samples, continuous distributions, at least ordinal measurement; often a shift model | (identical populations); against shift alternatives, |
✓ Answer checked step by step Every point was checked against the standard assumptions and null hypotheses of the median, sign and Mann–Whitney tests.
Describe chi-square and Kolmogorov test for goodness of fit and compare.
Solution
test of goodness of fit. Group the observations into classes with observed frequencies . Under the class probabilities are , and the expected frequencies are . where is the number of parameters estimated. Reject if . It needs large and .
Kolmogorov (Kolmogorov–Smirnov) test. For a completely specified continuous , with empirical distribution function , Reject if . The null distribution is exact and distribution-free, and for large , has the Kolmogorov limiting distribution ().
Comparison.
| Kolmogorov | ||
|---|---|---|
| Data used | grouped frequencies (information lost) | each observation |
| Distribution type | any (discrete or continuous) | continuous |
| Sample size | large only | any (exact tables) |
| Null distribution | approximate | exact, distribution-free |
| Parameters estimated | allowed (reduce df) | tables invalid; need modified versions |
| Arbitrary choices | number and width of classes | none |
| One-sided alternatives | not available | , |
| Power for continuous data | lower | generally higher |
| Other uses | contingency tables, categorical data | confidence band for ; two-sample version |
In short: for a fully specified continuous distribution, especially with small samples, the Kolmogorov test is better. For discrete or categorical data, or when parameters must be estimated, the test is more convenient.
✓ Answer checked step by step Every point was checked against the standard forms of the two tests.
Describe the Sign test for testing the location of a probability distribution. What is its parametric counterpart?
Solution
Problem. are i.i.d. from a continuous distribution with median . Test .
Procedure.
- Replace each observation by the sign of . Discard any zeros, and reduce accordingly.
- Let = number of signs. Under , , so whatever the population distribution.
- Reject :
- against : if , with ;
- against : if ;
- against : if or , each tail .
- Large : (with a continuity correction of ).
The same test applies to paired data, using the signs of the differences, with : median difference .
Parametric counterpart. The one-sample -test (or the -test if is known), of , which assumes normality: For paired data, it is the paired -test.
Comparison. The sign test needs no normality, is unaffected by outliers, and is exact for any . But it uses only signs, so for normal data its efficiency relative to the -test is only . For heavy-tailed data (for example, Laplace) it is more efficient than the -test.
✓ Answer checked step by step Every point was checked: the null distribution B(n, ½), the one- and two-sided rejection rules, and the comparison with the t-test.
Describe the Kolmogorov test for goodness of fit. Compare this test with the chi-square test for goodness of fit.
Solution
Kolmogorov test. is a random sample from a continuous distribution . Test against .
- Order the sample and form the empirical distribution function .
- Compute
- Reject if (Kolmogorov–Smirnov table). For large , .
The distribution of under does not depend on (probability integral transform). Kolmogorov showed that
Comparison with the test.
- Data: Kolmogorov uses each observation; uses grouped counts, losing information.
- Sample size: Kolmogorov is exact for any ; is a large-sample test needing .
- Distribution type: Kolmogorov is for continuous (conservative for discrete); handles discrete and categorical data.
- Parameters: allows estimated parameters by reducing the degrees of freedom; the Kolmogorov tables then do not apply.
- Arbitrariness: the result depends on the choice of classes; Kolmogorov has no such choice.
- Power: for continuous data, the Kolmogorov test is usually more powerful, especially in small samples.
- Extras: Kolmogorov gives one-sided versions and a confidence band for .
✓ Answer checked step by step Every point was checked against the standard form of the Kolmogorov test and its comparison with the χ² test.
Obtain a confidence interval for the population median based on the sign test.
Solution
Set-up. from a continuous distribution with median , ordered as . Let .
Key fact. lies between and unless fewer than observations fall below , or fewer than fall above it. The number below is . So This is the set of values that the two-sided sign test would accept.
Confidence interval. Choose as the largest integer with Then is a confidence interval for the population median with confidence coefficient at least . It is distribution-free. (Because is discrete, the exact level is usually a little above .)
Large . Use , rounded down.
Example (, ): , but . So , and is a 97.9% interval for the median.
✓ Proof checked step by step Every step was checked: inverting the two-sided sign test gives order-statistic limits with binomial coverage. We also checked n = 10 by simulation (coverage 0.979 for the 2nd and 9th order statistics).
What is the one-sample problem concerning the location of a probability distribution? State the classical normal theory test for this problem. Describe a non-parametric version of this test and consider both one sided and two-sided alternatives.
Solution
The one-sample location problem. Given a random sample from a population with location parameter (mean or median), test whether equals a specified value : Paired comparisons (before/after) reduce to this problem through the differences.
Classical normal-theory test. Assume , unknown. The one-sample -test:
- : reject if .
- : reject if .
- : reject if . (If is known, use .) It is UMPU under normality, but sensitive to outliers and heavy tails in small samples.
Non-parametric versions.
(a) Sign test (only continuity assumed). = number of , with under ( = median).
- : reject if , where .
- : reject if .
- : reject if or .
- Large : .
(b) Wilcoxon signed-rank test (continuity and symmetry about ). Rank ; let be the sum of ranks of the positive differences. Under : , .
- : reject if .
- : reject if .
- : reject in either tail at .
- Large : .
Comparison. For normal data, the efficiency relative to the -test is 0.955 for the signed-rank test and 0.637 for the sign test. For heavy-tailed data both can beat the -test. The signed-rank test is usually the best non-parametric replacement for the one-sample -test.
✓ Answer checked step by step Every step was checked: the t-test and the sign and signed-rank tests, with their assumptions and rejection regions in each direction.
If and , , are order statistics for a random sample of size n from a continuous distribution, then show that is a confidence interval for the population quantile of order p, with confidence coefficient where is the incomplete beta function.
Solution
Set-up. is the population quantile of order : , with continuous.
Coverage. Since , and the two events on the right are disjoint. So
Distribution of an order statistic. exactly when at least observations are . Each observation is with probability , independently, so
Link with the incomplete beta function. The standard identity is (Both sides are the probability that the -th smallest of uniform variables is at most . The right side is the Beta distribution function of .)
So , and similarly (continuity makes and the same).
Result. So is a confidence interval for with this confidence coefficient, which does not depend on .
Example: , , , : .
✓ Proof checked step by step Every step was checked: the event decomposition, the distribution of the r-th order statistic of uniform variables, and the incomplete-beta identity. A simulation (n = 10, p = 0.5, r = 2, s = 9) gave coverage 0.979, matching the formula.
More on Statistical Inference
- All Statistics PYQ solutions, topic by topic
- Statistical Inference topic-wise PYQs (questions only, for practice)
- Statistics PYQ analysis: which units carry the marks year by year
- Year-wise question papers
- Statistics booklist
Questions: UPSC Civil Services (Main) Examination, Statistics Paper I, 1995–2026. Solutions: Optional Province. Found an error? Tell us.

