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
      37 of 102

      The rare disease test

      Someone takes a test for a rare disease and it comes back positive. Write chance_sick(base_rate, catch_rate, false_alarm_rate): the chance they are actually sick. base_rate is the share of people who have it, catch_rate the chance a sick person tests positive, and false_alarm_rate the chance a healthy person tests positive anyway.

      1,000 people take a test for a disease that 1 in 1,000 people have. It catches 99% of sick people, and goes off for 1% of healthy people anyway. Someone tests positive.

      1,000 people: about 1 in 1,000 is sicktested positive: 11you tested positive. the chance you’re sick:0%50%100%?
      the chance for any rates is yours to work out
      Your functionchance_sick(base_rate, catch_rate, false_alarm_rate)
      base_rateshare of people who have the diseasee.g. 0.01
      catch_ratechance a sick person tests positivee.g. 0.9
      false_alarm_ratechance a healthy person tests positivee.g. 0
      returnsthe chance they are sick
      solution.pyLoading Python
      Sign in for an AI hint
      ← Is the bet worth it?Two clues →