TheRPGSite

Other Games, Development, & Campaigns => Design, Development, and Gameplay => Topic started by: Narf the Mouse on February 13, 2009, 04:32:04 PM

Title: What are the dice odds for a 'take highest' roll?
Post by: Narf the Mouse on February 13, 2009, 04:32:04 PM
What are the dice odds for a 'take highest' roll?

Thanks.
Title: What are the dice odds for a 'take highest' roll?
Post by: Spike on February 13, 2009, 06:36:53 PM
Eh?  Not much to work off of here. I assume you are asking for rolls like 'Everyone roll X dice and the guy who rolled highest wins!"

In which case the odds are essentially dependent upon the number of players. Between two I think that the average to be the 'high roller' works out to... wait for it... one in two.  50/50.

Obviously, three rollers becomes 'one in three' or roughly 33% and so on...

Provided everything else was equal.
Title: What are the dice odds for a 'take highest' roll?
Post by: Narf the Mouse on February 13, 2009, 06:41:53 PM
Er, whoops.

I meant something like, roll NdX and take the highest dice - I'm looking for a general formula that'll take any NdX.
Title: What are the dice odds for a 'take highest' roll?
Post by: Spike on February 14, 2009, 12:23:24 AM
Hrm... well, you also have to take into account open ended dice (a la earlier editions of Shadowrun) and so on..

Napkin math says that NdX start with the odds where N equals 1 (one die) and computing the odds for X to a given value (1d6, means a 1 in six chance to get a six, 15% more or less).  As N increases the chance to get X out of any given roll (where X is the highest value on the die, again...) increases fairly evenly. Thus 2d6 would produce a 2 in six value, or 1/3 ratio for getting one six (33%, or roughly double the chance of 1d6) and so forth.

Make sense?
Title: What are the dice odds for a 'take highest' roll?
Post by: Narf the Mouse on February 14, 2009, 12:34:02 AM
Calculator says that comes out to 1.83~/6, or 30.5~%.

Thanks, that should work into an equation.
Title: What are the dice odds for a 'take highest' roll?
Post by: arminius on February 14, 2009, 02:11:40 AM
I'm skeptical that it's that simple.

I feel that this is a special topic which was covered in a class I took, but at the moment the only approaches I can think of are essentially brute force (list every combination) and monte carlo (run a large number of simulations with a good random number generator).

I've got an inkling of another approach but I can't look into it right now.
Title: What are the dice odds for a 'take highest' roll?
Post by: Age of Fable on February 14, 2009, 02:52:18 AM
For your best result to be n, you have to get:

a) no results higher than n, and
b) at least 1 result of n.

Let Y be the number of rolls.
Let d be the size of the dice.

Looking first at a)

The chance of getting a result higher than n on a single roll is (d-n)/d.

The chance of not getting a result higher than n on a single roll is n/d.

The chance of not getting a result higher than n on Y rolls is (n/d)^Y.

So a) is (n/d)^Y

Looking at b):

Given that a) is true, what are the odds of getting at least 1 result of n.

Given that you haven't gotten any results higher than n, ie all your rolls have been 1 to n, your chance of getting n on a given roll is 1/n.

Your chance of not getting n on  a single roll is (n-1)/n.

Your chance of not getting n for Y rolls is ((n-1)/n)^Y.

Therefore your chance of getting n at least once, for Y rolls, given that no roll has been over n, is 1-(((n-1)/n)^Y)


Therefore, your chance of both a) and b) being true should be

((n/d)^Y) * (1-(((n-1)/n)^Y))


[I've tried it with n=3, Y=2, d=6  and n=1, Y=6, d=6. It gives the right answer both times]
Title: What are the dice odds for a 'take highest' roll?
Post by: Narf the Mouse on February 14, 2009, 03:11:37 AM
...I shall take a look at that when my brain is not fried from programming a roguelike.
Title: What are the dice odds for a 'take highest' roll?
Post by: arminius on February 14, 2009, 09:42:45 AM
AoF's method is what I was feeling my way toward, so I agree, it's probably right.
Title: What are the dice odds for a 'take highest' roll?
Post by: Narf the Mouse on February 14, 2009, 04:51:33 PM
Thank you. That should help nicely. :)
Title: What are the dice odds for a 'take highest' roll?
Post by: Claudius on February 15, 2009, 10:18:53 AM
Sorry if this is a silly question, but what does "^" mean? If I was taught that in school, I can't remember. And by the way, what if you roll several dice of different sides? I ask because in Usagi Yojimbo you roll several different dice and take the highest, so it would be useful to know.

Thank you in advance.
Title: What are the dice odds for a 'take highest' roll?
Post by: Narf the Mouse on February 15, 2009, 10:30:45 AM
'To the power of'. It denotes an exponent.
Title: What are the dice odds for a 'take highest' roll?
Post by: Age of Fable on February 15, 2009, 11:50:03 AM
Quote from: Claudius;283588Sorry if this is a silly question, but what does "^" mean? If I was taught that in school, I can't remember. And by the way, what if you roll several dice of different sides? I ask because in Usagi Yojimbo you roll several different dice and take the highest, so it would be usefult to know.

Thank you in advance.

That's right, '^' means 'to the power of'.

X to the power 2 is X times X.

X to the power 3 is X times X times X.

X to the power 4 is X times X times X times X , and so on.


As for rolling several different dice: I'll try to work it out as soon as I can.
Title: What are the dice odds for a 'take highest' roll?
Post by: Claudius on February 15, 2009, 01:08:05 PM
Great! Thank you, both of you! :)

Age of Fable: I'll be waiting eagerly. One of the PC rolls 1d12+2d6 for attack, and the other one rolls 1d10+1d8+1d6, and I've got no idea which one is best.
Title: What are the dice odds for a 'take highest' roll?
Post by: Age of Fable on February 15, 2009, 08:10:46 PM
Quote from: Claudius;283619Great! Thank you, both of you! :)

Age of Fable: I'll be waiting eagerly. One of the PC rolls 1d12+2d6 for attack, and the other one rolls 1d10+1d8+1d6, and I've got no idea which one is best.

Do you count the 2d6 as two seperate totals, or as a single total?
Title: What are the dice odds for a 'take highest' roll?
Post by: Claudius on March 01, 2009, 04:12:50 AM
Quote from: Age of Fable;283672Do you count the 2d6 as two seperate totals, or as a single total?
Sorry for the delay in answering. :o

Two separate totals. That is, he rolls 1d12+2d6 and scores 2 (1d12), 5(1d6) and 3 (1d6), so he gets a 5, the highest roll.
Title: What are the dice odds for a 'take highest' roll?
Post by: Age of Fable on March 01, 2009, 07:13:43 AM
No worries.

OK: your chance of getting n as your best result, out of a roll of three dice, of size a, b and c.

To get n, you have to get

i) no results of more than n. and

ii) at least one roll of exactly n.

Your chance of getting a result of more than n is based on the number of faces on the dice which show more than n.

If the dice is less than or equal to n, then this will be 0 (your chance of getting more than 4 on a d4 is 0 for example).

If the dice size is n or more, the chance will be (x-n)/x, where x is the size of the dice.

So I'm going to write this as max(0,(x-n)/x), 'max' meaning 'the higher of', because I can't find the mathematical symbol for that.

So your chance of not getting a result of more than n is 1-max(0,(x-n)/x).

So your chance of rolling three dice, of sizes a, b and c, and not getting any result of more than n, is

(1-max(0,(a-n)/a))*(1-max(0,(b-n)/b))*(1-max(0,(c-n)/c))

On to part two.

If you've rolled three dice and gotten no result of more than n, what's the chance that you got at least one result of exactly n?

Looking at the chance that a single dice will not show n:

We can disregard all numbers greater than n, because we're only looking at cases where no such number was rolled.

If the dice size is less than n, the chance will be 1.

If the dice size is greater than or equal to n, the chance will be (n-1)/n.

So the chance that all dice will show a number other than n can be written as

((n-1)/n)^z , where z is the number of dice whose size is greater than or equal to n.

Thus the chance that at least one dice will show n, will be 1-(((n-1)/n)^z)

and therefore, the chance of rolling three dice, of sizes a, b and c, and getting the highest single result of n, is

(1-max(0,(a-n)/x))*(1-max(0,(b-n)/x))*(1-max(0,(c-n)/x))*(1-(((n-1)/n)^z)), where z is as above.

So, plugging this in to Excel, I got the following for 1d6 or 1d6 or 1d12:

1   0.002314815
2   0.016203704
3   0.043981481
4   0.085648148
5   0.141203704
6   0.210648148
7   0.083333333
8   0.083333333
9   0.083333333
10   0.083333333
11   0.083333333
12   0.083333333

The first number is a possible best result, the second number is the chance of that result. So the most common result by far is 6.

For d10 or d8 or d6, the chances are:

1   0.002083333
2   0.014583333
3   0.039583333
4   0.077083333
5   0.127083333
6   0.189583333
7   0.1625
8   0.1875
9   0.1
10   0.1

Given the chance of each individual result for either player, it's easy to find the chance of any given combination (just multiply the two).

So I did a grid in Excel that does that.

Then it's pretty easy to just add up the chance of getting any case where the first player wins, and the same for the second player winning and for a tie.

If you have player A rolling a d12, d6, and another d6, and player B rolling a d10, d8 and d6,

player A should win about 47.6% of the time,
player B should win about 41.1% of the time,
and they should draw about 11.2% of the time.

I've attached a spreadsheet to this (in a zip file because you can't upload Excel files to this forum) - you can change the dice sizes (up to 30) and it'll update the chances of various results.
Title: What are the dice odds for a 'take highest' roll?
Post by: The Worid on March 18, 2009, 01:17:31 PM
QuoteOriginally Posted by Age of Fable
((n/d)^Y) * (1-(((n-1)/n)^Y))

I did some calculations with this, but not being terribly adept at mathematics, the results don't really mean anything to me. Any chance you could give me an idea as to how much your chances increase on successive additions of d10s, take the highest? I'm trying to make a skill system based on that, and I want to know how high I should go with the number of dice I allow. Thanks.
Title: What are the dice odds for a 'take highest' roll?
Post by: boulet on March 18, 2009, 03:02:00 PM
For game designers who need to toy around probabilities for their new improved secret mechanism there's a nice tool called troll (http://www.diku.dk/hjemmesider/ansatte/torbenm/Troll/). I'm not going to pretend it's user friendly. If you're allergic to math formulas, it's not for you. If you're scared of running an executable with a command line, it's not for you. But if you're willing to try and spend 20 minutes to understand the software you'll be rewarded.

Example:
Say I want to get probabilities for a pool of dice to have at least one die superior or equal to a target number. In troll language the formula could look like this :
   count N < x d y
which can be deciphered as : count the number of dice that exceeds N in a pool of x y-sided dice. Basically the roll is a success for any case where the count is superior to 0.
The command line to get a result looks like this :
   troll 0 filename.txt N=8 x=5 y=10
which means I demand an evaluation of probability for a succes on a 5d10 pool against a target of 8. Here is the result :
  Value    % =                 % >=
     0 :   32.768             100.0
     1 :   40.96               67.232
     2 :   20.48               26.272
     3 :    5.12                5.792
     4 :    0.64                0.672
     5 :    0.032               0.032

Average = 1.0    Spread = 0.894427191  Mean deviation = 0.65536

The case 0 (roll failed) is rated with a 32.7% chance. So basically it's a success with sth like 67% chance.

Spread good troll lovin' !
Title: What are the dice odds for a 'take highest' roll?
Post by: Age of Fable on March 19, 2009, 09:16:48 AM
Quote from: The Worid;290807I did some calculations with this, but not being terribly adept at mathematics, the results don't really mean anything to me. Any chance you could give me an idea as to how much your chances increase on successive additions of d10s, take the highest? I'm trying to make a skill system based on that, and I want to know how high I should go with the number of dice I allow. Thanks.

That formula is only for 3 dice.

I'll work this out ASAP - but chances of what?
Title: What are the dice odds for a 'take highest' roll?
Post by: The Worid on March 19, 2009, 12:30:08 PM
The idea is that you add your attribute+1d10, trying to exceed a target number. Skill levels allow you to roll more d10s, taking the highest to add to your attribute. My question is, how much does the average result go up by for each successive d10? So, if I needed a 6 or more (assume no bonus), I have a 50% chance at 1d10, and then higher chances at 2d10, 3d10, and so on.

Thank you again.
Title: What are the dice odds for a 'take highest' roll?
Post by: Age of Fable on March 20, 2009, 01:09:23 AM
Rolling X d10s, your chance of getting at least one result of Y or more:

Your chance of getting less than Y on a single roll is (Y-1)/10

Your chance of getting less than Y on all of X rolls is ((Y-1)/10)^X

So your chance of getting Y or more at least once on X rolls is 1-(((Y-1)/10)^X)
Title: What are the dice odds for a 'take highest' roll?
Post by: The Worid on March 26, 2009, 06:07:31 PM
I see. Many thanks; sorry for the delay in response.
Title: What are the dice odds for a 'take highest' roll?
Post by: Age of Fable on March 26, 2009, 09:55:44 PM
No worries.