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.
wasted(true_chances, planned_chances)| true_chances | how often each outcome really happens | e.g. [0.5, 0.5] |
| planned_chances | the chances you set your questions up for | e.g. [0.5, 0.5] |
| returns | the extra yes/no questions per outcome, on average | |