My daughter gave me a 60-sided die for Christmas, and this month, I introduced her to D&D. It's trivial to represent a single toss uniformly of a d4, d6, d10, d12, & d20 using modular arithmetic, and handling rerolls, the same can be applied for d8 and d100.
But what if I want the sum of 3d4 using only my d60. I could use lookup tables, but I'm curious how I would derive it via equation. In other words, if I toss a 49, how could I uniformly derive the sum of 3d4 without a lookup table?
It seems like the approach would be to first get the probabilities of each sum of 3 through 12 in 3d4, then apply those probabilities to 10 groupings of the d60. Knowing that the probabilities won't divide the d60 evenly, rerolls will also need to be handled.
It seems like I need to use a probability generating function, but it's not clear to me how to apply it, such that looking at the result of my d60 toss, I can uniformly derive the sum of an s-sided die with n-tosses.
Since you can simulate d4 using d60 you can easily simulate 3d4 by the sum of 3d60s. You can devise a method that will obtain it faster making use of the $15$ possibilities that are left after each roll. One obvious improvement would be to obtain d4 roll from the d60 roll by dividing the number one less than the result by 4 and get the remainder plus one and if the quotient is less than $12$ then we can simulate the next result of a d4 roll by dividing with the remainder by $4$ again. For example, if we roll $40$ we divide $40-1=39$ by $4$ obtaining $9$ and residue $3$ - therefore our first roll is $3+1=4$ and we can use the quotient $9$ to roll the second time - dividing it by $4$ we obtain the remainder of $1$ so our second throw is $2$. So most of the time we need just two rolls except for the case when the remainder will be $12$, $13$ or $14$ two times in a row. The probability of this happening is $(\frac{3}{15})^2=4\%$ giving us an average of $2.04$ rolls. And it can be improved further, for example, if we get twice the quotient $12$ or $13$ we can assign each of the pairs $(12,12)$, $(12,13)$, $(13,12)$ and $(13,13)$ an outcome of the third d4 dice so the only case in which we have to roll the dice for the third time would be when we get the remainder $14$ two times in a row - the probability of this happening is just $(\frac{1}{16})^2=\frac{1}{256} \approx .39\%$.