Exam means problem

65 Views Asked by At

In a class I have a note on a scale of 1 (low) to 100 (high).

  • If I get 71 on my next exam, my exams mean will be 83.
  • If I get 99 on my next exam, my exams mean will be 87.

How many exams did I already have?

I've made a small python program to solve it, the result is 510 which is not realistic. My wife told me "6".

What am I doing wrong?

m = 1
found = False
while not found:
    m += 1
    for i in range(m):
        if ((i+71.0) % 83.0)==0 \
            and ((i+99.0) % 87.0)==0:
            print ('Found here:', i, ((i+71.0)/83.0), ((i+99.0)/87.0))
            found = True
            break

The result is:

('Found here:', 510, 7.0, 7.0)
2

There are 2 best solutions below

4
On BEST ANSWER

Between the two results you increase the total point sum by ___, which makes the mean go up by ___. That means that the total number of exams (including the next one) is ___.

Alternatively, including the next one you'll have taken $n$ exams, for a total score of either $i+71$ or $i+99$, depending on how it goes. The number $i$ I'd the sum of all the scores in previous exams. The the final mean score is then either $$ 83=\frac{i+71}{n} $$ or $$ 87=\frac{i+99}{n} $$ Now you have two equations with two unknowns, which means they can be solved.

0
On

If you rewrite Arthurs' equations into a linear equation system you can write into Octave (or Matlab) :

([-1,83;-1,87]\[71;99])'

which gives the output

510 7

so $i=510$ and $n=7$ - you probably solved the problem as it was posed correctly

Now notice that the first variable $i$ is the sum and not the average value. Maybe you can take it from there.