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

      Is the bet worth it?

      A game has a few possible outcomes: outcome i pays payouts[i] and happens with chance chances[i] (the chances add up to 1). Write fair_price(payouts, chances): what it’s fair to pay to play once.

      A scratch card pays $100 one time in ten, and nothing otherwise. Pick a price per card and scratch some: click a card, or scratch 10 at a time, or 100 more for the long run.

      price per card
      cards
      0
      you paid
      $0
      you won
      $0
      so far
      –
      even+$100−$100cards scratched →

      click a card to scratch it

      Your functionfair_price(payouts, chances)
      payoutswhat each outcome pays, e.g. [100, 0]e.g. [10]
      chanceshow likely each outcome is, e.g. [0.1, 0.9] (they add up to 1)e.g. [1]
      returnswhat is fair to pay to play once
      solution.pyLoading Python
      Sign in for an AI hint
      ← Cut the long tailThe rare disease test →