Skip to content
GATEiit

GATE CSE · Engineering Mathematics

Mean, median, mode and standard deviation

Measures of centre and spread for data and for distributions: mean, median and mode, variance and standard deviation, the effect of shifting and scaling, combined groups and outliers.

Before you start

  • Expectation and variance →

    The mean and variance of a distribution are E[X] and E[X2]−(E[X])2; the data formulas are the same idea with equal weights.

  • Sorting and summation

    Medians need sorted data, and variance shortcuts use ∑x and ∑x2.

Concept notes

1. The mean

The arithmetic mean of x1,…,xn is xˉ=1n∑i=1nxi. For a frequency table with values xi and frequencies fi: xˉ=∑fixi∑fi. For grouped data, use the class mid-points as xi.

Properties used in questions:

  • The deviations from the mean add to zero: ∑(xi−xˉ)=0.
  • ∑(xi−a)2 is smallest when a=xˉ; ∑∣xi−a∣ is smallest when a is the median.
  • Shift and scale: if yi=axi+b, then yˉ=axˉ+b.
  • Combined mean of two groups of sizes n1,n2 with means xˉ1,xˉ2: xˉ=n1xˉ1+n2xˉ2n1+n2.
  • Correcting an entry: the total is nxˉ. Replace the wrong value in the total and divide again.

A weighted mean ∑wixi∑wi is the same formula with weights in place of frequencies.

For a distribution, the mean is E[X]; for data, think of each value as having probability 1n.

The mean uses every value, so it is pulled strongly by extreme values (outliers).

2. Median and mode

The median is the middle value of the sorted data.

  • n odd: the (n+12)-th value.
  • n even: the average of the n2-th and (n2+1)-th values.

For a frequency table, find the first value at which the cumulative frequency reaches half of n.

For a continuous distribution with CDF F, the median m solves F(m)=12. For example, the exponential with rate λ has median ln⁡2λ.

The mode is the most frequent value (for a distribution, where the PMF or PDF is highest). Data can have no mode, one mode, or several (bimodal, multimodal).

Comparing the three:

Measure Uses Affected by outliers?
Mean every value strongly
Median the middle position hardly
Mode the most frequent value no

Shape: for a symmetric single-peaked distribution, mean = median = mode. For a right-skewed (long right tail) distribution, typically mode < median < mean; for left skew, the order reverses.

For moderately skewed data the empirical relation Mode≈3 Median−2 Mean is used when a question asks for it. It is an approximation, not an identity.

mode 1 median 1.68 mean 2 long right tail pulls the mean past the median
A right-skewed PDF, $f(x) = x e^{-x}$: mode $1$, median about $1.68$, mean $2$.

3. Variance and standard deviation

The variance measures spread about the mean. For a full population of N values, σ2=1N∑i=1N(xi−μ)2=1N∑xi2−μ2. The standard deviation σ is its square root and has the same units as the data.

For a sample of size n used to estimate the population variance, divide by n−1: s2=1n−1∑i=1n(xi−xˉ)2. GATE questions usually say which one they want; if not, read whether the data is "the population" or "a sample".

Shift and scale: if yi=axi+b, then σy=∣a∣ σx and σy2=a2σx2. Adding a constant changes nothing.

Combined variance of two groups (population formula): σ2=n1(σ12+d12)+n2(σ22+d22)n1+n2,di=xˉi−xˉ. Note the di2 terms: the spread between group means adds to the spread within groups.

Other measures of spread: the range (max − min), the mean absolute deviation 1n∑∣xi−xˉ∣, and the coefficient of variation σxˉ×100%, used to compare spread across data with different means.

Variance is 0 exactly when all values are equal.

4. Working method and quick checks

For a raw data question, build one small table and read everything from it.

  1. Sort the data. Read the median, the mode and the range at once.
  2. Find ∑xi, then xˉ.
  3. Find either ∑(xi−xˉ)2 (when xˉ is a whole number) or ∑xi2 (otherwise), then the variance.
  4. Divide by N for a population or by n−1 for a sample, as asked.

Quick checks:

  • The mean lies between the smallest and largest value.
  • The population standard deviation is never negative and never more than half the range.
  • If one value is changed, the median may not move at all, but the mean moves by changen.
  • Adding a constant c to every value adds c to the mean, median and mode, and leaves the variance, standard deviation and range unchanged.
  • Multiplying every value by k multiplies the mean, median and mode by k, the range and standard deviation by ∣k∣, and the variance by k2.

Standard results: the first n natural numbers have mean n+12 and population variance n2−112. An arithmetic progression with common difference d has population variance d2(n2−1)12.

Formulas to remember

Mean (frequency table)
xˉ=∑fixi∑fi
Combined mean
xˉ=n1xˉ1+n2xˉ2n1+n2
Population variance
σ2=1N∑(xi−μ)2=1N∑xi2−μ2
Sample variance
s2=1n−1∑(xi−xˉ)2
Shift and scale
y=ax+b⇒yˉ=axˉ+b,σy=∣a∣ σx
Combined variancedi=xˉi−xˉ
σ2=n1(σ12+d12)+n2(σ22+d22)n1+n2
Empirical relationModerately skewed data only
Mode≈3 Median−2 Mean
Variance of 1 to n
σ2=n2−112

Common mistakes

  • Finding the median without sorting the data first.
  • Dividing by n when the question asks for the sample variance (n − 1), or the reverse.
  • Letting a negative scale factor make the standard deviation negative; use |a|σ.
  • Adding the shift b to the standard deviation or variance; shifting changes only the centre.
  • Averaging two group means without weighting by group sizes, or forgetting the d² terms in the combined variance.
  • Treating Mode = 3 Median − 2 Mean as exact; it is an approximation for moderately skewed data.

Worked examples

Try each step yourself, then reveal the working.

Example 1: All four measures from raw data

numerical

For the data 2,4,4,5,7,9,11,14, find the mean, median, mode and population standard deviation.

  1. Step 1: Sort and read the median and mode.

    Try it on paper first.

Example 2: Effect of a linear change

numerical

A data set has mean 20 and standard deviation 4. Each value x is replaced by 3x−5. Find the new mean, standard deviation and variance.

  1. Step 1: Apply the rule for the mean.

    Try it on paper first.

Example 3: Combining two groups

numerical

Group A: 10 students, mean 50, variance 16. Group B: 15 students, mean 60, variance 25. Find the combined mean and variance.

  1. Step 1: Find the combined mean.

    Try it on paper first.

Example 4: What an outlier does

conceptual

The data 3,4,5,6,7 has mean and median 5. A value 100 is added. How do the mean and median change, and which better describes a typical value?

  1. Step 1: Recompute the mean.

    Try it on paper first.

Previous year questions

No official GATE CSE question is tagged with this topic yet. The topic test below uses practice questions.

Topic test

8 questions: 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 CSE syllabus; being checked by a reviewer. Updated 2026-11-21. Spotted a mistake? Use Report an issue on any question, or contact us.