All 24 questions UPSC has asked on Mahalanobis’s D² and Hotelling’s T² in the Statistics Optional (Paper I, Linear Inference and Multivariate Analysis) from 1995 to 2026, solved step by step – latest first.
Try them yourself first: the same questions, without solutions, are on our Linear Inference and Multivariate Analysis 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 · 6b 2024 · 5c 2022 · 7b 2020 · 6c 2020 · 7a 2019 · 6c 2018 · 8b 2017 · 7b 2016 · 5e 2016 · 8b 2015 · 5a 2014 · 5b 2014 · 7b 2013 · 6b 2013 · 7b 2012 · 7b 2005 · 6c 2002 · 5f 2000 · 6b(ii) 1999 · 12b 1998 · 12a 1997 · 12a 1996 · 12a 1995 · 12a
Let be a random sample from . Show that Hotelling’s -statistic for testing against is a generalization of -statistic for testing against in the univariate case. Calculate -statistic for testing on the basis of the data taken from a bivariate normal distribution given below:
Solution
generalises . In the univariate case, with from , For variables, replace the scalar deviation by the vector and the scalar by the unbiased sample covariance matrix : For , and , and the statement reduces to . Moreover, is the largest value of over all linear combinations : so it is the natural multivariate extension of Student’s .
Calculation. , . Deviations: , , . So , so .
With :
Decision. on df. This is far below (and even ), so we do not reject . With only 3 observations the test has very little power.
✓ Checked by computer We checked in Python: x̄ = (8, 6), S = [[4, −3], [−3, 9]], T² = 7/9 = 0.778 and F = 0.194, far below the upper 10% and 5% points of F(2, 1).
and are independent data sets of order and respectively from . Show that is distributed as , where , and and represent the Hotelling’s and Mahalanobis respectively.
Solution
Set-up. The rows of () and () are independent , so both samples come from the same population. Let be the sample mean vectors and The sample Mahalanobis distance is
Recall. If and are independent, then has the Hotelling distribution, with
Step 1 (numerator). and independently, so Hence
Step 2 (denominator). , independently, so by the additive property of the Wishart distribution
Step 3 (independence). Within each normal sample the mean vector is independent of the matrix of sums of squares and products, and the two samples are independent. So (a function of ) is independent of .
Conclusion. and equivalently This is the statistic for testing the equality of two mean vectors.
✓ Proof checked step by step We checked the proof: the distribution of the difference of the two sample means, the Wishart distribution of the pooled sums of squares and products, and their independence.
(i) The data matrix of a random sample of size from a bivariate normal population is Test the null hypothesis against , where , at 10% level of significance. [You are given: ] (ii) Suppose and , observations are made on two random vectors and which are assumed to have bivariate normal distribution with a common covariance matrix , but possibly different mean vectors and . The sample mean vectors and pooled covariance matrix are Obtain Mahalanobis sample distance and Fisher’s linear discriminant function. Assign the observation to either population or .
Solution
(i) One-sample test. , . Deviations: , , : With : Since , we do not reject at the 10% level.
(ii) Mahalanobis distance. . With ,
Fisher’s linear discriminant function. Its values at the two means are and , with midpoint Rule (equal priors and costs): assign to if , and to otherwise.
Classification of . . So is assigned to .
✓ Checked by computer We checked in Python: (i) T² = 0.25 and F = 0.0625 < 49.5; (ii) the discriminant coefficients (−0.5, −0.5), D² = 2.5, the midpoint −0.25 and the score −0.5 of x₀.
Let , , , where : weight (in kg), : height (in cm) of infant. Sample data matrix Test at 5% level of significance the null hypothesis . [Given that: ].
Solution
Data. The columns of the given matrix are the infants; .
Sample covariance matrix (divisor ). Deviations : , , , .
. With :
Test. Since , we do not reject : the data are consistent with mean weight 3.0 kg and mean height 35.0 cm.
✓ Checked by computer We checked in Python: x̄ = (3.25, 36.25), S = [[0.25, 1.25], [1.25, 22.917]], T² = 1 and F = 1/3 < 19.
Define Hotelling’s-. Show that statistic is a function of likelihood ratio criteria.
Solution
Definition. Let be a random sample from , with and , . For testing , Hotelling’s is and under , .
Likelihood ratio. The likelihood is For fixed , it is maximised at , and then
- Under (unrestricted): , .
- Under : , .
So
Link with . For a non-singular matrix and a vector , . With : Therefore is a decreasing function of , so the likelihood ratio test “reject when is small” is the same as “reject when is large”. The test is the likelihood ratio test.
✓ Proof checked step by step We checked the derivation: the maximised likelihoods under H₀ and H₁, and the determinant identity that turns the likelihood ratio into a function of T².
Consider two independent i.i.d samples, each of size 10, from two bivariate normal populations. The results are summarised below. where , are sample covariance matrices and , are sample means. Provide suitable tests for the following hypotheses at level and draw your conclusion. (i) (ii) (iii) , where (You can use the following values: , , )
Solution
Note on the question. The supplied table values do not all match the natural degrees of freedom: test (i) uses the first sample only, so its has df, and (iii) has df ( with the pooled matrix). We use the correct degrees of freedom (, ) and note that the conclusions do not change with the values given.
Here and .
(i) . One-sample from sample 1. With , and : , so we do not reject .
(ii) (assuming a common covariance matrix). The pooled matrix is , so (), so we reject : the two mean vectors differ, mainly in the first component.
(iii) . This is a hypothesis about one linear combination with , so a univariate test applies. and : (and , the value supplied), so we do not reject . Using the pooled matrix instead (, 18 df) gives , with the same conclusion.
✓ Checked by computer We checked in Python: (i) T² = 0.714 (F = 0.32); (ii) T² = 8.89, F = 4.20 > 3.59; (iii) t² = 1.25 with S₁ (1.11 with the pooled matrix). Each conclusion is the same under either choice of covariance estimate.
Show that Hotelling’s is a generalization of the Student’s . Prove the invariance property of under the non-singular linear transformations of the variables. Briefly mention different uses of .
Solution
Generalisation of . For a univariate sample from , Student’s statistic for is For a sample from , Hotelling’s statistic is
- When , and ; the result becomes .
- For any fixed , the univariate for is . By the Cauchy–Schwarz inequality, reached at . So is the largest squared over all linear combinations of the variables.
Invariance under non-singular linear transformations. Let with a non-singular matrix. The hypothesis becomes . Then so So does not change under a change of origin, a change of scale of any variable, or any non-singular linear combination of the variables. In particular the test does not depend on the units of measurement.
Uses of .
- Testing for one multivariate normal population.
- Testing the equality of two mean vectors with a common covariance matrix: .
- Paired multivariate comparisons (applied to the differences).
- Testing a linear hypothesis , for example the equality of the components of (profile analysis, repeated measures).
- Simultaneous confidence intervals for all linear combinations , and confidence ellipsoids for .
- Testing the significance of Fisher’s discriminant function, via its relation .
- Multivariate quality control charts.
✓ Proof checked step by step We checked the reduction of T² to t² for p = 1 and the invariance proof: under y = Cx + d both the mean deviation and S transform so that C cancels.
Suppose and observations are made on two random vectors and which are assumed to have bivariate normal distribution with a common covariance matrix , but possibly different mean vectors and . The sample mean vectors and pooled covariance matrix are Obtain Mahalanobis sample distance and Fisher’s linear discriminant function. Assign the observation to either population or .
Solution
Mahalanobis distance. . and
Fisher’s linear discriminant function. Scores of the means: and ; midpoint Rule (equal priors and equal costs): allocate to if , otherwise to .
Allocation of . , so is assigned to .
(The separation is significant: , .)
✓ Checked by computer We checked in Python: S⁻¹(x̄₁ − x̄₂) = (−0.5, −0.5), D² = 2.5, the midpoint is −0.25, and the score of x₀ is −0.5, so x₀ goes to π₂.
The data matrix for a random sample of size from a bivariate normal population is Test the null hypothesis against , where , at 10% level of significance. [You are given: , ].
Solution
Sample mean and covariance. , . Deviations: , , . So
. With :
Test. , so we do not reject at the 10% level. (The value is not needed.)
✓ Checked by computer We checked in Python: x̄ = (8, 19/3), T² = 0.64 and F = 0.16 < 49.5.
If and be independent data matrices of order and respectively and if the rows of be identically and independently distributed as , then for and , show that denotes sample Mahalanobis distance statistic.
Solution
Note. This is the same result as Q2; we give the proof with the notation of this question.
Set-up. Rows of are iid , , and we assume and . Let
Step 1. , so
Step 2. independently, so .
Step 3. is independent of for normal samples, and the samples are independent, so and are independent.
Step 4. By the definition of Hotelling’s (a vector and an independent matrix give ):
Hence , which is the test of .
✓ Proof checked step by step We checked the proof, which uses the distribution of the difference of the means, the additivity of independent Wishart matrices and the independence of the mean and the sums of squares in normal samples.
A random sample of size 4 from a bivariate normal population provides the following statistics where is the sample mean and is an unbiased estimator of the population dispersion matrix. Test the hypothesis where is the population mean vector.
Solution
Calculation. , , . , so
Test. Since , we do not reject at the 5% level.
✓ Checked by computer We checked in Python: T² = 1.43, F = 0.476 < 19.
If and denote two bivariate normal populations where and , , and . Compute the Mahalonobis distance between and .
Solution
Definition. For two populations with a common dispersion matrix , the (squared) Mahalanobis distance is
Calculation. . , and So and .
(The means differ only in the second character, by 10, whose variance is 32; ignoring the correlation would give . The correlation with the first character, whose means are equal, increases the effective separation.)
✓ Checked by computer We checked in Python: (μ₁ − μ₂)′Σ⁻¹(μ₁ − μ₂) = 4.167.
Define Hotelling . State any one of its applications. A random sample of size 3 from a bivariate normal distribution gave following unbiased estimates of and Compute -statistic to test the hypothesis .
Solution
Definition. For a random sample of size from , with mean and unbiased covariance matrix , Hotelling’s statistic for is
One application. Testing whether two multivariate normal populations with a common covariance matrix have the same mean vector, with . Other uses are confidence regions for and testing the significance of a discriminant function.
Calculation. , , . and
The corresponding on df is far below , so is not rejected.
✓ Checked by computer We checked in Python: T² = 7/9 = 0.778, F = 0.194.
Let be a random sample from where and are unknown. Show that for testing against : not all ’s are equal, the test statistic can be expressed as where and are the sample mean vector and the unbiased estimator of respectively and . What would be the non null distribution of ?
Solution
Note on the question. In the printed formula “” stands for , the inverse of the unbiased estimator of . We show
Reduction to a problem. means , where is any matrix of rank with (for example rows , , …). Then , and the statistic for is It does not depend on which is chosen: any other choice is with non-singular, and cancels.
Algebraic form. Let be a square root of and put , , . Then is the projection onto the row space of . Since and has rank , that space is the orthogonal complement of . Hence Therefore
Null distribution. and , independently. So and
Non-null distribution. When the are not all equal, the same ratio has the non-central distribution The non-centrality is zero exactly when is a multiple of , that is, under .
✓ Derivation checked step by step Every step was checked: the reduction to a T² test for the contrast vector Cμ = 0, its expression through S⁻¹ and ε, and the non-central F distribution.
Define Mahalanobis measure of distance squared between two populations with a common positive definite dispersion matrix and show that it is a non decreasing function of the number of characteristics.
Solution
Definition. For populations and with a common positive definite , the squared Mahalanobis distance is It measures the separation of the means in units that allow for the variances and correlations of the characters. It is invariant under non-singular linear transformations, and equals when .
Claim. If more characters are added, cannot decrease.
Proof. Suppose we add characters to the original . Partition with belonging to the first characters. Write , which is positive definite. The partitioned inverse gives Hence The first term is . The second is a positive definite quadratic form, so it is . Therefore with equality if and only if .
Interpretation. is the difference in the means of the new characters after allowing for their regression on the old ones. A new character adds nothing to the distance only when its mean difference is fully predicted by the characters already used. This is also why, in practice, one tests whether added characters contribute significantly rather than simply adding characters (with estimated , a useless character can still raise by chance).
✓ Proof checked step by step We checked the proof, and checked numerically for a 3-variable example that Δ² increases from 0.50 to 0.53 to 0.62 as characters are added.
Bring out the relation between Hotelling’s and Mahalanobis . Explain how can be interpreted as an extension of the student’s statistic. Describe the utility of Fisher’s discriminent function in classification problems.
Solution
Relation between and . For samples of sizes from and , the sample Mahalanobis distance is with the pooled unbiased covariance matrix. The two-sample Hotelling statistic for is So measures the distance between the samples, and turns it into a test statistic by allowing for the sample sizes. (In the one-sample case, with .)
as an extension of Student’s .
- With one variable, the two-sample is , so . has exactly this form, with vectors and matrices in place of scalars. For it reduces to , and its distribution reduces to .
- is the maximum of the squared statistics over all linear combinations of the variables. So it tests all such comparisons at once while controlling the overall level.
- Like , it is the likelihood ratio test and is invariant under changes of scale (indeed, under any non-singular linear transformation).
Fisher’s discriminant function in classification. Fisher looked for the linear combination that separates the two groups best, in the sense of maximising The maximum is reached at and its maximum value is . To classify a new individual :
- compute and the midpoint ;
- assign to if and to otherwise (with unequal priors or costs, compare with instead).
For normal populations with a common covariance matrix this is the optimal (Bayes) rule. Its expected error rate is , so a larger Mahalanobis distance means better classification. It also reduces measurements to a single score, and shows (through the size of the coefficients for standardised variables) which characters matter most. Uses include taxonomy, medical diagnosis, credit scoring and anthropometric classification.
✓ Answer checked step by step Every step was checked: the relation T² = n₁n₂D²/(n₁ + n₂), the reduction of T² to Student’s t when p = 1, and the discriminant rule.
In order to test the equality of mean vectors of define Hotelling’s -statistic and sketch the derivation of its null distribution.
Solution
Statistic. Samples of sizes from and . Let be the means, the matrices of sums of squares and products, and To test ,
Null distribution: sketch. Write .
Step 1. Under , , and , independent of . So .
Step 2 (reduce to the identity). is invariant under , , so we may take .
Step 3 (condition on ). Given , choose an orthogonal matrix with first row . Then , still independent of , and where is the residual of after regression on the other coordinates.
Step 4 (two independent chi-squares). A standard property of the Wishart distribution is that , whatever is, so it is independent of . Also .
Step 5. Hence With :
We reject at level when this exceeds . Under the same ratio has a non-central distribution with non-centrality , where .
✓ Derivation checked step by step Every step was checked: the definition of the two-sample T², the normal and Wishart components, their independence, and the route from T² to the F distribution.
Define Mahalanobis . Show that it is invariant under any non-singular linear transformation.
Solution
Definition. For two populations with means and common dispersion matrix , the Mahalanobis distance is Its sample version, from samples of sizes , is with the pooled unbiased covariance matrix. It generalises to characters, allowing for their different variances and their correlations.
Invariance. Let , with a non-singular matrix, applied to every observation in both samples. Then So The same algebra applies to , with .
Consequences. does not depend on the units of measurement (kg or g, cm or inch), on the origin, or on which non-singular linear combinations of the characters are used. Euclidean distance has none of these properties.
✓ Proof checked step by step We checked the proof: under y = Cx + d the mean difference becomes C(x̄₁ − x̄₂) and the covariance matrix becomes CSC′, so C cancels.
Let unknown and . Suggest a test for against : all s are not equal.
Solution
Idea. is the hypothesis for a contrast matrix , for example So we transform each observation to the differences and test whether their mean vector is zero.
Test. With a sample (), mean and unbiased covariance matrix :
- , with mean and covariance .
- The Hotelling statistic is
- Under ,
- Reject at level if .
Remarks.
- The statistic does not depend on which contrast matrix is used, as long as its rows span the contrasts; it can also be written as (see Q14).
- This is the likelihood ratio test of , and it makes no assumption about the form of . (If has the special “compound symmetric” form, the ordinary repeated-measures ANOVA can be used instead.)
- A typical use is repeated measurements on the same individuals, such as the same test given at times, or treatments on each subject (profile analysis).
✓ Derivation checked step by step Every step was checked: the contrast transformation, the T² statistic on p − 1 variables and its F distribution.
Define Hotelling’s . Show that it is invariant under non-singular linear transformations. Mention some uses of the statistic.
Solution
Definition. For a random sample from with and unbiased , Hotelling’s for is More generally, if and independently, is said to have Hotelling’s distribution, and .
Invariance. Let with . The null hypothesis becomes , and Hence So is unchanged by any non-singular linear transformation (including changes of origin and of scale). Its distribution under depends on and only through , which is invariant too.
Uses of .
- Test of a specified mean vector, .
- Test of equality of two mean vectors (common ): .
- Paired comparisons of multivariate observations.
- Tests of linear hypotheses , such as equal means of the components or parallel profiles.
- Confidence ellipsoids for and simultaneous confidence intervals for all .
- Testing the significance of a discriminant function and of the Mahalanobis .
- Multivariate control charts in quality control.
✓ Proof checked step by step We checked the invariance proof: under y = Cx + d the mean deviation becomes C(x̄ − μ₀) and S becomes CSC′, and C cancels.
statistics is the generalization of t-statistic. Explain its relationship with -statistic. Explain the uses of statistic in test of hypothesis.
Solution
as a generalisation of . Student’s for one variable, , satisfies Hotelling’s statistic for variables, has the same form with the mean vector and covariance matrix in place of the scalars. For they coincide. is also the largest over all linear combinations , and just as .
Relationship with . The sample Mahalanobis distance between two samples is , with the pooled covariance matrix. The two-sample is So is a descriptive measure of how far apart two groups are, and is the test statistic built from it. Under ,
Uses of in testing hypotheses.
- One sample: , with on df.
- Two samples: with a common , as above.
- Paired samples: apply the one-sample test to the vector differences.
- Equality of components: through contrasts, on df.
- Significance of a discriminant function, and of the gain from extra characters in .
- Confidence regions: the ellipsoid and simultaneous intervals for all .
✓ Answer checked step by step Every step was checked: the reduction of T² to t² for one variable, the relation T² = n₁n₂D²/(n₁ + n₂), and the tests listed.
Let be a random sample of size N from , where is known. Develop a suitable test for testing the null hypothesis , where is a given vector.
Solution
Set-up. are iid with known. We test against .
Sufficient statistic. is sufficient for .
Likelihood ratio test. The unrestricted maximum is at , where the last term is zero. So and is the statistic Small means large .
Distribution. Let . Under , , so
Test. Reject at level if
Power. Under , , so has a non-central chi-square distribution with df and non-centrality The power increases with and with the Mahalanobis distance of from .
Remarks.
- For this is the usual test, .
- The acceptance region is the ellipsoid , a confidence region for .
- It is better than separate tests, because it allows for the correlations and keeps the overall level at .
- When is unknown, is replaced by and the test becomes Hotelling’s .
✓ Derivation checked step by step Every step was checked: the distribution of N(x̄ − μ₀)′Σ⁻¹(x̄ − μ₀), its derivation as the likelihood ratio test, and the non-central chi-square power function.
Define Mahalanobis’ distance between two populations as estimated from the sample on the basis of p characters. State how the -statistic is used to test the hypothesis of no difference in mean values of the p characters.
Solution
Population distance. For populations with mean vectors and a common dispersion matrix , Mahalanobis’ distance on characters is
Sample estimate. From independent samples of sizes with means and pooled within-sample covariance matrix the estimated distance is (Mahalanobis used it to measure the distance between Indian caste groups from anthropometric characters. overestimates on average: , with .)
Test of no difference in the mean values. To test , i.e. : This follows because is Hotelling’s two-sample . We reject at level when .
Testing extra characters. To test whether further characters add to the separation given by the first :
✓ Derivation checked step by step Every step was checked: the definition of D² from two samples and the F test of no difference in the mean values of the p characters.
Define Hotelling’s statistic and Mahalanobis’ statistic and state the relationship between the two. Describe the various uses of these statistics in test of hypotheses.
Solution
Hotelling’s . If and independently, . In practice, for a sample of size from , It is the multivariate analogue of Student’s .
Mahalanobis’ . For two samples from populations with a common dispersion matrix, with the pooled within-sample covariance matrix. It estimates the population distance .
Relationship. So describes the separation, while (and the corresponding ) tests whether it is real:
Uses in tests of hypotheses.
- for one population (one-sample ).
- for two populations (, equivalently ).
- Paired observations: the one-sample test on differences.
- , for example equality of the component means, or parallelism of two profiles.
- Significance of Fisher’s discriminant function. Its maximised separation is , so testing tests whether the discriminant function is useful.
- Whether additional characters increase the distance significantly ( against ).
- Simultaneous confidence intervals for linear functions or .
- Grouping populations by their pairwise values, as in Mahalanobis’ and Rao’s work on anthropometric and taxonomic classification.
✓ Answer checked step by step Every step was checked: the definitions of T² and D², the relation T² = n₁n₂D²/(n₁ + n₂) and the F forms of the tests.
More on Linear Inference and Multivariate Analysis
- All Statistics PYQ solutions, topic by topic
- Linear Inference and Multivariate Analysis 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.

