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

      Planning for the wrong world

      In “How surprising?”, an outcome with chance p took log2(1/p) yes/no questions to pin down, so likely outcomes are found fast. You set up your questions for the chances planned_chances, but outcomes really happen with true_chances. Write wasted(true_chances, planned_chances): the extra questions per outcome, on average, compared with having planned for the truth.

      You text a friend expecting “yes” 99% of the time. A reply with chance p is log2(1/p) bits of surprise (“How surprising?”): the replies you expect barely register, the ones you don’t are a shock. Then the replies come in.

      You text a friend. A reply you expected is no surprise; one you didn’t is.“Coming out tonight?”you expect yes 99%yes0.01 bitsno6.64 bitsexpecting the truth about Samyes1 bitsno1 bitsSam repliessurprise so far0per reply, in the long runyou: 3.33the truth: 1extra surprise per reply?
      Your functionwasted(true_chances, planned_chances)
      true_chanceshow often each outcome really happense.g. [0.5, 0.5]
      planned_chancesthe chances you set your questions up fore.g. [0.5, 0.5]
      returnsthe extra yes/no questions per outcome, on average
      solution.pyLoading Python
      Sign in for an AI hint
      ← Best question to askScore a forecaster →