# Is it possible to make this die probability work?

My best friend and I are doing a thing for a d&d game that involves potentially destroying the universe. This event will occur rarely, but we want to make it show up randomly (because it’s a thought experiment, not something that’s actually going to show up in a game one of us runs).

This event will be represented by a special d20, which is actually an expression rather than a die of its own (it’s using the Dice Maiden discord bot).

We’d like to make an expression of dice (eg: [1d20*4]/[5-1d5]) that has a small chance (less than 5%) of destroying the universe (read: dividing by 0), which otherwise acts as close to a normal d20 as possible (in the range of values and in the distribution of those values, at least).

This means: the range of values, most of the time, should be all integers between 1-20 inclusive. Each integer should occur with equal probability. If the die errors, it is because the result of the roll involved dividing by 0, and this should occur no more than 5% of the time (approximately). What is a valid Dice Maiden Discord bot command that would give 5% or less chance of failing due to a divide-by-0 error, while otherwise acting like a normal d20?

The closest thing we have so far is (d20)/(d20-1), which gives the right range of values and has probability of destroying the universe 5%, but that clusters around 0 and 1 rather than having a result that is distributed evenly (average result is 10.5/9.5 = 1.10, rather than 10.5 like a d20 should have).

• I'm not sure I'm understanding this right. You want a 5% of destroying the earth, and all other results don't destroy the earth? May 13, 2021 at 15:13
• Is there a reason you cannot do 1d20 / 1d{0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1} May 13, 2021 at 15:17
• Ah, maybe you should specify more clearly that the implementation needs to work using the Dice Maiden Discord Bot. I'll have to look into the Bot to see how it works May 13, 2021 at 15:22
• I do not understand if the range should be like a d20 or not, since you write otherwise acts as close to a normal d20 as possible (in the range of values and in the distribution of those values, at least) but d20/(d20-1) can not have the same range value of a d20 May 13, 2021 at 15:25
• So, what exactly would this die be used for? What is its purpose? What role is it filling that requires it exist? May 13, 2021 at 19:09

# Roll two d20's.

## The other is the cataclysm die.

To implement in Dice Maiden, use

!roll 1d20/(1d20 t2)

The first d20 is our regular roll. The second d20 in the denominator does the magic. (1d20 t2) rolls 1d20 and counts the number of dice which have a result greater than or equal to 2. t2 could be translated as "take dice which roll at least 2 as successes (and return the number of successes)", or "test dice for if they are at least 2, treating them as 1 if true or 0 if false". In normal use it would mostly be used for dice pool mechanics.

If the second d20 is anything other than a natural 1, the expression (1d20 t2) will evaluate to 1. The overall result will be 1d20/1 which is, of course, a regular d20 roll. If the second d20 is a natural 1, the denominator will be zero and cause a divide by zero error.

You can adjust the probability of a cataclysm to any arbitrary value by adjusting the die rolled in the denominator and the threshold for it to be a success. For example, a 42% chance of cataclysm can be given by (1d100 t43).

You can also change the "normal" roll to anything you like by changing the numerator.

### !roll 1d21-1

This gives the numbers 1-20 a uniform distribution, each having a 4.76% chance of coming up, and a 4.76% chance of rolling a 0 that destroys the universe. (Or just don’t bother with the “-1” and call a 21 a cataclysm). In Dice Maiden, this is as easy as :

 !roll 1d21-1


And Dice Maiden will output:

 thomasmarkov Roll: [15] Result: 14 Request: [1d21-1]


And the AnyDice graph:

• For posterity: this was a correct answer to the original question (which included a zero result as an error), but upon further clarification the questioner is seeking specifically a result that crashes via a divide by zero error without modifying the normal d20 probability distribution otherwise. So please don't downvote this answer or comment that it's incorrect :)
– ESCE
May 15, 2021 at 3:59