Advantage: Difference between revisions

Jump to navigation Jump to search
(math -> math_block)
("adv" notation is no longer used. fixed minor typos. Math is always beautiful ;) (but yes, this looks better))
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 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}}.
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, 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 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.
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.
Line 94: Line 94:
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 {{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
{{math_block|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} }}  
{{math_block|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} }}  
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 D{{math|n}} we get
{{math_block|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}}
{{math_block|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 {{math|1=\sum_{i=1}^n i^2 = \frac{1}{6}n(n + 1)(2n + 1)}}, which gives
Here we can use that the sum of squares is {{math|1=\sum_{i=1}^n i^2 = \frac{1}{6}n(n + 1)(2n + 1)}}, which gives
{{math_block|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} }}
{{math_block|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}{2n} = \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
{{math_block|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) }}
{{math_block|1= \mathbb{E}[\text{D}n \text{ with advantage}] - \mathbb{E}[\text{D}n] = \frac{2n}{3} + \frac{1}{2} - \frac{1}{6n} - \frac{n + 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'''.