Skip to content

Statistical probability of rolling all 18s

124

Comments

  • lamaroslamaros Member Posts: 139
    ljbo said:

    The subject has already been fully investigated in the good ol' days, by automatically generating a vast number of rolls and collecting stats:

    http://web.archive.org/web/20070614212358/http://forums.bioware.com/viewtopic.html?topic=609048&forum=17

    The conclusion was that BG1 and BG2 used the same algorithm and that the game keeps rolling a 3d6 for each stat until class/race minima are met and until the total is at least 75. The page I have just quoted actually gives the probabilities measured during the generation of a human mage.

    The only uncertainty pointed out in this old discussion is about the order of those checks and rerolling. I.e. does the game roll until a total of 75 is met and then keep rolling only those stats that did not meet the minima? or does the game checks all constraints together? A priori that could give different distributions.

    You would assume if it was the former then it would skew higher than expected, so it would make *sense* for it to be the latter.
  • ljboljbo Member Posts: 177
    @lamaros it seems to me that at this point, any theory should be validated against experiment! The distribution of charisma for a Paladin seems a good discriminator to me, since there are only 2 possible values and it is therefore easy to gather meaningful stat by hand, and therefore on a small sample.
    lolien
  • lamaroslamaros Member Posts: 139
    edited October 2013
    I guess the most simple test would be to calculate the average expected roll for the former and latter (in total points). But I really don't care enough to do so!

    Also it just makes far more sense for the game to go,

    1. Roll 3d6 for stat 1. Check if it meets the class/race minimum. Reroll if not.
    2-6. Roll 3d6 for stat 2-6. Check if it meets the class/race minimum. Reroll if not.
    7. Check if total is above 74. Start over at 1 if not.

    than,

    1-6. Roll 3d6 for stat 1-6.
    7. Check if total is above 74. Start over at 1 if not.
    8. Check if stat 1 meets the class/race minimum. Reroll until it does if not.
    9-13. Check if stats 2-6 meet the class/race minimum. Reroll until it does if not.

    Not just because the second method would give high minimum stat class/race combos even better rolls than they would already, but because it's just a more logical and straightforward process.

    Given the high minimums for some combos it shouldn't be too hard to check though, if someone is keen enough.
    lolien
  • kabkab Member Posts: 75
    This entire discussion is moot and irrelevant to Baldur's Gate. It does not matter what the probability of rolling an 18 in PnP is.

    What matters is the specific algorithm used by Baldur's Gate, which may or may not make the class also relevant, and the quality of the RNG implementation. In any case getting a roll of 108 is nearly impossible. If you feel like running a simulation there is already a program out there, it's actually an AutoIt script if I recall, that works with BG2 and rerolls storing the highest number it finds.
    BelgarathMTH
  • lamaroslamaros Member Posts: 139
    kab said:

    This entire discussion is moot and irrelevant to Baldur's Gate. It does not matter what the probability of rolling an 18 in PnP is.

    What matters is the specific algorithm used by Baldur's Gate, which may or may not make the class also relevant, and the quality of the RNG implementation. In any case getting a roll of 108 is nearly impossible. If you feel like running a simulation there is already a program out there, it's actually an AutoIt script if I recall, that works with BG2 and rerolls storing the highest number it finds.

    Most of the discussion is about how BG actually works it out... off in your own world there?
  • blackchimesblackchimes Member Posts: 323
    edited October 2013
    Jarrakul said:

    Sadly, this isn't actually true. If stats were rolled on d15+3, then it would be true. But 3d6 has a probability distribution that makes 18 far less likely than, say, 10 (because there are many ways 3d6 can add up to 10, but only one way they can add up to 18).

    And why do you think the game rolls three d6s?

    If you want to generate a number between 3 and 18, which code would you rather use?

    STR = GenerateRandomNumber(3,18);

    or

    STR = GenerateRandomNumber(1,6) + GenerateRandomNumber(1,6) + GenerateRandomNumber(1,6);

    I find it hard to imagine Black Isle would be so focused on accurately representing the DnD that they would bother with the second option. And you don't have to be a programmer to see it's just needless complication.
  • WittandWittand Member Posts: 54
    @belgarathmth
    I don´t want to derail the thread too much so I will only address one point.
    No enough time does not mean that everything that is possible will happen. The mistake here is that one assumes that there is only one size of infinite. But there are many sizes of infinite. The smallest of which are the number of natural numbers, the (possibly) next bigger size being the number of real numbers. The possibly here is because it is not clear if there are other infinities between those two.

    Also in non-standard analysis there are infinite high numbers, numbers that are so high that you can never reach them in any finite amount of time by counting.



    BelgarathMTH
  • lamaroslamaros Member Posts: 139

    Jarrakul said:

    Sadly, this isn't actually true. If stats were rolled on d15+3, then it would be true. But 3d6 has a probability distribution that makes 18 far less likely than, say, 10 (because there are many ways 3d6 can add up to 10, but only one way they can add up to 18).

    And why do you think the game rolls three d6s?

    If you want to generate a number between 3 and 18, which code would you rather use?

    STR = GenerateRandomNumber(3,18);

    or

    STR = GenerateRandomNumber(1,6) + GenerateRandomNumber(1,6) + GenerateRandomNumber(1,6);

    I find it hard to imagine Black Isle would be so focused on accurately representing the DnD that they would bother with the second option. And you don't have to be a programmer to see it's just needless complication.
    Yeah, why would they try to create or re-imagine DnD rules? It's not like that this actual game they're making... oh, wait.
  • blackchimesblackchimes Member Posts: 323
    Because the only reason why you are rolling three d6 is because a dice with 15 sides numered from 3 to 18 doesn't exist.

    Not some kind of Gygax's master plan of probabilities.
  • WittandWittand Member Posts: 54

    Because the only reason why you are rolling three d6 is because a dice with 15 sides numered from 3 to 18 doesn't exist.

    Not some kind of Gygax's master plan of probabilities.

    Actually three dice are used because that way the extremes become much more unlikely. You could throw two eight-sided dice too, or a twelve-sided one and a four-sided one, but that way the results would be much more spread out, and extremes on either end would become far more likely, making luck even more important as it is now.

    PS. A dice numbered from 3 to 18 would require 16 faces.
  • karnor00karnor00 Member Posts: 680
    The fact that the 1st edition D&D handbooks contained several different methods for rolling stats, along with a description of the impact these different methods would have on stat distribution, is a clear indication that Gary Gygax understood the difference between 3d6 and 1d16+2.
  • MathsorcererMathsorcerer Member Posts: 3,037
    Wittand said:

    Actually three dice are used because that way the extremes become much more unlikely. You could throw two eight-sided dice too, or a twelve-sided one and a four-sided one, but that way the results would be much more spread out, and extremes on either end would become far more likely, making luck even more important as it is now.

    I had an alternate method that was used for generating characters by rolling 5d4-2, which will also give results of 3 to 18 but the extremes are much more unlikely than with 3d6. You are more unlikely to get 16s because the vast majority of your stats will be 9 - 12, so at least you won't have any drawbacks or penalties and you also won't have to worry too much about getting stats below 6.

  • FinneousPJFinneousPJ Member Posts: 6,455
    thespace said:

    What is the statistical probability that when you do roll all 18s that you won't notice it until you hit reroll one more time?

    100 %
    Fredjo[Deleted User]Pibaro
  • JLeeJLee Member Posts: 650
    edited October 2013
    All I know is if I ever roll a 108, I kinda hope it is not with /00 strength. No one here would believe me. I didn't just ctrl+8, I swear!!!!
    alnairPibarololien
  • JarrakulJarrakul Member Posts: 2,029
    edited October 2013
    @blackchimes, I think the game uses 3d6 because a) that's what others have concluded previously based on observed distributions, and b) that's what I personally observed in the highly-controlled case of paladin Charisma, which I noted somewhere on page 3 of this thread. If we roll 3d6, we'd expect either 1/4 or 1/216 of paladins to roll an 18 Charisma (depending on how minimums are implemented). If we roll 1d16+2, we'd expect either 1/2 or 1/15th of paladins to roll at 18 Charisma (again, depending on how minimums are implemented). Since the observed frequency is 1/4, I conclude both that the game uses 3d6 (or something close to it) and that minimums are implemented with rerolls.

    As for which random number generator I would use if I were writing the code myself, it depends on what purpose I had in mind for the code. I would certainly consider the final probability distribution to be of crucial importance. Much more important than the added burden of having to write two more function calls, which in this case would take about 5 seconds.

    EDIT: 1d16+2, not 1d15+3. Funny how the part I mess up is the part involving basic addition.
    Post edited by Jarrakul on
    alnairlolien
  • AstroBryGuyAstroBryGuy Member Posts: 3,437

    And why do you think the game rolls three d6s?

    If you want to generate a number between 3 and 18, which code would you rather use?

    STR = GenerateRandomNumber(3,18);

    or

    STR = GenerateRandomNumber(1,6) + GenerateRandomNumber(1,6) + GenerateRandomNumber(1,6);

    I find it hard to imagine Black Isle would be so focused on accurately representing the DnD that they would bother with the second option. And you don't have to be a programmer to see it's just needless complication.

    Its not a needless complication if you're looking for a particular distribution of the results.

    Also, if you look at the BIoWare forum posting @ljbo posted, the statistics bear out that the devs programmed Baldur's Gate to "roll" 3d6 for stats (with re-rolling for race/class minimums and totals less than 75).

    http://web.archive.org/web/20070614212358/http://forums.bioware.com/viewtopic.html?topic=609048&forum=17
  • ljboljbo Member Posts: 177
    ljbo said:

    The distribution of charisma for a Paladin seems a good discriminator to me, since there are only 2 possible values and it is therefore easy to gather meaningful stat by hand, and therefore on a small sample.

    Actually the old discussion I quoted had the answer to that question, and I confirmed with BGEE on my iPad: one gets very close to 3 times more 17's than 18's with about 100 rolls, which is exactly what it would be if the game rolled 3d6 throwing away anything that is not 17 or 18. It's easy to see: there is only one way to make 18 = 6 + 6 + 6, but three ways to make 17 = 5 + 6 + 6 = 6 + 5 + 6 = 6 + 6 + 5. Hence the 1 : 3 ratio between 18's and 17's.
  • ljboljbo Member Posts: 177
    In any case, the answer given by @pixie359 near the very beginning of this thread of discussion is correct since there is only one way to get all 18's, and that draw passes all the cutoffs from class/race minima and the cutoff on total 75. Remain the issue of exceptional strength!
  • Avenger_teambgAvenger_teambg Member, Developer Posts: 5,862
    Isn't there a hotkey to get all 18's? I don't want to ruin your rerolling experience, but playing the game might be more fun :D
    lolien
  • JarrakulJarrakul Member Posts: 2,029
    Ctrl-shift-8, if I recall, and debug mode has to be active. But debating various aspects of the probability is more fun.

    @ljbo, the problem is that, while all-18s passes all the checks, many other possible rolls don't and thus will be discarded. That's what makes this problem difficult. We know the numerator (1), but the denominator is more resistant to the usual methods of non-brute-force computation.
    alnairGrammarsalad
  • WittandWittand Member Posts: 54

    Isn't there a hotkey to get all 18's? I don't want to ruin your rerolling experience, but playing the game might be more fun :D

    There is but it always sets the strength to 18/00 even for non warrior classes and feels too much like cheating.
    I personally use gamewiz32, to give me the best possible stats for the class I am playing.
  • OzzyBotkinsOzzyBotkins Member Posts: 396
    Well it depends on class and race. since all classas and races have minimum rolls in certain stats
  • ljboljbo Member Posts: 177
    Jarrakul said:


    @ljbo, the problem is that, while all-18s passes all the checks, many other possible rolls don't and thus will be discarded. That's what makes this problem difficult. We know the numerator (1), but the denominator is more resistant to the usual methods of non-brute-force computation.

    I stand corrected indeed. Stupid me, since the example of the charisma of Paladin that I use as an illustration precisely highlights that point of yours.

  • JarrakulJarrakul Member Posts: 2,029
    @ljbo, don't feel bad! You made a logical inference (which is good and you should keep doing it), it turned out to be wrong (which happens to the best of us), and then you admitted that it was wrong (which all of us, myself included, could stand to do more often). That puts you ahead of the game in my book.
    JLeealnairlolien
  • CrevsDaakCrevsDaak Member Posts: 7,155
    I rolled a 101 while creating a Bard in ToB, but I had the Race Modifiers up by some points to simulate the tomes you use in BG1.
  • the_spyderthe_spyder Member Posts: 5,018
    Went to D&D camp when I was young. We had this pick-up game with a bunch of the other campers and this one guy brought his "Paladin" with all 18s. Naturally our DM questioned him on this, asking if he had rolled it naturally or not. He indicated that he had.. He then proceeded to produce the computer program that had 'Randomly' generated stats in succession until he cam up with the character he wanted. Not only was it all 18s, but it was 18/00 too boot.
  • CoryNewbCoryNewb Member Posts: 1,330
    image
    MetallomanCrevsDaak
  • DagothDagoth Member Posts: 3
    I wondered this..saw this thread and was like damn people are bad at math. Skip to the end and get this answer.


    d6 = 1/6 chance to get any number.
    So to get 1 set of 18 is 1/6 x (1/6) x (1/6)
    or simply
    1/6^3

    6 set of 18's is
    1/6^(3 DICE * 6 STATS)
    =
    1/6^18
    approximately is =
    0.00000000000000984640

    You do not need to take into account minimum's because..each roll is still the same probability. The game just rolls up at end - not for each roll. The only way to roll a 18 is still 1/6^3.

    (Minimums only matter if you are just going for a higher sum..but not a perfect sum)


    Good luck rolling...settle for a total over 100 or just actually role play your actions!
Sign In or Register to comment.