Black Friday Sale: 20% off Premium yearly · $105.60 for the first year · until Monday, Nov 30Get it

Deep-ML
Learn
ProblemsPractice, projects, collections, and your progressLearning 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
      116 of 130

      Big team, small bill

      A firm prices houses with appraisers, each of whom knows one area of town. For every house the firm knows match, how well the house fits each appraiser’s area (adding up to 1), and quotes, the price each would give, in $k. But every call to an appraiser costs money, and the budget pays for k calls. Write estimate(match, quotes, k): the firm’s price for the house, as good as the team can make it, without going over budget. The firm will keep hiring, so it has to work for a team of any size.

      Eight appraisers, each knows one area. The bars show how well this house matches each one’s area. The obvious idea calls them all and blends every quote, and the budget pays for 2 calls. The firm then hires 64 appraisers to know more of town, and calling everyone gets dearer still. Your estimate(match, quotes, k) prices the house within the budget.

      A house to price. Eight appraisers, each knows one area, each with a quote.the price$?0 callsbudget: 2matches the housequoteOld Town30%$440knot calledRiverside5%$390knot calledHilltop22%$500knot calledHarbor8%$350knot calledMidtown12%$420knot calledParkside4%$310knot calledLakeview10%$460knot calledUptown9%$380knot called
      Your functionestimate(match, quotes, k)
      matchhow well this house fits each appraiser's area (a numpy array, adding up to 1)e.g. [0.3, 0.05, 0.22, 0.08, 0.12, 0.04, 0.1, 0…
      quotesthe price each appraiser would give, in $k (a numpy array)e.g. [440, 390, 500, 350, 420, 310, 460, 380]
      khow many appraisers the budget lets you calle.g. 2
      returnsthe firm's price for the house, in $k
      solution.pyLoading Python
      Sign in for an AI hint
      ← A small change to a big matrixSend it to the right expert →