Tech News
← Back to articles

A two-person method to simulate die rolls

read original related products more articles

I’ve traveled to Xi’an to play with my friend, Zambon21. There are some boring time which must be passed, and so we tried to pass them using brain-procedurally generated simplified D&D-like campaigns. As all D&D campaigns requires dice, ours is no exception. But by then we were presented with no other tools except our mortal bodies (because both of our phone’s batteries had run out), and mortal bodies are quite bad at generating random numbers. Inspiration struck when we wandered straight into a tourist trap. Exploiting the polar coordinate, we thought up a neat little trick to generate random numbers, and simplified it so that it can simulate a randomly generated die roll. Along with the method, we bundled a fun little game that can be played with no other tools other than the fake dice we invented above. After all, who doesn’t love random numbers?

Methodology

We will present the random number generation method below. The method is capable of generating numbers between \([0, 1)\) and requires the participation of two parties, and two positions situated on the unit circle of the polar coordinate system to work.

A number (\(\theta_1\)) is proposed by A. Another number (\(\theta_2\)) is proposed by B. The angular difference is evaluated (\(\delta\)). The angular difference is normalized: \(\delta = \frac{\delta}{\pi}\).

If A and B are biased and are not capable of generating real random numbers on their own, but they have a conflict of interest, this will cause both A and B to try to maximize or minimize the angular difference, and therefore, producing a semi-random result. Cool!

If the difference \(\delta\) is bigger than \(\pi\), we invert it using \(\delta \rightarrow \delta - \pi\), so the RNG is always capped between 0 to 1.

Discretization

Obviously humans are very inept at generating continuous fake random numbers, and the method above is 1. not very intuitive and 2. not a die and therefore not usable in a vastly simplified D&D campaign. We simplified the algorithm so that both challenges can be solved.

First, we rotate the above polar coordinate by 90deg so that 0 is on the top. Then, we flip it along the y axis so it becomes clockwise. Basically, we turn it into a literal clock. We mark the circle with clock numbers as well.

Two parties come up with a number ranged between \([0, 12)\) simultaneously to avoid the information gap. We then measure their angular difference. For example, A comes up with 2 and B comes up with 10. The angular difference will be 4 in this case. The fake die roll result is then calculated using the angular difference.

... continue reading