Skip to content
GATEiit

GATE DA · Probability and Statistics

Mean, median, mode and standard deviation; correlation and covariance

Measures of centre (mean, median, mode) and spread (variance, standard deviation) for data and for random variables, plus covariance and the correlation coefficient and their properties under shifts and scaling.

Before you start

  • Expectation of a random variable →

    The population mean, variance and covariance are expectations.

  • Summation notation

    Every formula here is a sum over data points or over the values of a variable.

This topic comes before: Bias–variance trade-off, Central limit theorem, Clustering algorithms: k-means and k-medoid, Concept hierarchies; measures: categorization and computations, Confidence intervals; z-test, t-test and chi-squared test, Data types; data transformation: normalization, discretization, sampling and compression, Dimensionality reduction: principal component analysis (PCA), Linear discriminant analysis, Regression and classification problems

Concept notes

1. Measures of centre

For data x1,…,xn:

  • Mean xˉ=1n∑xi. Uses every value; pulled by outliers.
  • Median: the middle value after sorting. For even n, the average of the two middle values. Robust to outliers.
  • Mode: the most frequent value. There may be several (multimodal) or none useful.

For a random variable, the mean is E[X], a median is any m with P(X≤m)≥12 and P(X≥m)≥12 (for a continuous X, F(m)=12), and the mode is where the PMF or PDF is largest.

Skewness and order: for a right (positively) skewed distribution with one peak, typically mode<median<mean; for left skew the order reverses; for a symmetric one-peaked distribution all three coincide.

Example: 2,4,4,4,5,5,7,9 has mean 40/8=5, median (4+5)/2=4.5 and mode 4.

The mean minimises ∑(xi−c)2 and the median minimises ∑∣xi−c∣ over c.

2. Variance and standard deviation

Variance measures the spread about the mean; the standard deviation (SD) is its square root, in the original units.

Formula
Population (or random variable) σ2=1n∑(xi−xˉ)2,  Var(X)=E[(X−μ)2]=E[X2]−μ2
Sample (unbiased estimate) s2=1n−1∑(xi−xˉ)2

The n−1 (Bessel's correction) appears because deviations are measured from xˉ, not the true mean; read the question to see which is asked.

Linear transformation y=ax+b: yˉ=axˉ+b,σy=∣a∣ σx,Var(y)=a2 Var(x). Adding a constant shifts the centre but not the spread. Scaling multiplies the SD by ∣a∣.

Example: 2,4,4,4,5,5,7,9 has squared deviations adding to 32, so population variance 32/8=4 (SD 2) and sample variance 32/7≈4.57.

3. Covariance

Covariance measures how two variables move together: Cov(X,Y)=E[(X−μX)(Y−μY)]=E[XY]−E[X]E[Y]. For data, cov=1n∑(xi−xˉ)(yi−yˉ) (or divide by n−1 for the sample version).

Positive covariance: above-average x tends to go with above-average y. Negative: the opposite.

Properties:

  • Cov(X,X)=Var(X); Cov(X,Y)=Cov(Y,X).
  • Cov(aX+b,cY+d)=ac Cov(X,Y): shifts do not matter, scales multiply.
  • Bilinear: Cov(X+Z,Y)=Cov(X,Y)+Cov(Z,Y).
  • Var(aX+bY)=a2Var(X)+b2Var(Y)+2ab Cov(X,Y).
  • Independent ⇒ Cov=0, so Var(X±Y)=Var(X)+Var(Y). Note the plus sign for X−Y too.

For a random vector, the covariance matrix has Var(Xi) on the diagonal and Cov(Xi,Xj) off it; it is symmetric and positive semidefinite (this is the matrix PCA works with).

4. Correlation coefficient

Covariance depends on units. The Pearson correlation coefficient removes them: ρ=Cov(X,Y)σX σY,r=∑(xi−xˉ)(yi−yˉ)∑(xi−xˉ)2 ∑(yi−yˉ)2.

Properties:

  • −1≤ρ≤1 (Cauchy–Schwarz).
  • ∣ρ∣=1 exactly when Y=aX+b for some a≠0 (with probability 1); the sign of ρ is the sign of a.
  • ρ(aX+b,cY+d)=ρ(X,Y) if ac>0, and −ρ(X,Y) if ac<0.
  • ρ measures linear association only.

Zero correlation does not imply independence. If X is uniform on {−1,0,1} and Y=X2, then E[XY]=E[X3]=0=E[X]E[Y], so ρ=0, yet Y is a function of X. (For jointly normal variables, zero correlation does imply independence.)

In simple linear regression, the slope is β^=rsysx and r2 is the fraction of variance explained.

r close to +1r close to 0r close to −1
Scatter plots with strong positive, near-zero and strong negative correlation

Formulas to remember

Mean
xˉ=1n∑i=1nxi
Population variance
σ2=1n∑(xi−xˉ)2=x2‾−xˉ2
Sample variance
s2=1n−1∑(xi−xˉ)2
Variance shortcut
Var(X)=E[X2]−(E[X])2
Linear transform
Var(aX+b)=a2 Var(X)
Covariance
Cov(X,Y)=E[XY]−E[X] E[Y]
Variance of a combination
Var(aX+bY)=a2σX2+b2σY2+2ab Cov(X,Y)
Correlation coefficient−1≤ρ≤1
ρ=Cov(X,Y)σX σY

Common mistakes

  • Mixing up the population divisor n and the sample divisor n−1; read which one the question wants.
  • Writing Var(X−Y)=Var(X)−Var(Y); for independent variables it is the sum.
  • Concluding independence from zero correlation; correlation only detects linear association.
  • Forgetting to sort before taking the median, or not averaging the two middle values when n is even.
  • Applying a shift to the SD; only the scale factor ∣a∣ changes it.

Worked examples

Try each step yourself, then reveal the working.

Example 1: All the summaries of one data set

numerical

For the data 2,4,4,4,5,5,7,9 find the mean, median, mode, population variance and sample variance.

  1. Step 1: Find the centre measures.

    Try it on paper first.

Example 2: Rescaling marks

numerical

Marks in a test have mean 60 and SD 8. Every mark is converted by y=1.5x+10. Find the new mean, SD and variance.

  1. Step 1: Transform the mean.

    Try it on paper first.

Example 3: Covariance and correlation from data

numerical

Find the (population) covariance and the correlation coefficient of x=1,2,3,4,5 and y=2,4,5,4,5.

  1. Step 1: Find the means and deviations.

    Try it on paper first.

Example 4: Uncorrelated but dependent

conceptual

X is uniform on {−1,0,1} and Y=X2. Find Cov(X,Y). Are X and Y independent?

  1. Step 1: Compute the moments.

    Try it on paper first.

Previous year questions

7 official GATE DA questions on this topic, newest first.

Practise these 7 PYQs →

Topic test

10 questions: up to 4 official PYQs and original practice questions, with GATE marking (MCQ wrong answers lose marks). Score 60% or more to pass. A new set is drawn each time.

Mark as mastered

Loading your progress…

My revision notes

Notes written by the GATEiit team against the official GATE DA syllabus; being checked by a reviewer. Updated 2026-11-21. Spotted a mistake? Use Report an issue on any question, or contact us.