2

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)
  • Is this something you've tried to answer or are you just arbitrarily asking a question? – Jack Pedley Sep 14 '15 at 12:02
  • It's a question a teacher asked to my nephew. He asked me, I didn't answer, and he should have the solution this morning. I'll see him tonight, I wanted to have different views and explanations of the solution – Olivier Pons Sep 14 '15 at 12:03

2 Answers2

3

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.

Arthur
  • 199,419
  • Not always true that one can solve two equations with two unknowns. The equation system can be degenerate or non-linear for instance. But good answer anyway. – mathreadler Sep 14 '15 at 12:10
  • 1
    @mathreadler It's true that they cannot always be solved, but what I rather meant was "now you're in a situation where you can apply techniques you should be familiar with to get an answer". And for the record, in this case the system can be solved. – Arthur Sep 14 '15 at 12:15
  • I've made a small python program to solve it, the result is 510 which is not realistic. My wife told me "6". I've added the program in my question – Olivier Pons Sep 14 '15 at 12:23
  • First of all, $i$ is the total sum of scores, which means it shouldn't be in range(m), but in range(100*m). Secondly, this doesn't count the case where you've gotten a perfect score (while unlikely, it's a bad habit to miss it) so it should be range(100*m+1). Thirdly, there is a slight possibility that the numbers you are given ($83$ and $87$) are just rounded and not exact, which means that your check for whether you have a possible solution is completely void. – Arthur Sep 14 '15 at 12:32
0

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.

mathreadler
  • 25,824