Showing posts with label dice. Show all posts
Showing posts with label dice. Show all posts

07 December 2012

Levi's Double Dice

Just a quickie - On the new G+ Gamecraft community (and communities are brand new) Levi Kornelsen asks the following:
Okay, so, dice mechanic thing; kind of a "little idea" I keep playing with.Consider a character with skills like those in Skyrim - so, ranging generally from 15 - 30 to start, and up to near 100.Now, imagine you roll 2d10, and read them as percentile both ways.  So, 9,2 is 29 AND 92.If you succeed (roll skill or less) one way of reading?  Partial success.  If you do it both ways?  Complete success.How does that hit you, overall?  Gimmicky or good?    #rpg    #roleplaying   #rpggames  

And here is what the cumulative distribution if Partial and Complete success looks like, assuming you need to roll your skill level or less, and "00" is both "0" and "100":

That's it --- I said it was a quickie!
Edit: Maybe the chart title should be "2D10 Double-Dice". Oh well ...

09 February 2012

Conditional Dice Rolls with Partial information

Last time I wrote about Conditional Dice Rolls, or using conditional probability to correct the results of an earlier roll that was made incorrectly. The rest of this will make more sense if you read that first.
To do this you need to know 2 things --- You need to know what the probability of success for your first roll, and what that probability should have been. But wait, there is one more thing, an important assumption I rather glossed over last time --- You need to have completely forgotten everything about the first roll except that you succeeded or failed.

And that's harder than you might think. ---> More after the fold --->

05 February 2012

Conditional Dice Rolls

It happened to me again at the Wednesday Battletech game, one of those honest mistakes that can happen in a complicated situation. My Griffin fired two medium lasers at a Jenner needing 7's or better, and both hit. A short time later I realized my mistake, I had miscounted and the roll should have been 8 or better. I could not remember what the original rolls had been.
There is a way to fix this, to repair my mistake, to determine if my shots really should have missed, and that is fair to both players. It's a good trick, and you don't even have to do any math to use it.

But you might have to roll a lot of dice.  ---> More after the fold --->

03 July 2011

Dice Distributions Revisited

Recent thoughts about calculating the distribution of the maximum sum of several dice (ex: roll 3, sum the highest 2) made me realize I needed a better tool for calculating the distribution of sums of dice in the first place. I first wrote about this some time ago in Dice Distributions, so I knew how to do it better, I just hadn't gotten around to doing it.

Tangent: While researching this I can across a great set of mathematical Dice Problems from Doctormatt (Web Page, Blog).

And now back to our story -

I first set up a spreadsheet to give me Pascal's Triangle, which looks like this:

This gets used in lookup functions to calculate (in a second worksheet) what I'm calling the "Dice Triangle", The number of dice [N] rolled is indicated in the column headers, and the sum of N D-sided dice [X] rolled in indicated in the first column. The number of ways to roll that sum is indicated in the table. The number of sides on the die [D] can be changed by entering a different value into the green shaded cell.



The first D rows of the table come directly from Pascal's Triangle. Subsequent rows are calculated from previous rows of this table. A few more details of how this is done in my earlier post (Dice Distributions), otherwise you can ask me, or dig into the spreadsheet for yourself (sorry, in a hurry today).

Here is the spreadsheet: Dice Distribution Calculator
I have not made this public, so you cannot change it directly online. You can download a copy for yourself (under the File dropdown) and play with it to your hearts content.

01 July 2011

Maximums and Minimums of Dice Rolls

A week month a while back I received questions from Christian and a read post from Saxywolf on essentially the same question: What is the probability of rolling a given value on an D-sided die, if you roll N dice and take the highest (or the lowest).

Here's the trick:
The probability of rolling a 1 on 1 d6 is 1/6. (regular 6-sided dice)

For 2d6 the probability of rolling a 1 as the maximum is 1/6 times 1/6, or 1/(6*6) = 1/36.
For Nd6 the probability of rolling a 1 as the maximum is 1/6 times itself N times, or (1/6)^N.

For D-sided dice just substitute D for 6 above, so that the probability of rolling a 1 as the maximum of N D-sided dice is 1/D times itself N times, or (1/D)^N.

Now consider the problem of rolling 2-or less as the maximum. The probability of rolling 2-or-less is 2/D, and the probability of rolling a  2-or-less as the maximum is 2/D times itself N times, or (2/D)^N.
That's 2-or-less, but we really just want the probability of rolling 2, not 1 or 2.  BUT we already know the probability of rolling a 1 as the maximum on the same dice, so we can subtract that to get what we want:

The probability of rolling a 2 as the maximum is 2/D times itself N times, minus the probability of rolling 1 as the maximum, or (2/D)^N - (1/D)^N.

And that's it. Using the same math you can work the complete distribution of the maximum for any number of dice with any number of (equally likely) faces. Just start at 1 and work up. For minimums, just turn the problem around and find the probability of X-or-less.

Still too much math? Fear not for there is a spreadsheet to do the calculations for you:
 Link to Google Docs Spreadsheet

See the blue numbers in the green-shaded cells? Change those to the number of side on your dice and the number you want to roll, and it will calculate the distribution for you. It might even work inside the blog?Nope, but it was worth a try. The spreadsheet is now public and can be edited at the link above (also downloaded). Changes made there WILL show up here when the page is reloaded, which means you are looking at whatever was most recently entered.



And a chart to display the results:





This is a bit of an experiment, both linking to a shared spreadsheet, and adding the HTML code to it directly inside my blog post. One upshot of this is that when one person changes the spreadsheet, it will change it for everyone. Play nice! Let me know if it works too. [Fixed!]

02 April 2011

Sicherman's Dice

There is something different about these dice - can you spot it? I'm guessing you'll get it right away ...
Image found at Chuck-A-Con *
You can't see the non-facing sides, but the d6 on the left is labeled with 1-2-2-3-3-4, and on the right labeled with 1-3-4-5-6-8 (like this). That's not our standard 1-2-3-4-5-6, and if someone rolled these on the gaming table the 8-pip is a dead giveaway that something is off.

Now here's the trick: The probability distribution for the sum of these Sicherman Dice is identical to the distribution of the standard 2d6, so if you only see the results (the sum) there is no difference at all.



The mathematics for this gets into Generating Functions and Combinatorics, but essentially it involves doing the algebra to show that:

(x + x2 + x3 + x4 + x5 + x6)2 = (x + 2x2 + 2x3 + x4)(x + x3 + x4 + x5 + x6 + x8)

Where the left-hand-side is the generating function for the sum of two standard 6-sided dice, and the right-hand-side is the appropriately factored generating function for the sum of Sicherman's dice. (OK, maybe a little harder than that.) There is only one way of doing this with 6-sided dice, but such variations exist for other polyhedral dice. It seems to be possible in general to do this with N-sided dice, and there might be multiple ways of doing this for some. The Mathematics Magazine article "Renumbering of the Faces of Dice" by Duane Broline (1979) goes into some detail, but I cannot access the full article from home. If I can grab it at work maybe there will be an addendum.

The Hard Way

I tried this working out possible numberings for Sicherman-type 2d8 dice by scribbling with pencil and paper until I found a combination that worked. On my third-and-a-half attempt I came up with 1-2-2-3-3-4-4-5, and 1-3-4-6-6-8-9-11. CORRECTION: TPC checked more carefully than I did, and offers 1-3-5-5-7-7-9-11 in place.  It took me a while to work this out "the hard way", but it was probably still faster than I could have factored a 16th-order polynomial**.

[Hat-Tip to The Endeavor/John Cook. Again!]
[As seen on Eon.]
Sicherman Dice are available from Amazon, or directly from GamestationGamestation.net is likely the original source for the image I used above.
** "Dammit Jim, I'm a statistician, not a combinatrician!"

02 January 2011

More Dice, More Information, but not as much as you think

I may have created some confusion in my previous posts on the information in dice (1,2). That's understandable, because the concept of information is complex and has multiple interpretations, most of which I would not claim to really understand either. Let's see if I can sort this out without making an even bigger mess.

Shannon Information measures the information content of a random distribution of discrete events. A coin flip (heads/tail), a To-Hit roll (hit/miss), and a Hit-Location roll (arm, leg, torso, etc.) are all examples of this. What really matter here is not the number of dice rolled or coins flipped, but the number of possible outcomes and the probability of each. So you might use 4d6 to determine the result of a to-hit roll, but there are still only two outcomes - hit or miss. In game terms, you can think this as the information you don't know yet, just before you roll the dice, or the variability of outcomes of that roll.
Shannon information is measured on a logarithmic scale (base 2), so each additional bit represents a doubling of information. In absolute terms, the difference between 10 and 11 bits of information is MUCH more than the difference between 2 and 3 bits. Be careful with this sort of comparison though, because it's a bit like comparing apples and oranges (or comparing to-hit and hit location rolls). Such comparisons may not be meaningful.

There is an extension of Shannon Information to continuous outcomes, but this also requires changing the definition somewhat. I won't go too far into this, but there is one key point I'd like to make. When dealing with the sum of multiple dice, the distribution of the sum tend to become more like a normal distribution as the number of dice increases. Calculating the entropy of the sum of 10D6 is a bit of work, but the entropy of a normal distribution is easy to calculate. Long story short, I can get a good guess at the entropy for the sum of a large number of dice by using the normal distribution as an approximation.

I had speculated about calculating the information in an entire game. This was rather silly of me, because this would mean framing the outcome of an entire game as a single probability distribution. I can't do that, but now I know how to make an educated guess. If I only considered the win/lose aspect of a game this would be easy, because that is just a complicated sort of discrete "coin-flip" outcome. The more interest way to look at this is to consider ALL the ways a game might play out, and to treat this as a sort of continuous outcome. The law of averages comes into play, some ways the game will play out are more likely than others. For instance, if at some point in the game you make multiple attacks to achieve an objective, perhaps to destroy an enemy tank, then in the final outcome of the battle it might not matter which attack was successful, so long as one of them was - they all lead to the same outcome. This might be stretching the concept too far, but I should be able to use the entropy of the normal distribution to approximate the amount of information of a very complicated random distribution - like that of an entire game.

Now I can make an educated guess about the information in a game. I'll use a Battletech example, but there is surprisingly little dependence on the game. The most common random event in Battletech is weapons fire, which includes the to-hit and hit-location rolls, which each have about about 3 bits each (as calculated here). In a two player game where each player has 4 battlemechs, and each mech makes about 5 weapons attacks per turn, there will be about 10 random events per turn for the first 5 turns or so, about 200 random events, then a decreasing number of attack for the next 5 turns, call it 150 random events. That's 350 random events in one game, but I left out anything else that might require a die roll, so I'll round it up to 400. The basic random event in Battletech is about 3 bits, and 400 repeat random events adds about log2(400) or 8.6 bits, for a total of 11.6 bits.

Sooooo ... now that I've gone through all that, it seems that the information in a game is just log2 of the number of random events, plus a few bits of overhead. Does this mean anything all? I need to think on that.

Here is a partial answer: A game doesn't need any randomness at all, it could be completely strategic, like Chess. Add just a little bit of randomness, the whole game may depend on just a few rolls of the dice. As randomness increases the law of averages will come into play - Games like Risk and Battletech have many dice rolls - so many that the average effect of many rolls is almost always more important than single roll. Too much randomness, and players lose the ability to affect the outcome. The trick is getting is the right balance of randomness, and I don't think there is a formula for that.

PS: My friend Ashely also recently noted that it might be a good idea to eliminate any rolling of the dice that doesn't significantly add to the game. Wisdom!

More:
Dice and Information
Dice and Information, So What?
GBR Giant Battling Robots Favicon

12 December 2010

Granular Skill Checks, and Interpolation

I just read a discussion in the CBT forums (Thanks PiP!) about the "granularity" of skill rolls in Battletech. The basic problem is that skill level changes in the boardgame make a BIG difference in play, but if you are running A Time Of War (Battletech roleplaying) then you want may small changes so that characters can improve gradually in many small steps - as opposed to 3-steps to a Superman.

I'll keep this discussion about the Battletech RPG, but these comments should apply to any game where characters have skill levels that seem too granular. I originally posted this whole thing in the CBT forums, then UN-posted it because what I had was broken. Now it is fixed, but much longer, so I hope nobody minds that I'm linking back to myself.

One way of doing this would be to use a different random distribution for skill checks. The second editions of the Battletech roleplaying game (Mechwarrior) uses 2d6 rolls just like the boardgame, and all skill were very granular. The 3rd edition of the game made a switch to 2d10 "exploding" dice, which greatly reduced the granularity problem, but suffered because it was difficult to make meaningful improvement in character skills.

There are also various "house rules" for doing the same sort of thing, but these generally require changing other aspects of the game to balance out the change in probability distribution. For instance you might switch to a 2d10 or 4d6 to-hit roll. There is less granularity now, which is good for your RPG, but the game has changed! On this new scale a +1 or -2 modifier will have relatively less effect or results, potentially "breaking" the usual balance of the game. You might fix this by adjusting all these modifier, but you won't ever get the original balance back this way.

I have an alternate suggestion: Add a decimal point to the skill levels, and an extra 1d10 roll when rolling for a skill check. Differences between Battletech skill level are BIG changes, so the idea is to add steps in-between. For example, instead of Gunnery 5 and 4, some possible skill levels are 5.0, then 4,9, 4.8, 4.7, 4.6, 4.5, 4.4, 4.3, 4.2, 4.1 and finally 4.0. Likewise any skill level, just adding a fractional skill level to it. There is a word for this - "Interpolation". We can interpolate between whole number skill levels, filling in with smaller changes in probability.

To use this, calculate the target number (TN) normally adding the skill level and any modifiers, and round the final number down. Make the usual 2d6 roll;
if this is less than the TN, you fail;
if this is more than the TN, you succeed;
if you roll exactly the target number, then you must also roll the 1d10, read it as 0-9, and this must be equal or greater than the decimal in your skill to succeed (if the decimal is "0" then this always succeeds, no need to roll).

Example: Suppose the base gunnery skill is 3.6, and after various modifiers the target number to-hit is 8.6, which rounds to 8. You roll 2d6 and ...
On a 9 or better you hit,
On a 7 or less you miss,
On exactly 8, you roll 1d10 (0-9), and if this is a 6,7,8, or 9 then you hit, otherwise you miss.

With TN=9 probability of success would be 0.278, and TN=8 it would be 0.417. The effect of the decimal in the skill level and the 1d10 die roll is to interpolate, or smooth out, between those two probabilities. The final probability of success for a TN of 8.6 is 0.333.

This gives 10 steps of skill improvement to every 1 in the regular rules, which ought to be fine-grained enough to satisfy the pickiest Game Master. In fact it may be too fine, and you might want to restrict it to just 5 steps (.0, .2, .4, .6, .8) or even 2 (.0, .5). Further, you will need to adjust the experience needed for fractional skill improvements accordingly. If it cost 100 experience points to improve Gunnery skill from 5 to 4, then it should cost about 10 to improve from 5.0 to 4.9. Most GM's love to tinker with this sort of thing anyway, so I'll leave the application in your capable hands (or fangs, tentacles, whatever).

Now the really good news - interpolating skills does not "break" any other parts of the game by changing the probability distribution the game is designed on, it just smooths it out, so a +1 or -2 modifier still has the same effect it always did. There is nothing special about using 2d6 with this either, so you might easily apply this to any RPG with granular skills.

Here is a chart with the probabilities of success on a 2d6 skill check. The way I have set this up makes it look a bit like a wavy staircase:
Probability of success on 2d6 with standard skills
You could walk up those steps! And the granularity is obvious. This chart has target number up to 13 because I need to show the probability go all the way down to zero for the next chart. Now a chart showing the same for interpolated "Skills with a decimal":
Probability of success with interpolated skills
Nice and smooth. If you look really hard you might notice this is actually 11 straight line segments joined together. This method of interpolation really just connects the dots between probabilities for whole number skill levels.

Now we have wiped out the granularity problem, but at the cost of some extra dice rolls. If you don't want to roll so many extra dice, you could make a single 1d10 interpolation roll (after fire declaration) and apply it to all skill checks results for that turn. This will be weirdly granular, because it is like changing your skill level randomly from turn to turn, but it will average out to the same effect over the course of many rolls.

GBR Giant Battling Robots Favicon

07 December 2010

Dice and Information

There is a concept is statistics and the information sciences of information. Several concepts actually, as there are different types of information, but I want to focus specifically on Shannon information or Entropy. Entropy is a way of measuring the amount of variability or uncertainty in a probability distribution, and a simple way to illustrate this is with the example of a coin flip.

But first, a comment of notation, since the Blogger editor is not too equation friendly. Calculating entropy requires a logarithm function, usually denoted ln(x) or loge(x) for base-e or natural-log, and Shannon Information specifically uses a base-2 logarithm, which I denote here as log2(x). If  my equations are not clear, any mention of the log function (outside this paragraph) always means the base-2 logarithm. If you are following along with a calculator, you probably have a natrual-log button ln(x), but can calculate the base-2 log as log2(x) = ln(x)/ln(2).

Image source, and quite interesting in itself.
Assuming a fair coin with a 0.50 probability of heads or tails, then the first step is to calculate a quantity called the Self-information or "surprisal" of all events. This is a measure of how surprising a given event is relative to the other possible events in the distribution. This less likely the event, the higher the value of its surprisal.

Surprisal is equal to -log2(p), where p is the probability of a given outcome. Calculating ...
log2(.5) = -1, 
-(-1) = 1
... and the NOT so surprising result here is that heads and tails are equally surprising, with a value of 1 each.

Shannon Information is measured in "bits", the basic unit of information used in calculation by computers. To relate this to games it might help to think of one bit of information being equal to the amount of variability in the flip of a coin. Now that we have the surprisal, we can calculate the Entropy as the average or expected value of the surprisal over the entire distribution. This is p times the surprisal -log2(p) of each event, summed over all events. For this example the calculation is trivial; 0.5 times the surprisal of 1 (for heads) plus another 0.5 times a surprisal of 1 (for tails), is just 1, so a fair coin flip has 1 bit of entropy.

Here I have a table representing the information in discrete uniform distributions from 1 to N. In gaming terms this is the information in single N-sided dice, with each face of the die being equally likely as all others. I included all the values representing true polyhedral dice, and some additional values for comparison (most of these are powers of 2 or 10).
The second column p(x) gives the probability of each "face", the third the surprisal, and the forth the entropy.
Here we can see that a 2-sided die (a coin!) again has 1 bit of entropy, a 4-sided die (d4) has 2 bits, a d8 has 3 bits, and a hypothetical d16 has 4 bits, following powers of 2 as you might expect. I put in some extreme values just for fun - the final row, a one million-sided die, would have nearly 20 bits (or 20 coin-flips) of entropy.

As in the example of the fair coin, when all outcomes are equally likely, the surprisal and entropy are equal. This also maximizes the value of the entropy - meaning that if any result was more or less likely than another, the result can only become more predictable, and the value of the entropy must be less, as will be seen in the next example.

For the second example I'm calculating the entropy of the sum of two six-sided dice. This table shows the possible results from 2 to 12, the probability of each result (twice) as the odds-in-36 and a probability. Next (4th column) is the surprisal of each result, and unlike the uniform distributions this values varies with the probability of the outcome. A roll of 7 has a surprisal of 2.58 bits, and a roll of 12 (or 2) 5.17 bits; a 12 is the more surprising result, relatively speaking.
The final column is the surprisal multiplied by the probability, and these are summed to determine the Entropy at the bottom, which is 3.27.
In terms of information, a 2d6 roll is in-between the d9 and d10 rolls from the first table. This doesn't mean they are the same, but that they have a similar amount of variability.

For the third table I have calculated the entropy for some commonly used dice-rolls in games and listed them in order of increasing entropy. The 2d10- designates the difference of two ten-sided dice, as used for penetration damage in Squadron Strike.

Note the entropy of 4d6 is less than twice than of 2d6, and likewise 2d6 is not twice that 1d6. As numbers from single dice are summed, the distribution becomes less uniform, more like the bell curve of the normal distribution, is more predictable, and therefore has less entropy. If we were using two separate d6 rolls to generate a uniform random number between 1 and 36, we should expect the d36 entropy to be twice than of a d6, and it is; log2(1/36) = 5.17. We also see this with the entropy of d100 being twice that of d10.

What strikes me from this is rolls of 1d6, 3d6, and everything in-between, vary by only about 1 coin-flip of entropy, so maybe the many variations of dice used in games really don't make so much difference in terms of the variability of play.

A final note: Just because there might be more information in some combinations of dice does not mean the game takes full advantage of that variability. For instance if you are making a to-hit roll with some probability of success (hit or miss), then there is at most 1 bit of information in that result no matter what kind of dice you roll it with. There are only a full 6.64 bit of information in a d100 roll if there are 100 unique outcomes.

More:
Dice and Information, So What?
More Dice, More Information ...
GBR Giant Battling Robots Favicon

05 August 2010

Fair Dice, Unfair Dice, and Dice Rolling Machines

Today's rambling blog post started off with my searching for a material in reply to a post at My Little Soldier. Looking for one thing I stumbled across much more, and ... well ... here it comes ...


Fair Dice and more from the Mathematical Association of America. Be sure to read about Lou Zocchi's father's Believe-it-or-Not accomplishment.

Unfair Dice, also from the MAA. Notable because someone calculated the theoretical unfairness of dice that are unbalanced due to hollowed out pips. This would include most of the dice in my bag, since I prefer pips to numbers.


The Physics of Dice, this page has links to pictures of a dice-rolling machine custom built to test dice, and a bit more that might be interesting. This is what I was looking for in the first place!

And Finally ...



A bit more about this machine at Gizmodo
 and Boing Boing is better still.

GBR Giant Battling Robots Favicon

26 April 2010

Packing four-sided dice

A while back I was trying to work out the geometry of a game map with a triangular grid, instead of the typical hexagon. Somewhere along the way I got sidetracked by the idea that if I could figure out how to subdivide 3-D space into tetrahedral blocks, this would be the basis for games with a simple sort of 3-dimensional movement. I got busy with my pencil and sketched and scribbled for a while, trying to see if I could work it out, but I kept getting stuck. Realizing that this was just the sort of problem that better mathematicians than I are likely to have worked out already, I did a bit of searching. It turns out I was wrong:

Aristotle mistakenly thought that identical regular tetrahedrons packed together perfectly, as identical cubes do, leaving no gaps in between and filling 100 percent of the available space. They do not, and 1,800 years passed before someone pointed out that he was wrong. Even after that, the packing of tetrahedrons garnered little interest. More centuries passed.


I was wrong - you can't do the sort of subdivision of 3-D space that I naively hope for, but at least I'm in pretty good company there.

Here's another source for the same story: Packing Tetrahedrons, and Closing In on a Perfect Fit
And a relevant Wikipedia article: Tetrahedron packing

If I switch to octahedral blocks, my original idea might still work. Maybe I'll buy a bunch of 9  8-sided dice and test it the easy way.

[Edit: Nine-sided dice ... that's a good one! ;-)]
GBR Giant Battling Robots Favicon

01 March 2010

From XKCD: Sex Dice

I love XKCD, and today's strip is just too good not to share.

Sex Dice:
You roll for initiative, and ... [roll] ... wow, do you ever take it.

Click-thru to read the mouse-hover message. :-)

GBR Giant Battling Robots Favicon

28 February 2010

More Exploding Dice: T&T Saving Throws

I received a request from Christian Lindke, author of Cinerati, about the probability distribution of a different sort of "exploding" dice: Saving throws in Tunnels and Trolls. I have previously written about Exploding D10, and this is a closely related problem. I'll let Christian explain it ...

I am getting ready to do a few posts on Tunnels and Trolls.  Specifically, I will be proposing an alternate combat resolution system -- one based on an existing system within the game.  I want to play around with the concept of using T&T "Saving Throws" as the basis for all mechanical resolutions in the game.

In T&T the saving throws are resolved by comparing a statistic to a difficulty # and using the result as the basis for a 2d6 roll.  The actual equation is [15 + (level of challenge x 5)] - Statistic = Target Number.  So a character with a Luck of 12 attempting a 1st level challenge would need a result of (15+5-12=8) eight or better to succeed on the attempt.  Figuring out the probabilities on a basic 2d6 roll is a simple affair, but in T&T a player who rolls doubles keeps the result, re-rolls and adds the result to the prior sum until the player no longer rolls doubles.  It's an open ended doubles system.  What would be basic equation be to determine probabilities in this case.  Logically, given that the chance of doubles is 1/6, it seems that the probabilities would be the same as a normal open ended d6 roll for each die (which I believe produces an average of 4.3 per die), but I'd like an equation I can use to determine the game balance as characters advance etc.  I'd like to use the base probability of an "average" character of a given level attempting a task as the basis for my new system.

If you could be of assistance, it would be greatly appreciated.

A friend of mine had noted that asking me questions like this is like teasing a small child with a shiny toy, holding it just above my reach; You just know I'm going to jump up and try to get it - and I did. ;-)

As I said, this is very similar to how the probability for Exploding D10 work in the MechWarrior 3rd edition RPG. With D10X you count the roll if is in the range 1-9, and if it is a "10" you count the 10 and roll again (that the explosion). Rinse and repeat until done. In T&T we have a 2d6 roll that explodes if a tie is rolled on the two dice instead of the highest value on either one.

As with D10X, this breaks down into two three parts - which are a geometric series, the value of rolling ties tie, and the value of rolling no-ties.

The probability of rolling a ties on 2d6 is 1/6, so the geometric series starts of like this:
0 ties with probability = 5/6 = 0.8333
1 tie with probability = (1/6)*(5/6) = 5/36 = 0.1389
2 ties with probability = (1/6)*(1/6)*(5/6) = 5/216 =0.02315
3 ties with probability = (1/6)*(1/6)*(1/6)*(5/6) = 5/1296 = 0.003858

... and so on out to infinity. The average number of ties in a series is (1/6)*1/(5/6) = 1/5 = 0.2, which is nice it you only want to know the average 2d6X roll (which is 8.4, btw), but we need the entire probability distribution.

Now there are six different ways to roll a ties, and they have values of 2,4,6,8,10,12, all with 1/6 probability, which is just the same as 2 times the value of a 1d6 roll. I will note this as 2*1d6. Combining this with the geometric series, we get this:

a "0" with probability = 5/6 = 0.8333

a 2*1d6 roll with probability = (1/6)*(5/6) = 5/36 =0.1389
a 2*2d6 roll with probability = (1/6)*(1/6)*(5/6) = 5/216 = 0.02315
a 2*3d6 roll with probability = (1/6)*(1/6)*(1/6)*(5/6) = 5/1296 = 0.003858
... and so on out to infinity.


NOTE: The probability of zero ties is really 0.8333 (the first bar); I chopped off the graph to show the what ties actually add in, which really isn't very much. I calculated the probabilities out to 6 consecutive ties, which is only a little bit of overkill. It could go on forever, but unless you are infinitely lucky (and have a lot of spare time on your hands) your streak of ties will eventually come to an end, where you add the sum of the the final not-tied dice to your previous total. That probability is a modification of the usual discrete triangular 2d6 distribution, and it looks like this (2d6-ties):

The final step to pull this all together is a bit messy, so pardon my hand-waving over the details (if you really want the nitty-gritty, look in the accompanying spreadsheet). You multiply each probability in the geometric series with each the probabilities in the 2d6-ties distribution and sum up  the corresponding values of the roll, then tally up the total probability for all combinations with the same sum. It looks like this:

This looks a lot like the 2d6 distribution with a long "tail" tacked onto the right hand side. Here's the cumulative probability:



Finally, a table of the rolls and cumulative probabilities, though if you really want to numbers it's probably easier to grab them from the spreadsheet. Again, the table theoretically should go to infinity, but in practice you will only rarely see any rolls greater than 20.

I'm curious to see what Christian does with this, and I'll link to his post(s) on the topic when he has them up.

Have fun rolling the dice!


[Edit: Typo corrected, added decimal probabilities.]
[Edit2: Added link to spreadsheet, which I swear I did once already.]

GBR Giant Battling Robots Favicon

04 January 2010

Improved Dice Test

In response to a question about the "Fair Dice" test, I have updated my spreadsheet for the Chi-Square test of homogeneity (Fair Dice) so that it will recognized the number of "sides" being tested for any number up to 20. I think this is fairly self-explanatory, just leave that green shaded cells blank if you don't need them. I have not tested this extensively, so if it gives you any troubles let me know.

06 October 2009

Dice Poll Results


The poll about my dice is now closed, and although the results are nothing spectacular, I'm still happy with them. Not a lot of people came here just because of the dice, but some did, and that is fine. It might have been more helpful to me if I'd put up the poll right after ORIGINS, and I'm guessing there are more people that simply missed the poll.

BR custom dice blog cardsOne thing that is pretty clear is that people like these dice, and it has been a successful promotion of my blog. It has also raised awareness among the Battletech community, which is an important part of my target audience.





I'm getting requests for more dice from people I know handing them out to other gaming groups, so I know the word is still getting around. This cost me $200, but it has done what it was supposed to do, and it been nice to have something I can give out that gamers appreciate. I would do it again, and my supply is running low, so I'll likely need more for next summer.

GBR Giant Battling Robots Favicon

21 September 2009

Math of 2DX Dice Systems

Hi, this is Kit from Orloff Military Academy here to do a guest post. I got the idea from my time playing BattleTech, but it didn't seem quite specialized enough to post on my blog. Luckily I have been kindly permitted to post it on GBR, so I would like to start out saying thanks for the opportunity.

This is an article I have been wanting to do for awhile and involves the statistics of systems that roll two identical sized dice. The one I actually know best is 2D6 systems because of my hobby playing BattleTech, however the math remains pretty much the same for all 2DX systems. Because of this I decided to assume 2D10 is being used to make the examples and graphs a bit more clean.


Simple Distribution
 

The first thing I feel is worth talking about involves the simple distribution that arise out of these systems just as a matter of course when you add the result of both dice together.

One of the easiest to spot is the % chance that any particular number will be rolled when using a 2DX system. The lowest and highest value will only have one possible dice combination (2 and 20 for the 2D10 example). The number of combinations lineally increases at a 1-to-1 ratio as you move toward the value of [N/2]+1 where N is the maximum sum of the two dice (in the following examples N=X+X=10+10=20). This is actually a very simple distribution as you can see from the graph:



Chance To Roll Better

From that simple distribution we get a very nice probability curve for attempting to roll equal or better than a target number. This type of roll is actually quite typical of games where some sort of roll must be made in order to successfully complete actions that can range anywhere from combat to convincing a merchant to lower the price of goods.



Take a look at the graph to the above. Notice that the chance of success is not linear at all, but rather curves more steeply toward the center, while leveling off near the ends. This is a direct result of the probability distribution I talked about above and it has a very significant impact on game play: a change of 1 to the difficulty of a roll will have a more profound impact on success toward the center of the possible number range than at either end.

For example, the difference between a target number of 11 and a target number of 12 is a 10% loss in success rate (from 55% to 45%). In contrast the change from 19 to 20 is only 2% difference (1% down from 3%). Likewise there is only a 2% impact in a change from 2 to 3.


Impact: Opposed Rolls

What I call an opposed roll is when two different rolls are made: one by whatever is trying to take the action (often a player or an NPC) and another by whatever is opposing them. In effect the second dice roll is setting the target number to beat on the spot.

In this type of play players need to be very aware of bonuses and penalties because so many rolls fall into the central portion of the graph and a penalty or bonus of 1 can have a profound impact. For example, 70% of all rolls in a 2D10 system will fall into the 7-15 range and 58% actually fall into the 8-14 range. This is in the steepest portion of the probability graph.

The result of this is that any type of action that poses a penalty upon the opposing roll without penalizing the player equally (or more), or one which gives the player a bonus without providing an equally helpful bonus to the opposed roll is amazingly powerful. This results in a 7% impact on the result from just a change of 1 to the dice roll. That is quite the significant difference. However conversely penalties and bonuses also reach a point of diminishing returns - which means that after a +3 or +4 bonus (or -3 or -4 penalty) is rarely worth going for more it if there are costs associated with doing so even if higher bonuses/penalties are possible. Dan was actually kind enough to make the following table:


Impact: Combat Systems

Another thing to consider is the style of combat that BattleTech uses: where factors such as range, movement, and so forth set the difficulty to make a shot. The target number doesn't change, however often any action you take to make your target easier to hit will also make it easier to hit you. By the same token, anything you do to make yourself more difficult to hit makes it more difficult for you to hit something else.

Now this means that when taking an action that will make your target more easy to hit you need to ask if the cost is worth it since typically you will be easier to hit as well. The way to do this is, thankfully, quite easy. You calculate how much your chance to hit the enemy will change and divide that by how much their chance to hit you will change. The larger the number the more the change favors you, while the smaller the number the more it favors the enemy (a result of 1 means things are perfectly even).

Doing this it quickly becomes apparent that if the enemy's target number is at either extreme there is usually no reason to not make both them and you easier to hit - if they are always hitting anyway you are best served to improve your hitting chances as well, or if they are always missing because of high target numbers any change is not too significant. This holds especially true if your target numbers fall toward the middle of the target range. Of course this works the other way as well and the logic is almost exactly the same when it comes to raising target numbers.



If anyone spots a flaw in my numbers/reasoning or has something worth pointing out please feel free to chime in! There is actually a lot more that can be talked about regarding these types of dice systems so don't hesitate to share your thoughts.

GBR Giant Battling Robots Favicon

05 September 2009

Pole Dancing

With a title like that, this will probably be my most popular post ever! :-)

As many of you have noticed already, I have a pole poll up inquiring try to determine if people have found my blog because of my custom GBR dice, which I ordered from Chessex as sort of a business card to help advertise this blog. These dice have certainly been popular, between friends and two conventions most of the 400 I ordered have been given out already. I don't know that a lot of new readers have come here as a result, but I will be happy with even a modest response. Those dice are out there now, and a lot more people will see them as time goes on.
So if you haven't yet, please respond to my poll not pole! in the right sidebar. Note that you can vote for more than one item, so check all that apply.

I should mention that my friend Tom of PhotonCutter Studios handed out dice for me at GENCON, and I thank him for that. I'll thank him better soon by posting about his expanding product line.

I see a number of people are already indicating they "want dice". I'm not opposed to ordering more if I need to. Hopefully the opportunity will come to give good homes.

Also, my thanks to Saxywolf for giving me the idea for this pole poll.

Finally, if you have read this far and are disappointed not to find scantily clad women performing acrobatic contortions on polls poles, then this is what you want (a little NSFW, but not very)
GBR Giant Battling Robots Favicon

27 August 2009

Playing Fair with the Chi-Square Test of Homogeneity

Over at The Scrapyard Armory Ellis/Saxywolf has written a great post about testing to see if dice are fair. This is similar my Water Test I wrote back in September (my second post!), but quite frankly, Ellis has taken it step further, done a lot of hard work, and done a far better job with it than I did. Well done Ellis!

Go read Ellis' Fair Dice post and the comments, then stop back, because I've got a bit more to add.

In response to that post I created an Excel spreadsheet to do a Chi-Squared test of Homogeneity. That's statisticalese for a test of equal proportions. In this case, to test the null hypothesis that the probability of rolling each number/side/pips on all sides of a die is equal to 1/6, versus the alternative hypothesis that those probabilities are not equal 1/6. Alternately, or more formally:

H0: pi = 1/6, for all i = 1,2,3,4,5,6
HA: At least one pi ~= 1/6, (read "~=" as "not equal")

Here is a screen-cap of the spreadsheet:

fair dice spreadsheet Chi-square test homogeneity

To use the spreadsheet, roll your die a bunch of times and tally up the number of times each side is rolled. You will need to do a minimum of 30 rolls for the result to valid, and unless the die you are rolling is obviously unbalanced, several hundred rolls before you can reliably detect a small imbalance. Enter your counts in the appropriate cells in the spreadsheet, and then look up the p-value.

A p-value is a standard way of interpreting the results of a statistical test (computers are good at calculating them, but in the old days we had to use published tables of numbers to interpret results). The p-value is the probability of the counts you entered in the spreadsheet or any more extreme results that might have occurred IF the assumption of a die is fair (probability of each side is 1/6) really is true.

If the p-value is small, generally less than 0.05 (called the type I error rate), this indicates a result that is unlikely to occur in a fair die. This error rate is a choice about how the test will be interpreted:

1) If the die is fair the p-value is random and will be less than 0.05 about 5% of the time simply by random chance (error rate again).

2) If the die is unbalanced, and the assumption of a fair die is false, the p-value will be less than 0.05 MORE than 5% of the time. The more unfair the die, the more likely the p-value will be less than 0.05. Exactly how likely might be is a complex calculation, but the more time the die is rolled, the more likely you will correctly detect an unfair die (called statistical "power"), and you will be able to detect smaller degrees of "unfairness".

3) A word of caution: a smaller p-value does not necessarily indicate greater "unfairness", and you should not compare p-values between dice to determine which is more fair. This is because the p-values are partly random, so it is not meaningful to compare them that way. Instead, try looking at the ratio of proportions for the same side on two dice (This forms a type of statistic called an odds-ratio).

Back to Ellis' experiment for a moment; Ellis rolled each die 1000 times each (a lot of work!), and should be able to detect fairly small imbalance in the die. An educated guess: His test can detect imbalance as small as 0.02 to 0.03 between any two sides of a die rolled on a table-top (Update: this should be accurate to +/- 0.023 with 95% confidence). Further, we think rolling the die in water amplifies any imbalance in a die, and so gives greater power to detect unfairness. It's possible that Ellis' water test is detecting imbalance that are so small (0.001-0.005?) that we might not care (ie: very close to perfect is good enough).

It think there might be another post on this topic, it's now on my list of things to do. If you are curious now, try a search on "physics dice imbalance".

[UPDATE 1/5/2010]
As requested in the comments, I have updated the spreadsheet to handle results for other dice up to d20.

GBR Giant Battling Robots Favicon

31 July 2009

Anniversary

How well does my wife know me, to give me oversized rubber bouncy dice as an anniversary gift?

No post tomorrow. :-)

(The juggling balls I bought for myself)

GBR Giant Battling Robots Favicon

06 May 2009

My Dice Are Here!

BR custom dice blog cards
My order of custom dice from Chessex arrived earlier this evening. I really like how they turned out.



BR custom dice blog cards
Thanks Joe! :-)


BR custom dice blog cards


GBR custom dice blog cards







BR custom dice blog cards
To get your very own set of GBR dice, all you have to do is track me down at ORIGINS in June. The Battletech tables in the miniatures area would be a good place to look.



GBR Giant Battling Robots Favicon