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

      The tenth mention

      You’re ranking pages for a search. Write about(times, page_length, average_length, enough): from 0 to 1, how much a page is about one word, given that the word appears times times. page_length is the page’s length in words and average_length the average over all pages. After about enough mentions on an average-length page, more mentions barely matter: the tenth “python” tells you little the ninth didn’t.

      Someone searches “python”. Three pages come back, each drawn to its length with a tick for every “python” (the average page is 300 words). Your function scores, from 0 to 1, how much each page is about python.

      |results, ranked by how many times the page says “python”about it?#3a short tip150 words0mentions?#2a long guide1,200 words0mentions?#1a spam page500 words0mentions?How much is each page about “python”, from 0 to 1?try the buttons: these results are ranked by plain count
      Your functionabout(times, page_length, average_length, enough)
      timeshow often the word appears on the pagee.g. 0
      page_lengthwords on this pagee.g. 300
      average_lengthwords on an average pagee.g. 300
      enoughafter about this many mentions (on an average page) more barely mattere.g. 2
      returns0 to 1: how much the page is about the word
      solution.pyLoading Python
      Sign in for an AI hint
      ← Which words matter?King − man + woman →