Spooky Sale: 10% off Premium yearly · $118.80 for the first year · until Nov 6Get it

Deep-ML
Learn
Problems1,200+ hands-on ML problemsLearning PathA guided route through the fundamentalsLabsInteractive labs on real techniquesProjectsBuild a GPT, an RL agent, CUDA kernelsCollectionsCurated problem sets and videosMathPen-and-paper math for MLIntuitionInvent the idea behind the formula yourselfPlaylistsYour own problem lists, shareableStudy AssistantAn AI teacher that knows your progress
Interview Prep
Compete
ContestsFresh problem sets, ranked liveLeaderboardWhere you stand, globallyBuddiesSolve with a friend: streaks, a weekly board, chat
Discuss
Deep-Path
Premium
      Intuition
      65 of 130

      The worst got better

      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.

      Class 7B sat two tests, no tutoring in between. One dot per student.4050607080901005060708090test 1 →↑ test 2Class 7Bsame score twicetest-2 average, per scoreno tutoring, and still:10 lowest 55 → 6110 highest 85 → 79
      Your functionexpected_retest(first, second, score)
      firsteach student's score on test 1 (a list)e.g. [50, 50, 50, 50, 55, 55, 60, 60, 60, 60, 6…
      secondthe 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…
      scorea test-1 score, e.g. 55e.g. 55
      returnsthe expected test-2 score of a student who scored that on test 1, e.g. 61.0
      solution.pyLoading Python
      Sign in for an AI hint
      ← Better in every hospitalBetter than guessing the average? →