Roll two fair dice, one with sides_a faces and one with sides_b, each numbered from 1. Write chance_of_total(total, sides_a, sides_b): the chance that one roll of the two adds up to total. The puzzle asks about two ordinary six-sided dice, a four-sided die with a six-sided one, and two eight-sided dice.
A dark die and a light die, rolled 360 times; every total goes into its column. Eleven totals are possible, so is each one an 11th of the time? The columns say no. The goal is the exact chance of each total, for any two dice.
chance_of_total(total, sides_a, sides_b)| total | the sum the two dice should add up to | e.g. 1 |
| sides_a | how many faces each die has (6 for an ordinary die), numbered from 1 | e.g. 6 |
| sides_b | how many faces each die has (6 for an ordinary die), numbered from 1 | e.g. 6 |
| returns | the chance that one roll of the two dice adds up to total | |