# Calculate total score from average score

A class of students have taken $$8$$ exams.

The average scores of the exams are:

1st: $$80.12$$

2nd: $$74.59$$

3rd: $$77.83$$

4th: $$77.34$$

5th: $$82.07$$

6th: $$81.25$$

7th: $$78.90$$

8th: $$75.44$$

What is the total score of all the students in all the $$8$$ exams?

It is known that the number of students is less than $$99$$.

• Are those exact averages, or are they rounded? Oct 2 '20 at 22:56
• @bobble They are rounded in the usual way (whatever that means). Oct 2 '20 at 23:45
• @Moody_Mudskipper Yes, the solution is unique, and your understanding is probably correct. Since it's a puzzle, there is some "guessing" of the proper assumptions. Oct 3 '20 at 0:28

I used programming and brute-forced the problem.

If I multiply the real average scores by the number of students I should get a whole number, which is the total score. Though given these numbers are rounded, my total score will be skewed, so i need to round it to find candidate total scores. If I divide my rounded total scores by the number of students and round it to the second decimal I should fall back on my rounded averages.

I use the R programming language

    vals <- c(80.12, 74.59, 77.83, 77.34, 82.07, 81.25, 78.90, 75.44)
test <- sapply(1:98, function(x) identical(round(round(x*vals) / x,2), vals))
which(test)


59 88 96

This gives me 3 possible number of students. Assuming the solution must be uniuque, let's look back at the average scores :

round(59*vals)/59
#> [1] 80.11864 74.59322 77.83051 77.33898 82.06780 81.25424 78.89831 75.44068
round(88*vals)/88
#> [1] 80.12500 74.59091 77.82955 77.34091 82.06818 81.25000 78.89773 75.44318
round(96*vals)/96
#> [1] 80.12500 74.59375 77.83333 77.34375 82.07292 81.25000 78.89583 75.43750


They seem to work all well, if 80.12500 is rounded down, but given there can be only one solution, we can assume that the instructors would be generous and round those up, so 59 students is the only solution that works. The totals are thus:

round(59*vals)

4727 4401 4592 4563 4842 4794 4655 4451