Central Tendency — Mean, Median, and Mode
3731 words
19 min read
Visual companion
Python
Type and operator map
Python Week 1: the first filter for runtime behavior
View
Revision summary
What this note is really saying
Short form
# Central Tendency — Mean, Median, and Mode ## 🎯 Learning Objectives After completing this topic, you will be able to: - Compute the **mean**, **median**, and **mode** for raw data and frequency distributions - Explain the **properties** and **limitations** of each measure - Choose the appropriate measure of centra...

Central Tendency — Mean, Median, and Mode
🎯 Learning Objectives
After completing this topic, you will be able to:
- Compute the mean, median, and mode for raw data and frequency distributions
- Explain the properties and limitations of each measure
- Choose the appropriate measure of central tendency based on data type and distribution shape
- Identify skewness and understand how it affects the mean vs. median
- Recognize outliers and their disproportionate effect on the mean
📋 Prerequisites
- Data Types & Scales (01-data-types-scales) — knowing which measures are valid for which scales
- Categorical Data (02-categorical-frequency) — familiarity with frequency tables
- Basic arithmetic: addition, division, ordering
📖 Core Content
4.1 Intuition: Finding the "Center" of Data
Imagine you have a list of 100 salaries at a company. You want to give someone a single number that represents a "typical" salary. What number do you choose?
There are three natural candidates:
- The average (mean): Add up all salaries and divide by 100
- The middle (median): Sort all salaries and pick the one in the middle
- The most common (mode): Find the salary that appears most frequently Each gives you a different kind of "typical" value. The interesting part is that they can tell very different stories — especially when the data is skewed (not symmetric).
Everyday analogy: At a party, people guess the "average" age. If there are 10 children (age 10), 10 adults (age 35), and 2 grandparents (age 70), the average is about 33, the median is between 10 and 35 (about 22), and the mode is 10 and 35 (two modes). Three different "typical" values, three different stories! 🔑 Key Insight: There's no single "correct" measure of central tendency. The right choice depends on your data and what you want to communicate.
4.2 The Mean (Arithmetic Average)
4.2.1 Intuition
The mean is what most people call "the average." It's the balance point of the data — if the data values were weights on a number line, the mean is where the fulcrum would balance them.
4.2.2 Formal Definition
Population mean (μ — "mu"):
Sample mean (x̄ — "x-bar"):
Where:
- xi = each individual value
- N = population size
- n = sample size
- ∑ = "sum of"
Notation alert: μ (mu) is a parameter (population). x̄ (x-bar) is a statistic (sample). The formula is the same — only the letter changes.
4.2.3 Worked Example
Scenario: Five students scored: 70, 85, 90, 65, 80. Find the mean.
Solution:
The mean score is 78.
4.2.4 Properties of the Mean
| Property | Explanation | Example |
|---|---|---|
| Every value affects it | The mean uses all data points | Changing any single value changes the mean |
| Sensitive to outliers | Extreme values pull the mean toward them | One salary of ₹50 lakhs can make a company's "average salary" look much higher |
| Balance point | Sum of deviations from mean = 0 | ∑(xi−xˉ)=0 |
| Unique | There's exactly one mean for a dataset | Unlike mode (there can be multiple) |
| Algebraic | Can be used in further calculations | The mean appears in variance, correlation, etc. |
4.2.5 The Weighted Mean
When different values have different weights (importance), we compute a weighted mean:
Example: A course has two exams. Exam 1 is worth 40% and Exam 2 is worth 60%. A student scores 75 on Exam 1 and 85 on Exam 2.
The weighted mean is 81, which is higher than the unweighted mean of 80 because the student did better on the heavier-weighted exam.
4.3 The Median
4.3.1 Intuition
The median is the middle value when data is sorted. It's the 50th percentile — half the values are below it, half above. It's like finding the person in the middle of a line.
4.3.2 Formal Definition
For sorted data:
- Odd n: The median is the value at position (n+1)/2
- Even n: The median is the average of the two middle values (positions n/2 and n/2+1)
4.3.3 Worked Examples
Example A (odd count): Scores: 65, 70, 80, 85, 90
- Sort: ✓ already sorted
- n = 5 (odd)
- Position = (5+1)/2=3
- 3rd value = 80
- Median = 80 Example B (even count): Scores: 65, 70, 80, 85, 90, 95
- Sort: ✓ already sorted
- n = 6 (even)
- Positions: 6/2=3 and 6/2+1=4
- 3rd value = 80, 4th value = 85
- Median = (80+85)/2=82.5
4.3.4 Properties of the Median
| Property | Explanation |
|---|---|
| Robust to outliers | Extreme values don't affect the median much |
| Only uses order | The median only depends on the middle values |
| Always exists | Every dataset has a median |
| Not algebraic | Can't use median in further calculations easily |
4.4 The Mode
4.4.1 Intuition
The mode is the most frequently occurring value. It's the "fashion" of the data — the most popular value.
4.4.2 Formal Definition
The mode is the value that appears most frequently in a dataset. A dataset can have:
- No mode: All values appear once
- One mode (unimodal): One value appears most frequently
- Two modes (bimodal): Two values tie for highest frequency
- Multiple modes (multimodal): More than two values tie
4.4.3 Worked Example
Scenario: Shoe sizes sold: 7, 8, 7, 9, 8, 7, 10, 8, 7, 9
| Size | Frequency |
|---|---|
| 7 | 4 |
| 8 | 3 |
| 9 | 2 |
| 10 | 1 |
Mode = 7 (appears 4 times, more than any other)
4.4.4 Properties of the Mode
| Property | Explanation |
|---|---|
| Only measure for nominal data | For eye colors, the mode tells us the most common color |
| Can be non-unique | There can be 0, 1, 2, or many modes |
| Not affected by outliers | Outliers don't change the mode |
| Simple to find | Just identify the most frequent value |
4.5 Comparing Mean, Median, and Mode
(Diagram)
Relationship in Different Distribution Shapes
(Diagram)
Why this relationship holds:
- The mean is pulled toward the long tail (toward extreme values)
- The median stays at the middle position
- The mode stays at the peak (most common value)
| Shape | Order | Example |
|---|---|---|
| Symmetric | Mean = Median = Mode | Heights of adult women |
| Right-skewed (tail on right) | Mode < Median < Mean | Income distribution (few people earn very high salaries) |
| Left-skewed (tail on left) | Mean < Median < Mode | Age at death (most people die old, few die young) |
4.6 Which Measure to Use?
| Situation | Recommend | Why |
|---|---|---|
| Nominal data (colors, gender) | Mode | Only valid measure |
| Ordinal data (ratings, ranks) | Median (or mode) | Mean requires equal intervals |
| Symmetric numerical data | Mean | Most precise, uses all data |
| Skewed numerical data | Median | Not affected by extreme values |
| Bimodal data | Report both modes | Mean and median hide the bimodality |
| {text}When outliers are present | Median | Mean is distorted |
| Need further calculations | Mean | Median isn't algebraic |
4.7 The Effect of Outliers
An outlier is an extreme value that differs significantly from other observations.
Example: Five startup employees earn (in ₹lakhs/year): 5, 6, 5.5, 6.5, 50 (the founder)
- Mean: (5 + 6 + 5.5 + 6.5 + 50) / 5 = 73 / 5 = 14.6
- Median: Sorted: 5, 5.5, 6, 6.5, 50 → 6
- Mode: 5 (appears once... actually all values are unique except) → No clear mode Interpretation:
- The mean says the "average" salary is ₹14.6 lakhs — but no one except the founder earns close to that!
- The median says the middle salary is ₹6 lakhs — which reflects what most employees earn
- The mode has no clear value If we remove the outlier (50):
- Mean becomes (5 + 6 + 5.5 + 6.5) / 4 = 5.75
- Median becomes (5.5 + 6) / 2 = 5.75 Without the outlier, mean and median are almost identical.
Moral: When outliers are present, the median is usually a better measure of "typical" than the mean.
4.8 Mean from a Frequency Table
When data is grouped into a frequency table, we can estimate the mean:
Where:
- fi = frequency of class i
- mi = midpoint of class i
- n = total frequency
- k = number of classes Example: Ages of participants at an event
| Age Range | Midpoint (m) | Frequency (f) | f × m |
|---|---|---|---|
| 10-19 | 14.5 | 5 | 72.5 |
| 20-29 | 24.5 | 12 | 294.0 |
| 30-39 | 34.5 | 8 | 276.0 |
| Total | 25 | 642.5 |
Note: This is an estimate because we've lost the exact values. The true mean of the raw data may differ slightly.
4.9 Worked Examples
Example 1: All Three Measures (Easy)
Scenario: 9 students scored: 55, 60, 65, 70, 75, 80, 85, 90, 95
Find mean, median, and mode.
Solution:
Mean:
Median:
- Sorted (already): 55, 60, 65, 70, 75, 80, 85, 90, 95
- n = 9 (odd), position = (9+1)/2 = 5
- 5th value = 75 Mode: All values appear exactly once → No mode Result: Mean = Median = 75. This is symmetric data.
Example 2: Outlier Effect (Medium)
Scenario: The same scores plus one student who scored 0: 0, 55, 60, 65, 70, 75, 80, 85, 90, 95
Find mean and median. Compare with Example 1.
Solution:
Mean:
Median:
- Sorted: 0, 55, 60, 65, 70, 75, 80, 85, 90, 95
- n = 10 (even), positions = 5 and 6
- 5th = 70, 6th = 75
- Median = (70 + 75)/2 = 72.5 Comparison:
| Measure | Without outlier | With outlier | Change |
|---|---|---|---|
| Mean | 75 | 67.5 | ↓ 7.5 |
| Median | 75 | 72.5 | ↓ 2.5 |
Interpretation: The outlier (0) pulled the mean down much more than the median. The median better represents the "typical" student performance.
Example 3: Skewed Income Data (Harder)
Scenario: A small company has 10 employees with monthly salaries (in ₹thousands):
xˉ=1020+22+25+25+28+30+32+35+38+200=10455=45.520, 22, 25, 25, 28, 30, 32, 35, 38, 200 (CEO) a) Compute mean and median. b) Which better represents "typical" employee salary? c) How would you describe the skew? Solution: a) Mean:
So the mean is ₹45.5 thousand.
Median:
- Sorted: 20, 22, 25, 25, 28, 30, 32, 35, 38, 200
- n = 10 (even), positions = 5 and 6
- 5th = 28, 6th = 30
- Median = (28 + 30)/2 = 29 So the median is ₹29 thousand. b) Which is more representative? The median (₹29K) is much more representative. Only the CEO (₹200K) earns more than ₹38K. The mean (₹45.5K) is inflated by the CEO's extreme salary and doesn't reflect what most employees earn. c) Skew: This is right-skewed (positive skew). Most values cluster at the low end (₹20K-₹38K), with one extreme value pulling a long tail to the right. We confirm: Mode (<25) < Median (29) < Mean (45.5).
4.10 Edge Cases & Gotchas
All Values Are the Same
If all 10 values are 5, then mean = median = mode = 5. They all agree.
Symmetric Bimodal Distribution
Values: 1, 1, 2, 2, 3, 3 (two modes: 1, 2, 3 — actually each appears twice)
Actually let's use a clearer example: 1, 1, 2, 3, 4, 4
- Mean = (1 + 1 + 2 + 3 + 4 + 4) / 6 = 15/6 = 2.5
- Median: sorted 1, 1, 2, 3, 4, 4 → (2+3)/2 = 2.5
- Modes: 1 and 4 (bimodal) The mean and median don't reveal the bimodality — they suggest a normal distribution when the data actually has two clusters. Always visualize!
The Median for Ordinal Data
For ordinal data (like survey responses: SD, D, N, A, SA), the median is valid. Convert to numeric codes (1-5), find the middle value, then convert back.
Example: Responses: D, SA, N, A, SD, A, A, N, D, SA
- Codes: 2, 5, 3, 4, 1, 4, 4, 3, 2, 5
- Sorted: 1, 2, 2, 3, 3, 4, 4, 4, 5, 5
- Median: positions 5,6 → (3+4)/2 = 3.5 → between Neutral and Agree The median response is between Neutral and Agree — a valid conclusion. The mean (3.3) would be invalid because we're assuming equal intervals.
4.11 Why This Matters
Measures of central tendency are the first thing anyone asks about data:
- Business: "What's the average revenue per customer?"
- Education: "What's the average test score?"
- Healthcare: "What's the average recovery time?"
- Policy: "What's the median income of a region?" They also form the foundation for almost every other statistical concept:
- Variance (next topic) uses the mean
- Correlation (Week 4) uses the mean
- Hypothesis testing (Stats 2) uses the mean
- Regression uses the mean Understanding which measure to use and why is the difference between good analysis and misleading analysis.
📐 Key Formulas / Concepts
| Measure | Definition | Formula | Scale Validity |
|---|---|---|---|
| Population Mean (μ) | Sum of all values divided by count | μ=N∑xi | Interval, Ratio |
| Sample Mean (x̄) | Same formula, different notation | xˉ=n∑xi | Interval, Ratio |
| Weighted Mean | Weighted values divided by weights | xˉw=∑wi∑wixi | Interval, Ratio |
| Median | Middle value of sorted data | (n+1)/2 position if odd | Ordinal, Interval, Ratio |
| Mode | Most frequent value | Largest frequency | Nominal, Ordinal, Interval, Ratio |
| Mean from Freq Table | Estimated mean from grouped data | n∑fimi | Interval, Ratio |
⚠️ Common Pitfalls
Pitfall 1: Using the Mean for Skewed Data
The mistake: Reporting the mean salary when the distribution is heavily right-skewed, making it seem like employees earn more than they do.
Why it happens: The mean is the most familiar measure. People default to it.
How to catch it: Check if the mean is substantially different from the median. If mean > median significantly, the data is right-skewed.
Correct approach: Report the median for skewed data. If you report the mean, also report the median and note the skewness.
Pitfall 2: Forgetting the Mode Is the Only Measure for Nominal Data
The mistake: Trying to compute the mean or median of eye colors (or another nominal variable).
Why it happens: Students get comfortable with mean/median and forget the scale of measurement matters.
Correct approach: Only the mode is valid for nominal data. Report the most common category and its percentage.
Pitfall 3: Confusing Mean and Median
The mistake: Saying "the average" without specifying which measure, or assuming all measures of central tendency give the same result.
Why it happens: In everyday language, "average" usually means the mean. People don't distinguish.
Correct approach: Always specify which measure you're using. When reporting, consider whether the mean or median is more appropriate for your data.
Pitfall 4: Thinking the Mean Is Always a Value in the Dataset
The mistake: Looking at a dataset and thinking the mean must be one of the values present.
Why it happens: The mode is always a data value. The median is always a data value (for odd n). The mean can be anything.
Example: Data: 1, 2, 3, 4, 100. Mean = 110/5 = 22. That's not in the dataset!
📝 Practice Questions
</details> > **Q2: Median with Even Count** > > Find the median of: 3, 7, 8, 12, 15, 18, 20, 22 > > <details> <strong>Solution</strong> > > **Step 1:** Sort (already sorted). **Step 2:** n = 8 (even). **Step 3:** Position 1 = 8/2 = 4, Position 2 = 8/2 + 1 = 5. **Step 4:** 4th value = 12, 5th value = 15. **Step 5:** Median = (12 + 15) / 2 = 13.5 > > $\boxed{\text{Median} = 13.5}$ </details> > **Q3: Identifying Modes** > > Find the mode(s) for each dataset: > > a) 2, 3, 5, 3, 4, 3, 6, 3 b) 1, 2, 2, 3, 4, 4, 5, 6 c) 10, 20, 30, 40, 50 > > <details> <strong>Solution</strong> > > **a)** Value 3 appears 4 times, others appear once or twice. **Mode = 3** (unimodal) > > **b)** Values 2 and 4 each appear twice. **Modes = 2 and 4** (bimodal) > > **c)** All values appear exactly once. **No mode**. </details> > **Q4: Weighted Mean** > > A student's grades: Homework = 85 (weight 10%), Quizzes = 78 (weight 20%), Midterm = 92 (weight 30%), Final = 88 (weight 40%). Find the weighted mean. > > <details> <strong>Solution</strong> > > **Step 1:** Convert percentages to decimals. > > **Step 2:** $\bar{x}_w = \frac{0.10(85) + 0.20(78) + 0.30(92) + 0.40(88)}{0.10 + 0.20 + 0.30 + 0.40}$ > > **Step 3:** Numerator = 8.5 + 15.6 + 27.6 + 35.2 = 86.9 > > **Step 4:** Denominator = 1.0 > > **Step 5:** Weighted mean = 86.9 / 1.0 = 86.9 > > $\boxed{\bar{x}_w = 86.9}$ </details> > **Q5: Mean from Frequency Table** > >Q1: Basic Mean Calculation<details> <strong>Solution</strong>Find the mean of: 12, 15, 20, 22, 25, 28, 30Step 1: Sum = 12 + 15 + 20 + 22 + 25 + 28 + 30 = 152 Step 2: n = 7 Step 3: Mean = 152 / 7 ≈ 21.71xˉ≈21.71
| Class | Frequency |
|---|---|
| 0-10 | 4 |
| 10-20 | 8 |
| 20-30 | 6 |
| 30-40 | 2 |
<details> <strong>Solution</strong>Find the estimated mean.
| Class | Midpoint (m) | f | f × m |
|---|---|---|---|
| 0-10 | 5 | 4 | 20 |
| 10-20 | 15 | 8 | 120 |
| 20-30 | 25 | 6 | 150 |
| 30-40 | 35 | 2 | 70 |
| Total | 20 | 360 |
</details> > **Q6: Effect of Adding a Constant** > > If you add 5 to every value in a dataset, what happens to the mean, median, and mode? > > <details> <strong>Solution</strong> > > **All three increase by 5.** > > - **Mean:** If $\bar{x} = \frac{\sum x}{n}$, then new mean $= \frac{\sum (x + 5)}{n} = \frac{\sum x + 5n}{n} = \bar{x} + 5$ > - **Median:** Every value shifts right by 5, so the middle value also shifts by 5 > - **Mode:** The most frequent value each increases by 5 > > **General rule:** Adding a constant to all data shifts all measures of central tendency by that constant. </details> > **Q7: Multiplying by a Constant** > > If you multiply every value in a dataset by 3, what happens to the mean, median, and mode? > > <details> <strong>Solution</strong> > > **All three are multiplied by 3.** > > - **Mean:** $\frac{\sum 3x}{n} = 3 \times \frac{\sum x}{n} = 3\bar{x}$ > - **Median:** Every value triples, so the middle value triples > - **Mode:** The most frequent value triples > > **General rule:** Multiplying all data by a constant multiplies all measures of central tendency by that constant. </details> > **Q8: Choosing the Right Measure** > > For each scenario, recommend a measure of central tendency and explain why: > > a) Housing prices in a city (most homes ₹30-50 lakhs, some mansions ₹10+ crores) b) Favorite color of 500 respondents c) Daily website visitors over a month d) Cancer survival times (most patients die within 2 years, some live 20+ years) > > <details> <strong>Solution</strong> > > **a) Housing prices — Median** > > - Distribution is heavily right-skewed (a few mansions pull the mean high) > - Median better represents the "typical" home price > > **b) Favorite color — Mode** > > - Nominal data — mean and median are invalid > - Mode tells us the most popular color > > **c) Daily visitors — Mean** > > - Website traffic is typically roughly symmetric day-to-day > - Mean gives the most precise estimate using all data > - (Unless there are extreme spikes — then consider median) > > **d) Cancer survival — Median** > > - Heavily right-skewed (most patients die relatively quickly, a few live much longer) > - Mean would be misleadingly high > - Median better represents "typical" survival time </details> > **Q9: Outlier Impact** > > Dataset: 10, 12, 13, 15, 16, 18, 20, 22, 25, 100 > > a) Compute the mean and median. b) Identify the outlier. c) Remove the outlier and recompute. How much did each change? > > <details> <strong>Solution</strong> > > **a) With outlier:** > > - Sum = 10 + 12 + 13 + 15 + 16 + 18 + 20 + 22 + 25 + 100 = 251 > - Mean = 251/10 = 25.1 > - Sorted: 10, 12, 13, 15, 16, 18, 20, 22, 25, 100 > - Median = (16 + 18)/2 = 17 > > **b) Outlier:** 100 (far above the rest) > > **c) Without outlier (100 removed):** > > - Sum = 151 > - n = 9 > - Mean = 151/9 ≈ 16.78 > - Sorted: 10, 12, 13, 15, 16, 18, 20, 22, 25 > - Median = 16 > > **Changes:** > >xˉ≈20360=18xˉ≈18
| Measure | With outlier | Without | Change |
|---|---|---|---|
| Mean | 25.1 | 16.78 | ↓ 8.32 (33% drop) |
| Median | 17 | 16 | ↓ 1 (6% drop) |
</details> > **Q10: Symmetric Distribution** > > A symmetric dataset has mean = 50 and median = 50. If the largest value increases by 20, what happens to the mean and median? > > <details> <strong>Solution</strong> > > **Mean:** Increases (by 20/n). Adding 20 to one value increases the sum by 20, so the mean increases by 20/n. > > **Median:** Stays the same (assuming the increased value was already above the median and the change doesn't affect the middle position). > > **Example with n = 5:** > > Original: 40, 45, 50, 55, 60 > > - Mean = 250/5 = 50 > - Median = 50 > > New (largest increases by 20): 40, 45, 50, 55, 80 > > - Mean = 270/5 = 54 (↑ 4) > - Median = 50 (unchanged) > > $\boxed{\text{Mean increases; Median unchanged}}$ </details> * * * ## 🔗 Cross-References - **Next topic:** [Dispersion and Percentiles](/notes/01-foundation-bsma1002-stats-1-week03-04-dispersion-percentiles) — central tendency alone isn't enough; we also need to measure spread - **Previous:** [Data Types & Scales](/notes/01-foundation-bsma1002-stats-1-week01-01-data-types-scales) — understanding which measures are valid - **Week 4 (Correlation):** The mean is used in calculating Pearson's r - **Week 9-10 (Random Variables):** Expectation (E\[X\]) is the mean of a distribution - **BSMA1004 (Stats 2):** Hypothesis testing centers on comparing means [Join Discord](https://discord.gg/gE2m4Qrdqv) [Previous**Categorical Data**](/notes/01-foundation-bsma1002-stats-1-week02-02-categorical-frequency)[Next**Dispersion & Percentiles**](/notes/01-foundation-bsma1002-stats-1-week03-04-dispersion-percentiles)The mean was far more affected by the single outlier than the median.