View Full Version : Math in the playground

shadow_archmagi

2013-10-11, 01:06 PM

So, as we all play RPGs, we've all probably encountered dice, and, by extension, probabilities. Now, it's pretty easy to say that 2d6 averages 7, or that if you hit half the time for an average of 7 damage your average damage per round is 3.5. That's all nice and easy.

But there are a lot of RPG rules that play havoc with that. Partial rerolls, roll and keep, or roll and keep systems, for example.

What can you do to analyze probabilities when these kinds of factors are in play?

EXAMPLE (note: This isn't a real game I'm in, I'm not actually interested in the answer so much as the techniques used to derive it): I'm playing in a game of Legend of the Five Rings. When attacking, my character gets to roll 5d10, and keep the highest 3 dice. Also, 10s get rerolled and the new value is added to the old.

First off, how the heck do I calculate the average. Then, let's say I get to choose between four new skills: One adds +5 to the total, one lets me roll two extra die, and one lets me keep an extra die, and one lets me reroll two existing die (not summing their values like with the 10s, just rerolling normally). How do I determine which one will have the greatest impact?

warty goblin

2013-10-11, 03:22 PM

XdY keep the highest Z is just a basic order statistics problem. Google is your friend here; that should net you the joint probability mass distribution function. Then the sum is a convolution of that (ugly), and the average is just the plain old average.

I can maybe work it out for you in generality later, when I don't have a raging headache from redoing a week's worth of code thanks to somebody else's screw-up.

factotum

2013-10-12, 03:47 AM

The other way to do it is to write a quick Excel (or OpenOffice Calc) macro that rolls the dice 100,000 times and puts the results into a spreadsheet for perusal. Yes, this isn't going to quite be the same on a computer as it would be actually rolling the dice due to the computer generating its numbers pseudo-randomly, but the result should be good enough for government work, as they say!

Reltzik

2013-10-12, 03:53 AM

Yeah, that's stuff easy.

For the REALLY fun stuff, consider things like "I've got my wizard, what spells do I memorize not knowing what we'll come up against, and then what order do I cast them knowing this encounter has THIS monster but not knowing if the DM's going to mix up monster types or just have this be the dungeon theme? Do I go full blast early or keep a reserve? What spells do THEIR casters have prepped?"

That's game theory. With incomplete information. FUN!

((To really answer your original question, I need to know what happens if you get 4 tens. Do you reroll, add, and discard the lowest, or do you discard one of the tens and then roll again? Also, what happens if you roll a 10 the second time? Do you keep rolling? Also, your skill choices depend on how you feel about variance and deviation. Is a slightly lower average an acceptable tradeoff for less predictability? Is being able to control when you get a boost from, say, a reroll worth a lower average if you can get that extra oomph on the one roll where it really counts? If so, how much is that worth and how much of your average will you trade away for it?))

shadow_archmagi

2013-10-12, 06:56 AM

The other way to do it is to write a quick Excel (or OpenOffice Calc) macro that rolls the dice 100,000 times and puts the results into a spreadsheet for perusal. Yes, this isn't going to quite be the same on a computer as it would be actually rolling the dice due to the computer generating its numbers pseudo-randomly, but the result should be good enough for government work, as they say!

That sounds like a great easy way to do it. How would one tell Excel to do something like this? I know it has a random function, but I don't know how to do a roll'n'keep or reroll lowest on Excel.

That's stuff easy

I'm glad to hear it! I went with these questions to my college's stats tutoring center and they seemed to believe that calculating the distribution of something like that would involve more complex math than anyone without a lot of advanced training was capable of, and said that I could go talk to the stats professor in charge of probability, but she probably wouldn't be able to help me because the calculations would be so complicated.

((To really answer your original question, I need to know what happens if you get 4 tens. Do you reroll, add, and discard the lowest, or do you discard one of the tens and then roll again? Also, what happens if you roll a 10 the second time? Do you keep rolling?

Exploding tens would be calculated first, since those aren't true rerolls- Rolling a 10 and then a 7 is treated as though you'd somehow managed to make "17" come up on a ten sided die. 10s can indeed continue to explode, so rolling 10-10-10-6 would be considered rolling a 36 on that die.

Also, your skill choices depend on how you feel about variance and deviation. Is a slightly lower average an acceptable tradeoff for less predictability? Is being able to control when you get a boost from, say, a reroll worth a lower average if you can get that extra oomph on the one roll where it really counts? If so, how much is that worth and how much of your average will you trade away for it?))

Well, what I'd really like is access to the tools needed to see the data for myself, since this scenario is purely hypothetical, and how I feel about variability would depend on the risks and rewards involved with any given type of check.

shawnhcorey

2013-10-12, 10:38 AM

Or just play Fate. :smallwink:

Exploding d10:

roll probability

1 - 9 1/10

11 - 19 1/100

21 - 29 1/1,000

31 - 39 1/10,000

...

(Stop when you get tired.)

You will notice some numbers missing. With exploding dice, these are impossible to get.

Manga Shoggoth

2013-10-12, 11:01 AM

That sounds like a great easy way to do it. How would one tell Excel to do something like this? I know it has a random function, but I don't know how to do a roll'n'keep or reroll lowest on Excel.

This is where you would start writing your own functions. a few Visual Basic for Applications functions will give you all the flexibility you need.

EDIT: If you really need something like this I can probably knock it together. You'll need to say exactly what you need, though...

EDIT the Second: Just coded up the basic Roll 5/Add d10 to tens/Keep the top Three (I'm bored...): It seems to be averaging out at 24.1733

(Provided I am coding right...)

Reltzik

2013-10-12, 01:16 PM

I'm glad to hear it! I went with these questions to my college's stats tutoring center and they seemed to believe that calculating the distribution of something like that would involve more complex math than anyone without a lot of advanced training was capable of, and said that I could go talk to the stats professor in charge of probability, but she probably wouldn't be able to help me because the calculations would be so complicated.

Oh heavens no, you don't need complex math. I suppose you could do something with moments and fourier transforms, but they're not necessary.

Exploding tens would be calculated first, since those aren't true rerolls- Rolling a 10 and then a 7 is treated as though you'd somehow managed to make "17" come up on a ten sided die. 10s can indeed continue to explode, so rolling 10-10-10-6 would be considered rolling a 36 on that die.

Shawn got the distribution on a single (potentially exploding) roll right. We can actually consider this two variables: A) What's the roll that we terminate on? (the one that isn't 0). B) How many 0s do we roll first? We take A and add it to 10^B for our result, and because the sum of the expected value of each of these will give us the expected value of the sum, calculating the average easy. A is a uniform integer distribution on [1,9] and has an average of 5. B can be calculated by geometric series. There's a 90% chance that B = 0, a 9% chance that B = 1, a 0.9% chance that B = 2, and so on, which gives us a series of .9*0 + .09*10 + .009*100 + holy crap that's just .9 added to itself forever the expected value of this roll is fricking INFINITE.

.... excuse me. I'm going to go bash my head against the wall and contemplate the idiocy of game designers.

But no, wait, you're contending against a fixed number of hit points, aren't you? So if the schmuck has 28 HP, your range of outcomes is something like "I do 3, 4, 5, 6, etc points of damage", except the range of outcomes doesn't actually go on to infinity but instead terminates as "... 26 points, 27 points, DEAD AND I DON'T CARE WHETHER IT WAS 28 POINTS OR 28 MILLION).

.... okay. You probably do care. Because that would be awesome.

In any event, that distribution for a single die is pretty easy to build up. I'll be back later to process multiple dice (and discarding low rolls) if someone else doesn't get to it.

That sounds like a great easy way to do it. How would one tell Excel to do something like this? I know it has a random function, but I don't know how to do a roll'n'keep or reroll lowest on Excel.

Well, I wouldn't use excel but a proper programming language like python (if and while commands are your best friend) but maybe that's just because I'm more used to it but if you get into the basics of programming that's something you can pretty fast put together. A system I play (The Dark Eye) also has rules which make it kind of hard to estimate the chances of success at first glance and at some point I had thrown together a program to calculate it just by rolling a few thousand rolls. I misplaced it but I think it shouldn't take more than an hour to put this together, probably much less.

Good chance to learn some programming, too.

factotum

2013-10-12, 02:50 PM

which gives us a series of .9*0 + .09*10 + .009*100 + holy crap that's just .9 added to itself forever the expected value of this roll is fricking INFINITE.

.... excuse me. I'm going to go bash my head against the wall and contemplate the idiocy of game designers.

Rolemaster RPG system had a similar thing--everything in that game was done via d100, but the rule was that you re-rolled and added to the original on a 95 or greater (I think, it's a long time since I played the game), and rolled and subtracted if you got less than 5. This was the game I was playing on the glorious occasion where I managed something like 358 on a roll. :smallsmile:

Of course, the "infinite maximum" issue wasn't an issue in Rolemaster, because the result of your roll was used as an index into a table which told you exactly what happened--I think those tables topped out at 400 or thereabouts, so there was no point rolling if you went past that point. (For some reason, when rolling d100 on the critical hit tables, 66 was always the worst one--you really didn't want to roll that if you'd just sustained an E (e.g. the worst possible) critical, because they were always instantly fatal!

Manga Shoggoth

2013-10-12, 03:08 PM

OK. These are the results I have come up with (rolling the dice a given number of times).

{table=head] Method | Average

Number of Iterations | 10,000

Basic Throw 5/Keep 3 | 24.10

Basic Throw 5/Keep 3 + 5 | 29.29

Basic Throw 5/Keep 3 + 2d10 | 35.28

Throw 5/Keep 4 | 28.22

Throw 5 Reroll 2 Keep 3 | 26.61

[/table]

The Excel spreadsheet in question is available on request should you wish to check my code (and should be fairly easy to expand if you want to fiddle more...).

(Edit: The spreadsheet doesn't do the exploding tens, it just adds an extra roll if you get a ten. I'll add that later...)

(Edit 2: That was quick... Now with exploding tens...

{table=head] Method | Average

Number of Iterations | 10,000

Basic Throw 5/Keep 3 | 24.46

Basic Throw 5/Keep 3 + 5 | 29.47

Basic Throw 5/Keep 3 + 2d10 | 35.50

Throw 5/Keep 4 | 28.37

Throw 5 Reroll 2 Keep 3 | 28.19

[/table]

The exploding tens don't make much of a difference as they don't occur too often - the chances of getting two tens in a row are relatively insignificant)

Huh, for some curious reason the impact of the exploding tens on the last row seems to be massively bigger than on anything else. I wonder why that is?

Great, now I feel compelled to also write a program to check those numbers :smallsigh: Not that I dont trust Manga, I just think it would be "fun". (And by that I mean I need to satisfy my compulsions)

shadow_archmagi

2013-10-12, 05:12 PM

The Excel spreadsheet in question is available on request should you wish to check my code (and should be fairly easy to expand if you want to fiddle more...).

Oh, I'd love that!

Hm.... my results differ quite a bit more than expected from Manga's... Admittedly, I won't say my code couldn't be bugged and I entirely ignored double exploding dice but it still seems off to me. I'll post my numbers:

{table=head] Method | without explosions | with explosions

Basic Throw 5/Keep 3 | 20.49 | 22.75

Basic Throw 5/Keep 3 + 5 | 25.49 | 27.75

Basic Throw 5/Keep 3 + 2d10 | 30.52 | 33.64

Throw 5/Keep 4 | 23.65 | 25.92

Throw 5 Reroll 2 Keep 3 | 22.89 | 26.05

[/table]

I would look for the error on my part first but thinking about it even with the pick of best dice, an average of 24 seems high, considering you'd have 3*5.5=16.5 average without it. I'm confused what's to blame.

Manga Shoggoth

2013-10-12, 06:16 PM

Oh, I'd love that!

Sure. PM me with an email address and I'll send it on. It will be at least tomorrow as I need to go to bed now...

Hm.... my results differ quite a bit more than expected from Manga's... Admittedly, I won't say my code couldn't be bugged and I entirely ignored double exploding dice but it still seems off to me.

...

I would look for the error on my part first but thinking about it even with the pick of best dice, an average of 24 seems high, considering you'd have 3*5.5=16.5 average without it. I'm confused what's to blame.

There were a few bugs in my code (It isn't the best piece of coding I have ever been guilty of, and was rather rushed). For what it is worth, my basic functions are:

Function fnThrow5(pintKeep As Integer, pintExchange As Integer) As Integer

'

' This function returns a dice roll as follows:

'

' - Throw 5 d10

' - If any value is a 10, then add an additional d10. Exploding D10s this time.

' - Only use the top X values

'

Dim arrDice(5) As Integer

Dim intI As Integer

Dim intTempValue As Integer

Dim bClear As Boolean

Dim intExtraD10 As Integer

'

' First, throw the five dice.

'

For intI = 1 To 5

arrDice(intI) = Int(Rnd() * 10) + 1

Next intI

' Debug.Print "Base", arrDice(1), arrDice(2), arrDice(3), arrDice(4), arrDice(5)

'

' If a number is a 10, then add an additional d10

'

For intI = 1 To 5

If arrDice(intI) = 10 Then

Do

intExtraD10 = Int(Rnd() * 10) + 1

arrDice(intI) = arrDice(intI) + intExtraD10

Loop Until intExtraD10 <> 10

End If

Next intI

' Debug.Print "Post 10", arrDice(1), arrDice(2), arrDice(3), arrDice(4), arrDice(5)

'

' Now sort the values (a basic bubble sort is our friend here)

'

Do

bClear = True

For intI = 1 To 4

If arrDice(intI) < arrDice(intI + 1) Then

intTempValue = arrDice(intI)

arrDice(intI) = arrDice(intI + 1)

arrDice(intI + 1) = intTempValue

bClear = False

End If

Next intI

Loop Until bClear

' Debug.Print "Sort 1", arrDice(1), arrDice(2), arrDice(3), arrDice(4), arrDice(5)

'

' Replace the bottom X dice with new throws and resort

' (We assume that if this is done both the dice must be replaced

' even if they are >10. We do the lowest dice as it would not make

' sense to rethrow the higher ones)

'

If pintExchange > 0 Then

For intI = 1 To pintExchange

arrDice(5 - (intI - 1)) = Int(Rnd() * 10) + 1

Next intI

For intI = 1 To pintExchange

If arrDice(5 - (intI - 1)) = 10 Then

Do

intExtraD10 = Int(Rnd() * 10) + 1

arrDice(5 - (intI - 1)) = arrDice(5 - (intI - 1)) + intExtraD10

Loop Until intExtraD10 <> 10

End If

Next intI

' Debug.Print "Exchange", arrDice(1), arrDice(2), arrDice(3), arrDice(4), arrDice(5)

Do

bClear = True

For intI = 1 To 4

If arrDice(intI) < arrDice(intI + 1) Then

intTempValue = arrDice(intI)

arrDice(intI) = arrDice(intI + 1)

arrDice(intI + 1) = intTempValue

bClear = False

End If

Next intI

Loop Until bClear

' Debug.Print "Sort 2", arrDice(1), arrDice(2), arrDice(3), arrDice(4), arrDice(5)

End If

'

' Now that we have our sorted array, sum the highest X values.

'

intTempValue = 0

For intI = 1 To pintKeep

intTempValue = intTempValue + arrDice(intI)

Next intI

'

' Pass the values back to the caller.

'

fnThrow5 = intTempValue

End Function

And to call it (This pulls the number of iterations from the Control worksheet and writes all the numbers generated to the Numbers worksheet - the averages are then generated by the standard worksheet functions, but you don't see that here...):

'

' Pull the number of iterations from the worksheet, and let the dice roll

'

' Column 1 is the basic Throw 5/Keep 3

' Column 2 is the basic Throw 5/Keep 3 plus 5

' Column 3 is the basic Throw 5/Keep 3 plus 2d10

' Column 4 is Throw 5/Keep 4

' Column 5 is the basic Throw 5/Keep 3 rethrowing the last two without bonus

'

lngIterations = Sheets("Control").Cells(3, 3).Value

For lngI = 1 To lngIterations

Sheets("Numbers").Cells(lngI, 1) = fnThrow5(3, 0)

Sheets("Numbers").Cells(lngI, 2) = fnThrow5(3, 0) + 5

Sheets("Numbers").Cells(lngI, 3) = fnThrow5(3, 0) + Int(Rnd() * 10) + 1 + Int(Rnd() * 10) + 1

Sheets("Numbers").Cells(lngI, 4) = fnThrow5(4, 0)

Sheets("Numbers").Cells(lngI, 5) = fnThrow5(3, 2)

Next lngI

warty goblin

2013-10-12, 07:37 PM

O A is a uniform integer distribution on [1,9] and has an average of 5. B can be calculated by geometric series. There's a 90% chance that B = 0, a 9% chance that B = 1, a 0.9% chance that B = 2, and so on, which gives us a series of .9*0 + .09*10 + .009*100 + holy crap that's just .9 added to itself forever the expected value of this roll is fricking INFINITE.

.... excuse me. I'm going to go bash my head against the wall and contemplate the idiocy of game designers.

I think this is more a flaw of using expected value as a summary statistic for extremely skewed distributions. Infinitesimal chances of absurdly large outcomes don't, except in the measure theoretic definition, really tell you anything about what will or will not happen.

Reltzik

2013-10-12, 08:16 PM

I think this is more a flaw of using expected value as a summary statistic for extremely skewed distributions. Infinitesimal chances of absurdly large outcomes don't, except in the measure theoretic definition, really tell you anything about what will or will not happen.

It's true that the expected value isn't that great a measure in this case, but discovering that it's infinite does shed some light on why "plug the formula into a computer and have it chug through a few million iterations" isn't going to give usable results.

EDIT: To answer the OP's original question, there isn't any "do this and it works" algorithms or tools. If there were, all statistics people would have been replaced by computers by now. A lot of the problem here is figuring out what to ask, eg, "what's the average damage" proved a bad question to ask but "what are the odds I'll do at least ____ damage" was better. I think what you'd find most useful are cumulative distribution graphs for each roll, overlaid for comparison.

valadil

2013-10-12, 08:55 PM

Of course, the "infinite maximum" issue wasn't an issue in Rolemaster, because the result of your roll was used as an index into a table which told you exactly what happened--I think those tables topped out at 400 or thereabouts, so there was no point rolling if you went past that point.

Couldn't you lower yourself back to table territory with bad rolls though? ie, if you're at 500 and roll under 05 for a few rolls, you'd go back down.

Douglas

2013-10-12, 09:07 PM

There's a 90% chance that B = 0, a 9% chance that B = 1, a 0.9% chance that B = 2, and so on, which gives us a series of .9*0 + .09*10 + .009*100 + holy crap that's just .9 added to itself forever the expected value of this roll is fricking INFINITE.

.... excuse me. I'm going to go bash my head against the wall and contemplate the idiocy of game designers.

Except the portion of the outcome from B is not 10^B, but merely 10*B. It's the sum of .9*0 + .09*10 + .009*20 + .0009*30, etc., which is most certainly not infinite. This is a bit messy of a series to calculate the sum of, but there's an easier way to solve the problem.

If B is the number of 0s you get on the exploding die, you have a 90% chance of B = 0 and a 10% chance of starting over and adding 1.

Bavg = (.9 * 0) + (0.1 *(1 + Bavg))

Bavg = 0.1 + .1*Bavg

0.9*Bavg = 0.1

Bavg = 0.1/0.9 = 1/9

B averages 1/9, and you get 10*B added to the total, so average 10/9. Add the average of the final die, and you get an average total of 6.1111111111111...

Manga Shoggoth

2013-10-13, 04:41 AM

It's true that the expected value isn't that great a measure in this case, but discovering that it's infinite does shed some light on why "plug the formula into a computer and have it chug through a few million iterations" isn't going to give usable results.

You are missing something here - although you could get an infinite number of rolls here, the additional roll requires you to get a 10 on a d10, and every additional bonus roll also expects you to get a 10 to continue.

This is why the "plug the formula in a computer" - aka simulation - approach works - it shows you very quickly how the rolls will work in practice, without having to throw the dice X thousand times. Simulation is a powerful tool, whether done by computers or real models.

And what it shows is that over time the lower and more likley results dominate. It is true that you could get an infinite series of 10s. It is also true that brownian motion could cause all the oxygen molecules to drift over to the opposite end of the room - theoretically possible, but not going to happen in my lifetime. Not more than once, anyway.

In practice, you very quickly get up to a maximum of 4 bonus throws in a roll (by around 500 iterations, in fact), but after that an increase in the maximum number drops off sharply - in 10,000 iterations, the longest bonus chain I have seen is 7, and most runs yeild 5 or occasionally 6.

The spreadsheet I was using had auto-calculation turned on, so I could see the average values change as the spreadsheet went through the rolls. The average stablises very quickly - somewhere between 500 and 1000 the first two significant figures are stable, and between 1000 and 10000 the first decimal place stablises.

The maxima and minima also "stablise" very quickly - pretty stable by the 500 and 1000 mark, and very stable past the 5000 mark.

EDIT: To answer the OP's original question, there isn't any "do this and it works" algorithms or tools. If there were, all statistics people would have been replaced by computers by now. A lot of the problem here is figuring out what to ask, eg, "what's the average damage" proved a bad question to ask but "what are the odds I'll do at least ____ damage" was better. I think what you'd find most useful are cumulative distribution graphs for each roll, overlaid for comparison.

EDIT: Having added distributions to the spreadsheet - unsurprisingly the distribution is somewhat skewed, shifted to the lower end of the spectrum. I really need to get out more...

factotum

2013-10-13, 07:18 AM

Couldn't you lower yourself back to table territory with bad rolls though? ie, if you're at 500 and roll under 05 for a few rolls, you'd go back down.

You're probably right...I don't think the situation ever arose, though, so I don't actually know what the rules for dealing with it were.

Razanir

2013-10-13, 09:32 AM

First off, how the heck do I calculate the average. Then, let's say I get to choose between four new skills: One adds +5 to the total, one lets me roll two extra die, and one lets me keep an extra die, and one lets me reroll two existing die (not summing their values like with the 10s, just rerolling normally). How do I determine which one will have the greatest impact?

However, there's another stat not a play here. The variance.

Pretend there are two abilities available. One has you roll 13d6, the other has you roll 7d12. Both give you an expected roll of 45.5, but you're more likely to roll closer to that on the 13d6. This is where the variance comes in. The variance of the first one is 13²*(6²-1)/12 = 493. The variance of the second one is 7²*(12²-1)/12 = 584. (Okay, so those aren't too different, but you get the point)

The catch is, though, that the variance involves averaging the squares of the values, which in this case is particularly nasty. I'll get back possibly later today, possibly in a day or two with a solution. (Real-life stuff getting in the way)

Oh, and for anyone else with knowledge of advanced stats, my plan is to use moment generating functions.

warty goblin

2013-10-13, 10:06 AM

Really, what you want is an expression for the actual distribution, or at least a histogram from a decent number of simulations to estimate the CDF. This is a probability problem, not a statistics question, so there's really very little reason to mess around with summary statistics of any sort.

AttilaTheGeek

2013-10-13, 10:21 PM

How has Anydice (http://anydice.com/) not been mentioned? No need to bother writing stuff up in Excel, just write "output [highest 3 of 5d10]" and it'll give you a mean of 21.46 with a standard deviation of 4.35 in less than a second. There's no need to write up an entire block of stuff for excel! Let me summarize his entire attack routine in a one-liner:

When attacking, my character gets to roll 5d10, and keep the highest 3 dice. Also, 10s get rerolled and the new value is added to the old. -

output [highest 3 of 5d[explode d10]]

For the "four new skills" you mentioned, it only takes four lines.

Then, let's say I get to choose between four new skills: One adds +5 to the total, one lets me roll two extra die, and one lets me keep an extra die, and one lets me reroll two existing die (not summing their values like with the 10s, just rerolling normally). How do I determine which one will have the greatest impact?

output [highest 3 of 5d[explode d10]]+5, average 29.48, standard dev. 8.06.

output [highest 3 of 7d[explode d10]]], average 28.17, standard dev. 8.40.

output [highest 4 of 5d[explode d10]], average 28.32. standard dev. 9.04.

And I don't understand what you mean by the fourth one. Do you (1) explode 5 d10 separately, (2) reroll the lowest two, then (3) take the highest 3 of those?

shadow_archmagi

2013-10-15, 01:04 PM

Oh hey wow. Anydice looks like an automated version of exactly the thing I needed. Thank goodness the internet has everything, and thank you so much Attila for pointing me to this!

Cuthalion

2013-10-15, 01:31 PM

So, as we all play RPGs, we've all probably encountered dice, and, by extension, probabilities. Now, it's pretty easy to say that 2d6 averages 7, or that if you hit half the time for an average of 7 damage your average damage per round is 3.5. That's all nice and easy.

But there are a lot of RPG rules that play havoc with that. Partial rerolls, roll and keep, or roll and keep systems, for example.

What can you do to analyze probabilities when these kinds of factors are in play?

EXAMPLE (note: This isn't a real game I'm in, I'm not actually interested in the answer so much as the techniques used to derive it): I'm playing in a game of Legend of the Five Rings. When attacking, my character gets to roll 5d10, and keep the highest 3 dice. Also, 10s get rerolled and the new value is added to the old.

First off, how the heck do I calculate the average. Then, let's say I get to choose between four new skills: One adds +5 to the total, one lets me roll two extra die, and one lets me keep an extra die, and one lets me reroll two existing die (not summing their values like with the 10s, just rerolling normally). How do I determine which one will have the greatest impact?

What are dice? :smallconfused:

Reltzik

2013-10-16, 02:43 PM

Except the portion of the outcome from B is not 10^B, but merely 10*B. It's the sum of .9*0 + .09*10 + .009*20 + .0009*30, etc., which is most certainly not infinite. This is a bit messy of a series to calculate the sum of, but there's an easier way to solve the problem.

If B is the number of 0s you get on the exploding die, you have a 90% chance of B = 0 and a 10% chance of starting over and adding 1.

Bavg = (.9 * 0) + (0.1 *(1 + Bavg))

Bavg = 0.1 + .1*Bavg

0.9*Bavg = 0.1

Bavg = 0.1/0.9 = 1/9

B averages 1/9, and you get 10*B added to the total, so average 10/9. Add the average of the final die, and you get an average total of 6.1111111111111...

Okay, so it was a dumb math mistake on MY part instead of the game designers.

....

*bashes head against wall*

Powered by vBulletin® Copyright © 2021 vBulletin Solutions, Inc. All rights reserved.