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.
click a card to scratch it
fair_price(payouts, chances)| payouts | what each outcome pays, e.g. [100, 0] | e.g. [10] |
| chances | how likely each outcome is, e.g. [0.1, 0.9] (they add up to 1) | e.g. [1] |
| returns | what is fair to pay to play once | |