Flip a coin flips times; each flip lands heads with chance p, whatever the other flips did. Write chance_of_heads(flips, heads, p): the chance of getting exactly heads heads. Some of the coins are fair, and some are bent.
All 16 orders 4 flips can land in (● heads, ○ tails), grouped by how many heads each has. The obvious chance of 2 heads counts one order and misses the other five. Then a bent coin that lands heads 80% of the time makes each order’s block as tall as its chance. The goal is the columns it ends on. Once it has played, click a column.
chance_of_heads(flips, heads, p)| flips | how many times the coin is flipped | e.g. 3 |
| heads | how many heads you want, exactly | e.g. 0 |
| p | the chance that one flip lands heads, e.g. 0.5 for a fair coin | e.g. 0.5 |
| returns | the chance of exactly that many heads | |