A school tutored its 10 lowest scorers, and on the retest they improved by 8 points. Before anyone celebrates: how much would they have improved anyway? Here are classes that sat two tests with no tutoring in between. Write expected_retest(first, second, score): the expected test-2 score of a student who scored score on test 1, judging from this class.
A class sat two tests with no tutoring in between; each dot is one student. The obvious guess is the same score again, the diagonal. But the 10 lowest scorers did better on test 2, and the 10 highest did worse, with nothing done to them. The goal is the expected test-2 score for any test-1 score, the way the short bars show it for scores in the class. Your expected_retest() works it out.
expected_retest(first, second, score)| first | each student's score on test 1 (a list) | e.g. [50, 50, 50, 50, 55, 55, 60, 60, 60, 60, 6… |
| second | the same students' scores on test 2, in the same order (a list) | e.g. [70, 46, 49, 67, 74, 48, 58, 70, 77, 51, 6… |
| score | a test-1 score, e.g. 55 | e.g. 55 |
| returns | the expected test-2 score of a student who scored that on test 1, e.g. 61.0 | |