# Convert d20 to a d4 mathematically? [closed]

I'm wondering what the simplest way to simulate a d4 with a d20 is.

The easiest I can come up with is to take 1-5 to be a 1, 6-10 to be a 2, 11-15 to be a 3 and 16-20 to be a 4.

I'm wondering if there is a more elegant way. Perhaps one that uses a simple math function? f(x) = 1, 2, 3 or 4?

• Why the DD5 tag ? Commented Sep 27, 2016 at 7:46
• I'm voting to close this question as off-topic because I'm not sure this requires the expertise of the tabletop role-playing game community in order to be answered but should probably be asked over at math.stackexchange Commented Sep 27, 2016 at 7:50
• Since when is the steps of 5 solution less elegant than a math function? Commented Sep 27, 2016 at 8:39

Your solution works, as would any solution that consists in associating 5 figures of the d20 to each one of the d4. If you want to write it as a mathematic function you can write:

f(x) = ⌈x/5⌉

which means you divide by 5 and then round up.

Just for fun, as a technically correct answer but with lots of rolling:

You can roll a d20 until you get 1, 2, 3 or 4 and reroll on all other values.

This answer is more to point out that you can play any dice less than 20 easily by rerolling values that are not allowed. Eg. d17 by rolling a d20 and rerolling 18, 19 or 20. or d4 on d6 by rerolling 5s and 6s.

Simple rule but not simple execution.