Statistics Calculator
Mean, median and mode
The mean is the sum divided by the count, the median is the middle value in order, and the mode is the most frequent value. For data grouped into class intervals, as in Class 10 NCERT, the exact values are unknown, so formulas estimate them from the class marks, cumulative frequencies and the modal class. This calculator handles both, and shows the frequency table and working.
Grouped data formulas
x is the class mark (middle of the class) and h the class width. For the median, l is the lower limit of the median class, cf the cumulative frequency before it and f its frequency. For the mode, l is the lower limit of the modal class, f₁ its frequency and f₀, f₂ the frequencies of the classes before and after it.
Good to know
- The median class is the first class whose cumulative frequency reaches n/2.
- For inclusive classes like 1–10, 11–20, subtract 0.5 from each lower limit and add 0.5 to each upper limit first. The calculator does this automatically.
- The empirical relation 3 median = mode + 2 mean holds roughly for moderately skewed data.
- The median is better than the mean for data with extreme values, such as incomes.
- Use the population standard deviation for a whole group and the sample one when your data is a sample from a bigger group.
Worked example: marks of 50 students
- Classes 0–10, 10–20, 20–30, 30–40, 40–50 with frequencies 5, 8, 15, 16, 6 (n = 50)
- Mean: Σfx = 25 + 120 + 375 + 560 + 270 = 1,350, so mean = 1,350 ÷ 50 = 27
- Median: n/2 = 25 falls in 20–30 (cumulative frequency 28), so median = 20 + ((25 − 13) ÷ 15) × 10 = 28
- Mode: the modal class is 30–40 (f = 16), so mode = 30 + ((16 − 15) ÷ (32 − 15 − 6)) × 10 ≈ 30.91
- Check: 3 × 28 − 2 × 27 = 30, close to the mode of 30.91
Frequency table for the example
The working columns used for the mean and median.
| Class | f | x | fx | cf |
|---|---|---|---|---|
| 0–10 | 5 | 5 | 25 | 5 |
| 10–20 | 8 | 15 | 120 | 13 |
| 20–30 | 15 | 25 | 375 | 28 |
| 30–40 | 16 | 35 | 560 | 44 |
| 40–50 | 6 | 45 | 270 | 50 |
Σf = 50 and Σfx = 1,350.