let x = original average score
let y = be the number of students
We need to write two equation using the information given in the scenario in order to work them simultaneously and obtain the results.
let

.... (1)
so x is the original average, so we multiply that average by the amount of students [y × x] in order to obtain their cumulative score then you add the nine to that score (because a student got 9 more points) [yx + 9]. Then you divide that sum by the amount of student in order to get the new average which the question says would be 81

...... (2)
so x is the original average, so we multiply that average by the amount of students [y × x] in order to obtain their cumulative score then you subtract three from that score since one student got three less points [yx - 3]. Then you divide by the number of students (y) and you should 78 like the question says.
.... (1)
...... (2)Now simplify each equation by separating the LHS
..... (1a)
...... (2a)By subtracting eq (2a) from eq (1a) in order to eliminate x


⇒ y = 4Since y = the number of studentsthen the number of students = 4