Advantage: Difference between revisions

Jump to navigation Jump to search
671 bytes added ,  23 November 2023
Replaced hideous math formatting with proper MathML. LaTeX is love. LaTeX is life.
(added the Language of The Universe, i.e. math)
(Replaced hideous math formatting with proper MathML. LaTeX is love. LaTeX is life.)
Line 85: Line 85:
A more general way of looking at advantage/disadvantage is calculating the effect on the average of dice rolls. This makes it more broadly applicable than looking at specific rolls and makes it easier to compare to other bonuses and penalties which may apply to a roll.
A more general way of looking at advantage/disadvantage is calculating the effect on the average of dice rolls. This makes it more broadly applicable than looking at specific rolls and makes it easier to compare to other bonuses and penalties which may apply to a roll.


For this we first need to clarify the notations used in formulas: ''P(a)'' is the chance that a variable has value ''a'', ''_adv'' means "with advantage", and ''Σ(i=a,b)(x_i)'' denotes the sum of a series of numbers ''x'' over an index ''i'' with ''i'' going from ''a'' through ''b''. For example, the sum of all numbers on a D6 would be written as ''Σ(i=1,6)(i)''.
For this we first need to clarify the notations used below: D{{math|n}} represents an {{math|n}}-sided die, {{math|P(i)}} is the probability that a variable has value {{math|a}}, {{math|\mathbb{E} }} denotes the average or expected value of a roll, the subscript "adv" means "with advantage", and {{math|1=\textstyle\sum_{i=a}^b x_i}} denotes the sum of a series of numbers {{math|x}} over an index {{math|i}} with {{math|i}} going from {{math|a}} through {{math|b}}.


The formula to calculate the average, ''<x>'', of a variable ''x'' is equal to the sum of every possible value of ''x'' multiplied by the chance for ''x'' to have that value. ''<x> = Σ(i=a,b)(x_i * P(x_i))''.
The formula to calculate the expected value, {{math|\mathbb{E}[x]}}, of a variable {{math|x}} is equal to the sum of every possible value of {{math|x}} multiplied by the chance for {{math|x}} to have that value.
 
In the case of an {{math|n}}-sided die, D{{math|n}}, this becomes:
To calculate the average of any die, Dx, this becomes:
* {{math|1=\mathbb{E}[\text{D}n] = \sum_{i=1}^n (i \cdot P(i))}}
* ''<Dx> = Σ(i=1,x)(i * P(i))''
For a regular dice roll the probability distribution is uniform, which means {{math|1=P(i) = 1/n}} for any {{math|i}}, and using {{math|1=\textstyle\sum_{i=1}^n i = \frac{n(n+1)}{2} }}, we get  
For a regular dice roll the chance distribution is homogenous, which means ''P(i) = 1/x'' for any ''i'', and using ''Σ(i=1,n)(i) = n * (n+1)/2'', we get  
* {{math|1=\mathbb{E}[\text{D}n] = \sum_{i=1}^n(i \cdot P(i)) = \frac{1}{n}\left(\frac{n(n+1)}{2}\right) = \frac{n+1}{2} }}
* ''<Dx> = Σ(i=1,x)(i * P(i)) = x * (x + 1)/2 * 1/x = (x + 1)/2''
For a dice roll with advantage the chance to roll the number {{math|i}} is equal to the chance that the first die rolls {{math|i}} multiplied by the chance that the second die rolls {{math|i}} or less, multiplied by 2 (because the 2 dice are interchangeable), minus the chance of both dice rolling {{math|i}} (because we counted that possibility twice by multiplying by 2). This gives
For a dice roll with advantage the chance to roll the number ''i'' is equal to the chance that the first die rolls ''i'' multiplied by the chance that the second die rolls ''i'' or less, multiplied by 2 (because the 2 dice are interchangeable), minus the chance of both dice rolling ''i'' (because we counted that possibility twice by multiplying by 2). This gives
* {{math|1=P_\text{adv}(i) = 2P(i)\sum_{j=1}^i P(j) - P(i)^2 = 2\frac{1}{n} \cdot \frac{i}{n} - \frac{1}{n^2} = \frac{2i - 1}{n^2} }}
* ''P_adv(i) = 2 * P(i) * Σ(j=1,i)(P(j)) - P(i)² = 2 * 1/x * i/x - 1/x² = (2i - 1)/x²''
Applying that to the formula of an average of a die Dx we get
Applying that to the formula of an average of a die Dx we get
* ''<Dx>_adv = Σ(i=1,x)(i * (2i - 1)/x²) = 2/x² * Σ(i=1,x)(i²) - 1/x² * Σ(i=1,x)(i)''
* {{math|1=\mathbb{E}[\text{D}n \text{ with advantage}] = \sum_{i=1}^n i \cdot\frac{2i - 1}{n^2} = \frac{2}{n^2} \cdot \sum_{i=1}^n i^2 - \frac{1}{n^2} \cdot \sum_{i=1}^n i}}
Here we can use that the sum of squares is ''Σ(i=1,n)(i²) = n * (n + 1) * (2n + 1)/6'', which gives
Here we can use that the sum of squares is {{math|1=\textstyle\sum_{i=1}^n i^2 = n(n + 1)(2n + 1)/6}}, which gives
* ''<Dx>_adv = 2/x² * x * (x + 1) * (2x + 1)/6 - 1/x² * x * (x + 1)/2 = 2x/3 + 1 + 1/3x - 1/2 - 1/2x = 2x/3 + 1/2 - 1/6x''
* {{math|1= \mathbb{E}[\text{D}n \text{ with advantage}] = \frac{2}{n^2}\left(\frac{n(n+1)(2n+1)}{6}\right) - \frac{1}{n^2}\left(\frac{n(n+1)}{2}\right) = \frac{2n}{3} + 1 + \frac{1}{3n} - \frac{1}{2} - \frac{1}{n} = \frac{2n}{3} + \frac{1}{2} - \frac{1}{6n} }}
To know what bonus having advantage gives to our roll, we calculate
To know what bonus having advantage gives to our roll, we calculate
* ''<Dx>_adv - <Dx> = 2x/3 + 1/2 - 1/6x - (x + 1)/2 = (x - 1/x)/6''
* {{math|1= \mathbb{E}[\text{D}n \text{ with advantage}] - \mathbb{E}[\text{D}n] = \frac{2n}{3} + \frac{1}{2} - \frac{1}{6n} - \frac{x + 1}{2} = \frac{1}{6}\left(n - \frac{1}{n}\right) }}
When we apply this elegant expression to a D20 we get that '''having advantage is equivalent to an average bonus of +3.325'''.
When we apply this elegant expression to a D20 we get that '''having advantage is equivalent to an average bonus of +3.325'''.


Because of symmetry, having disadvantage instead of advantage means we can simply make the permutation of ''{1 ... x} {x ... 1}'' for the values of dice rolls and all the calculations will remain the same. Therefore the size of the bonus of advantage is equal to the size of the penalty of disadvantage.  
Because of symmetry, having disadvantage instead of advantage means we can simply make the permutation of {{math|\{1, \dots, n\} \to \{n, \dots, 1\} }} for the values of dice rolls and all the calculations will remain the same. Therefore the size of the bonus of advantage is equal to the size of the penalty of disadvantage.


==Application: [[Savage Attacker]]==
==Application: [[Savage Attacker]]==

Navigation menu