Hacker News new | ask | show | jobs
by Terr_ 987 days ago
Also-related are all the problems like "simulate an 11-sided die with a 6-sided die", where the solution involves identifying certain rolls that should trigger a retry. [0]

In both cases it has to do with shaping the combination of multiple rolls using some knowledge of outcome-symmetries and overlaps.

____

[0] In this particular case, that's something like: Roll the die twice to get rolls A and B; map those a number X in the range range [1,36] using x=(((A-1)*6)+B); if X<=33 then return (x%11)+1 which will be equally likely in the range [1,11]; if X>33 then start over.