| Marks (x) | Number of students (f) | fx |
| 5 | 6 | 30 |
| 6 | a | 6a |
| 7 | 16 | 112 |
| 8 | 13 | 104 |
| 9 | b | 9b |
| | `sumf = 34 + a + b` | `sumfx = 246 + 6a + 9b` |
It is given that the number of students is 40.
∴ 35 + a + b = 40
⇒ a + b – 5 = 0 ....(1)
"Mean" = (sum fx)/(sum f)
=> (246 + 6a + 9b)/(35 + a + b) = 7.2`
=> 246 + 6a + 9b = 7.2(35 + a + b)`
=> 246 + 6a + 9b = 252 + 7.2a + 7.2b`
=> 0 = 252 - 246 + 7.2a - 6a + 7.2b - 9b`
=> 6 + 1.2a - 1.8b = 0`
=> 10 + 2a - 3b = 0` .... (2)
Solving equations (1) and (2), we have
5a - 5 = 0
=> a = 1
From (1), we have b = 4
Hence, the values of a and b are 1 and 4 respectively.