# Are non-uniform random distributions allowed?

I posted a challenge that requires programs to generate a random number in a range, and one answer used the rgeom function from R. This function uses a geometric random distribution.

Is this allowed by default for challenges requiring values? I'm inclined to think not, since the dictionary definition in this case is "each [...] elements has equal probability of occurrence". I would assume only uniform (to the extent standard PRNGS are) random distributions are allowed.

# Yes

From the tag wiki: "By default, random does not mean uniformly random, just that all valid outputs are possible."

This is to encourage answers to questions from esolangs where the probability distribution might not necessarily be uniform, or even non-esolang answers with neat tricks to save bytes.

Of course, you can always specify that answers have to be uniform, which would be appropriate in this case since you're talking about (presumably) fair dice rolls.

• I think it's more to support C than esolangs. When your standard library only has "give me a random 32-bit integer" it's quite longwinded to get a uniform element of a set whose size isn't a power of two. – Peter Taylor Apr 15 '19 at 13:10

# Yes (specific to this answer)

The question asks for rolls of n on the uniform n-sided die to be rerolled. We can calculate the expected frequency of each possible number of rerolls and this is given by the geometric distribution. Rather than manually generating uniform rolls as necessary he's just predicting the number of uniform rolls of n that he would have randomly generated.

• Ah, I missed that. Thanks. – Rɪᴋᴇʀ Apr 13 '19 at 3:09