# How do I create BLeeM's "Emphasis Rolls" on Anydice?

Just came across this rolling mechanic in my feed, and wanted to see an actual results table out of curiosity:

https://homebrewery.naturalcrit.com/share/wyL-vuEIDrbC

For the link averse: Roll 2d20, take the number furthest from 10, rerolling when equidistant.

Conceptually, used for dramatic situations, that could either go really well, or really wrong.

Anydice being my resource of choice for such, I made a valiant effort to cajole the site to answer my question, but I do not know the site well enough to ask it in the right way. Anyone out there who can help me?

You can use an empty die to remove an outcome from the probability space, effectively rerolling it an unlimited number of times.

function: bleem A:n and B:n {
BD: [absolute B - 10]
result: A
} else if BD > AD {
result: B
}
result: d{}
}

output [bleem d20 and d20] • Optionally, you can leave out the last line in the function. From the documentation, "If you do not define the result of a function then it will be the empty die." Apr 13 at 4:55
• BTW, as your graph shows, for symmetry it really ought to be furthest from 10.5. But the difference is quite minuscule. Apr 13 at 10:58

### We can compute the probability distribution of the Roll with Emphasis mechanic.

The probability $$\P(D)\$$ to get the result D under the Roll with Emphasis mechanic is given by the formula: $$P(D) = \frac{2|D-10|-1}{181}.$$ Note that this formula us valid for any D expect 10, since there is no possibility under this mechanic to get a result of 10.

The figure below depicts the simulation of 1 million emphasis rolls compared with the theoretical distribution. It is clear that it is slightly favoring rolls on the right of the distribution. For a completely symmetric distribution one should compute the distance between the expected value of a d20, i.e. 10.5. In this case the values that have 0 probability are 10 and 11.

### Mathematical details

Denote with $$\d_a\$$ and $$\d_b\$$ the two rolls, and suppose that we do not get the same outcome or two outcomes that have the same distance from 10. Then, $$\begin{eqnarray*} P(D) &=& P\left(a\mbox{ provides }D\right)\,P\left(dist(b,10) since the two probabilities are the same. Here dist(x,y) denotes the distance between x and y. We have then $$P(D) = 2\frac{1}{20}\frac{2|D-10|-1}{20} = \frac{2|D-10|-1}{200}$$ where $$\|\cdot|\$$ denotes the absolute value. The probability that the "second" roll has a distance from 10 less than D is obtained in the following way: suppose that D >10, the number of outcomes that have a smaller distance from 10 than D are D-10. The symmetric outcome than have the same distance from 10 is 20-D, so we have other 10-(20-D) = D-10 outcomes. The total number is hence 2(D-10)-1: we have to substract 1 because otherwise 10 is counted twice.

Let's try to clarify this step with an example. Suppose D =14, so there are 4 numbers with a distance less than 5 from 10: 13,12,11,10. The symmetric outcome is 6: there are other 4 values to count, namely 7,8,9,10. Hence we have 7 possibilities (recall to discard one 10 from the list). The number of favorable cases can be hence summed up to D-10-1 + 10-D-1 +1 = , and by Denote the probability that we do not have to reroll at the first attempt with $$\Q\$$.

Take now into account that the reroll probability: $$\begin{eqnarray*} P(D) &=& Q +\\ && P\left(\mbox{have to reroll the 1st attempt}\right)Q + \\ &&P\left(\mbox{have to reroll the 1st attempt}\right)P\left(\mbox{have to reroll the 2nd attempt}\right)Q+\\ &&\dots \end{eqnarray*}.$$ Actually, the probability of rerolling is the same for all the attempts and it is independent on the others: let's name it $$\E\$$. This is given by $$E = \frac{20+18}{400} = \frac{38}{400},$$ where in the numerator counts for the 20 couples of rolls with the same number and for the 18 couple of rolls with the same distance from 10 (e.g., (5,15), (3,17), ...), where we discarded the couple (10,10) since it is already included in the previous count; 400 is the number of all the outcomes.

We can write $$\P(D)\$$ as $$\begin{eqnarray*} P(D) &=& Q + QE + QE^2 +QE^3 + \dots\\ &=& Q\sum_{i=0}^\infty E^i\\ &=& \frac{2|D-10|-1}{200}\frac{400}{362}\\ &=& \frac{2|D-10|-1}{181} \end{eqnarray*}.$$

where the sum of the series is a known result. Note that this formula us valid for any D expect 10, since there is no possibility under this mechanic to get a result of 10.

Given that in D&D a roll is to try to make a target AC or better, these graphs do not match the mechanic.

For example, If the AC were 1, and you wanted to roll 1 or better using 2 dice taking the furthest result from 10, no matter the result you would have a 100% chance.

Your graphs do not reflect this, so right off the bat I know these graphs do not reflect the mechanic in the game.

• Hello and welcome to the board! You're answer mentions graphs, was this meant to be a reply to the other answer on this question? Jul 10 at 7:46