PDA

View Full Version : Need a math guy here.



Hyena
2014-02-02, 12:02 PM
I am not especially bright in general, but when it concerns numbers, I might as well be a drooling moron. So, I need help with checking this thought.
Exploding dice. You know the rule - if you roll the maximum number on the die, you roll it again. With that said, is it always better to upgrade your die to a higher one?
Consider this - d6 has a 1/6 chance of getting you 6, which, in turn, gives you another die. So, in 1/6 cases, you will get a number 2-12. But d8 has a 1/8 chance of giving you a maximum number, while giving you a slightly higher number on average roll.
So, which die is better?

mucat
2014-02-02, 12:24 PM
Exploding d8s are better than exploding d6s; in fact, for any die you normally use for an RPG, the higher die value will be better, even for "exploding" dice.

Of course, an exploding d1 gives infinite result, since you keep rolling the top value forever. After that, the average return is:

{table=head]Die|Ordinary Average|"Exploding" Average
d1|1.0|infinite
d2|1.5|3.00
d3|2.0|3.00
d4|2.5|3.33
d6|3.5|4.20
d8|4.5|5.14
d10|5.5|6.11
d12|6.5|7.09
d20|10.5|11.05
...|...|...
dn|(n+1)/2|n(n+1)/2(n-1)
[/table]

For a die with lots and lots of sides, the "exploding" version gives an average result only a half point higher than the non-exploding version.

EDIT: Did you want to see the reasoning behind the equations, or just the result?

reaverb
2014-02-02, 12:36 PM
Can you roll a further dice if you roll the highest value twice in a row?

Assuming that you can't: Yes, it's always better to get a die with more numbers.

Red Bear
2014-02-02, 12:37 PM
Exploding dice. You know the rule - if you roll the maximum number on the die, you roll it again.
and you add the two?
just once or indefinitely? I'll assume just once


Consider this - d6 has a 1/6 chance of getting you 6, which, in turn, gives you another die. So, in 1/6 cases, you will get a number 2-12.

you mean that in 1/6 you will get a number 7-12 (one has to be a 6) right?


With that said, is it always better to upgrade your die to a higher one?
So, which die is better?
Assuming that you want to know which die gives you an higher average:
according to my calculations the the d8 has an average score per roll of 5.0625 while the d6 has 3.861. So the d8 is definitely better, But you should probably wait for someone else to confirm my statement.

Kato
2014-02-02, 12:42 PM
Hm... the slightly tricky thing with exploding dice is that they )often) can explode more than once which make the problem more complicated. But let's look at a simple problem with only one explosion.

Say your die has x sides, making each number 1/x likely to appear, as well as an explosion, and then every "exploded value" 1/x^2 probable.
As the values can be 1,2,...x+1,x+2,..2*x and taking into account each possibility we arrive at an average result of sum(1...x-1)*1/x+sum(x+1...2*x)*1/x^2. It's an easy to prove rule that sum(1...x)=x*(x+1)/2. Putting this into the equation before we arrive at
=(x-1)*x//2*x)+(2*x*(2*x+1)-(x*(x+1)/(2*x^2).
A bit ugly, sorry. But bear with me. We'll solve all the parenthesis and soon it will become obvious:
=(x^2-x)/(2*x)+(4*x^2+2*x-x^2-x)/(2*x^2)
Now we need to... how do you say it in English? Expand?... the first term because the denominator is inequal.
=(x^3-x^2+4*x^2+2*x-x^2-x)/(2*x^2)
We can already see the result but let's add these terms up to make it more obvious.
=(x^3+2*x^2+x)/(2*x^2)
So, as you can see the numerator grows with x^3 and the denominator with x^2, which means if we differentiate the term we will arrive at a positive value (for all x>1): 1/2(1-1/x^2)
Assuming I didn't mess up anything there this tells us as your x grows larger your average result will also get larger. As long as your die doesn't have less than one side :smallwink:


edit: damn you ninjas.
edit2: Geez, I really need to check before I use rules. Made a minor mistake before but the result remains the same. Also, we can easily prove this applies for multiple times exploding die because the next term is always smaller than the previous one... The derivative just gets more terms of (-1/x^n) which doesn't change the fact it will at some point not matter anymore but still never get smaller

Hyena
2014-02-02, 12:58 PM
Yes, the exploding dice can explode more then once.

Razanir
2014-02-02, 02:11 PM
For an n-sided exploding die, the probability of NOT having a reroll is (n-1)/n, so the expected number of rolls is n/(n-1). 1/(n-1) of these will be n, and the last one is any number from 1 to n-1. So the expected value of the non-final rolls is n/(n-1), and the expected value of the final roll is n/2. Add these together and simplify, and you eventually get n(n+1)/(2(n-1)).

So for any size die, making it an exploding die multiplies the expected value by n/(n-1)

{table=head]Die | Normal | Exploding
d2 | 1.5 | 3
d3 | 2 | 3
d4 | 2.5 | 3.333...
d6 | 3.5 | 4.2
d8 | 4.5 | 5.143...
d10 | 5.5 | 6.111...
d20 | 10.5 | 11.053...
d100 | 50.5 | 50.010...
... | ... | ...
dN | (N+1)/2 | N/(N-1) * (N+1)/2
[/table]

Jay R
2014-02-02, 05:09 PM
All of the Razanir's discussion above is correct. If you expand the function to a continuous one, you get:
f(x) = x (x+1)/ (2n-2)
[This is now a mathematical exercise, not limited to dice. There is no such thing as a 2.4-sided die. But by analyzing the function, we can tell what the dice are doing.]

The lowest point on that graph occurs at 2.414213562. That means that starting from a d3, increasing the size of the die always increases the average roll. The increase from a dn to a d(n+1) is 0.5 - 1/n(n-1).

As n grows large the difference between two adjacent numbers gets closer and closer to 1/2.

Tengu_temp
2014-02-02, 05:11 PM
Dice increases are better even with multiple exploding dice. Let me give you several examples:

To get a roll of 7, you need to roll 6 on a 1d6, and then any result on the exploding die. The odds are 1/6, or 16.67%.
To get a roll of 7, you simply need to roll 7 or higher on a 1d8. The odds are 2/8, or 25%.

To get a roll of 10, you need to roll 6 on a 1d6, and then 4 or more on the exploding die. The odds are (1/6)*(3/6), or 8.33%.
To get a roll of 10, you need to roll 8 on a 1d8, and then 2 or more on the exploding die. The odds are (1/8)*(7/8), or 10.94%.

To get a roll of 13, you need to roll 6 on a 1d6, 6 on the exploding die, and anything on the second exploding die. The odds are (1/6)*(1/6), or 2.78%.
To get a roll of 13, you need to roll 8 on a 1d8, and then 5 or more on the exploding die. The odds are (1/8)*(4/8), or 6.25%.

To get a roll of 17, you need to roll 6 on a 1d6, 6 on the exploding die, and 5 or more on the second exploding die. The odds are (1/6)*(1/6)*(2/6), or 0.93%.
To get a roll of 17, you need to roll 8 on a 1d8, 8 on the exploding die, and anything on the second exploding die. The odds are (1/8)*(1/8), or 1.56%.

To get a roll of 19, you need to roll 6 on a 1d6, 6 on the exploding die, 6 on the second exploding die, and anything on the third exploding die. The odds are (1/6)*(1/6)*(1/6), or 0.46%.
To get a roll of 19, you need to roll 8 on a 1d8, 8 on the exploding die, and 3 or more on the second exploding die. The odds are (1/8)*(1/8)*(6/8), or 1.17%.

I purposely picked numbers where 1d6 could have an advantage. As you can see, the higher die always has better odds. This stays true no matter which dice we compare.

Eloel
2014-02-02, 05:20 PM
Alternative explanation for the above result:

say f(n) is the average result for dice with n sides.

then;

f(n) = 1*1/n + 2*1/n + .... + (n-1)*1/n + (n + f(n)) * 1/n

since there is 1/n chance of getting 1, 1/n chance of getting 2 ...
there also is a 1/n chance that we get n AND another complete rolling procedure.

When we rearrange the above equation, we get

n * f(n) = n(n+1) / 2 + f(n)

which is

(n-1) * f(n) = n(n+1)/2

which is

f(n) = n(n+1)/(2(n-1))