A new café wants to know how its town rates it (1 to 10), but the survey was done wherever people were easy to reach, so the crowd you asked isn’t the crowd you want. Write estimate(ratings, asked_chances, wanted_chances): your best guess of the average rating in the crowd you want. For each answer you got: its rating, how common that kind of person (student, worker, retiree) is in the crowd you asked, and how common in the crowd you want.
You want to know what the whole town thinks of a new café, but the only people you can ask are the ones sitting in it, and they’re nearly all students. Click anyone to see who they are and what they said.
estimate(ratings, asked_chances, wanted_chances)| ratings | ratings[i]: what the i-th person you asked said (1 to 10) | e.g. [4, 2, 5, 3] |
| asked_chances | asked_chances[i]: how common their kind is in the crowd you asked | e.g. [0.2, 0.5, 0.3, 0.5] |
| wanted_chances | wanted_chances[i]: how common their kind is in the crowd you want | e.g. [0.2, 0.5, 0.3, 0.5] |
| returns | the average rating you'd expect in the crowd you want | |