Skip to content

Statistical probability of rolling all 18s

135

Comments

  • BelgarathMTHBelgarathMTH Member Posts: 5,653
    edited September 2013
    Before there's any agreement about the probability of rolling 6 18's, I think we need to agree on the probability of rolling *one* 18 on 3d6.

    For that reason, I think the point @MathSorcerer brings up is extremely relevant.

    Couldn't we easily confirm the total number of outcomes just by making a list of every possibility, and counting the number? Then, all you have to do is parse the sums of the combos into a bell shaped curve.

    So,

    111 112 113 114 115 116 121 122 123 124 125 126 131 132 133 134 135 136 141 142 143 144 145 146 151 152 153... etc. etc.

    If I could finish that list accurately, what would be the total of 3-digit outcomes? Based on my start there, it looks like I would wind up with 216 possible outcomes.

    So, @MathSorcerer, you almost had me convinced to look at it your way, but I can see that the thing that matters is the total number of possible outcomes, and there is only one way out of those possible outcomes to get a 3, and only one way to get an 18.

    Now, if the finished version of that numerical list I started up there only has 56 digits in the whole string, I stand corrected, and @MathSorcerer is right. But you can't start consolidating rolls that add up to the same sum, and counting all those rolls as the same result. Because they're not. They are *different* ways to get a sum by rolling 3d6.
  • WittandWittand Member Posts: 54
    edited September 2013
    The probability of rolling a18 with 3d6 does not depend whether you can distinguish the dice or not.
    If you can´t tell the difference between them you have 16 possible outcomes with :
    P(3)=P(18)=1*(1/6)^3
    P(4)=P(17)=3*(1/6)^3
    P(5)=P(16)=6*(1/6)^3
    P(6)=P(15)=10*(1/6)^3
    P(7)=P(14)=15*(1/6)^3
    P(8)=P(13)=21*(1/6)^3
    P(9)=P(12)=25*(1/6)^3
    P(10)=P(11)=27*(1/6)^3

    If you can difference the dice you have 216 possibilities and only one of them is 6/6/6 so that the probability is again 1/216 or (1/6)^3

    You can of course come from the second to the first by looking at the ways a sum can be achieved.
    e.g 16=6+6+4=6+4+6=4+6+6=6+5+5=5+6+5=5+5+6

    The fundamental mistake Mathsorcerer makes is that if you can distinguish the dice there is a difference between rolling 1/2/3 and rolling 2/1/3.

    The minimum stats of BG do not affect the probability of getting 18 since an invalid stat roll would simply be re-rolled and minimum stats are all below 18 so that the game never raises a stat to 18 due to class choice.
  • TJ_HookerTJ_Hooker Member Posts: 2,438
    edited September 2013

    Before there's any agreement about the probability of rolling 6 18's, I think we need to agree on the probability of rolling *one* 18 on 3d6.

    For that reason, I think the point @MathSorcerer brings up is extremely relevant.

    Despite the discussion on the last couple pages, the probability of rolling 18 with 3 fair, 6-sided dice is known with certainty (1/216). What MathSorcerer said doesn't really call this into question any more the sum of 2+2 would be called into question if I came along and said it equaled 5.
    Wittand said:

    The minimum stats of BG do not affect the probability of getting 18 since an invalid stat roll would simply be re-rolled and minimum stats are all below 18 so that the game never raises a stat to 18 due to class choice.

    It depends what you call a "roll". Are you referring to each instance of the game generating number for a stat, or are you talking about each instance of a player clicking the button? If referring to the latter, minimum stats actually would increase the chances of getting 18 (assuming the game re-generates the values for that stat, rather than just bumping it up to the minimum). For example:

    The chance of rolling 17 or 18 CHA for a paladin (i.e. a value that the game wouln't have to re-roll) is 4/216=1/54. That means that, on average, the game will have to re-roll the CHA value 54 times each time the player clicks, in order to get an acceptable value. That means that the probability of rolling an 18 is 1-[(1-1/216)^54]=0.22165

    Edit: oops, looks like I borked the calculations here. As @Wittand points out below, in my paladin example you would have exactly 1/4 chance of rolling 18.
    Post edited by TJ_Hooker on
  • WittandWittand Member Posts: 54
    TJ_Hooker said:


    The chance of rolling 17 or 18 CHA for a paladin (i.e. a value that the game wouln't have to re-roll) is 4/216=1/54. That means that, on average, the game will have to re-roll the CHA value 54 times each time the player clicks, in order to get an acceptable value. That means that the probability of rolling an 18 is [(1-1/216)^54]-1=0.22165

    That is only true if the game rerolls the stats and does not simply set them to the minimum.

    Also you make a mistake if the game acts like you suggest the chance of getting an 18 would be exactly 0.25 since from the four cases that the rerolling would stop one results in 18.

    If I recall correctly the game first checks whether the sum of the six stats is high enough. If not it rerolls.
    If the total sum is high enough next the game checks if the class requirements are met and raises them to the minimum if necessary. If this is true the minimum stat has no influence on the likelihood of a roll resulting in 18.
  • JarrakulJarrakul Member Posts: 2,029
    I'm pretty sure it rerolls stats that are below the minimum, rather than just bumping them up. I base this on my observations of how often a paladin rolls at 18 for Charisma. If it bumped the stat to the minimum, we would expect a 17 Charisma in almost all cases and an 18 in about 1/216 rolls (since a 1-point variation in Charisma isn't gonna trigger very many whole-statline rerolls). However, anecdotally, I seem to roll 18 Charismas a lot when rolling for paladins. To verify this, I just ran 60 trials, and got 15 18s. That's precisely the number that we would expect if the game rerolled stats that were too low, and astronomically above the number we'd expect if the same simply bumped the stat to the minimum. Therefore, I conclude that the game rerolls the stats.

    I am, however, too lazy to run the statistics on this right now, so if someone else wants to do so and prove me wrong, go ahead.
  • gesellegeselle Member Posts: 325
    Wilbur said:

    I think it's 50/50. You either roll it or you don't.

    For this comment you deserve the "shovel and shotgun" treatment....

  • FinneousPJFinneousPJ Member Posts: 6,455
    @Wilbur Yeah, like the lottery - you either win it or you don't ;) We come to the same folly as @Mathsorcerer. The number of possible outcomes isn't the same as a probability distribution.
  • TJ_HookerTJ_Hooker Member Posts: 2,438
    I'm pretty sure @Wilbur was joking...
  • FinneousPJFinneousPJ Member Posts: 6,455
    Well, just to be sure people aren't confused.
  • WilburWilbur Member Posts: 1,173
    geselle said:

    Wilbur said:

    I think it's 50/50. You either roll it or you don't.

    For this comment you deserve the "shovel and shotgun" treatment....

    Just to be clear, I don't REALLY think it's 50/50 chance.
  • sarevok57sarevok57 Member Posts: 5,975
    I had a ranger roll 98 before or was it 99? something on those lines, I believe the only class that stands a chance is a ranger from vanilla bg2, because that is where I got it, im pretty sure on like try 5 I got nothing but 16s and 17s, and I was like whoooooooooooooa since when did bg2 be so nice on rolling good stuff?
  • clanquiclanqui Member Posts: 4
    If you look at a paladins charisma rolls. It seems to run ~ 1/4 18's, which is consistent with re-rolling rather than raising them to the minimum.
  • blackchimesblackchimes Member Posts: 323
    The probability of rolling all 18s on the character screen is the same as the probability of rolling any other combination of numbers.

    At least that's what I like to tell myself when I press the "Reroll" button after 500th time.
  • WittandWittand Member Posts: 54
    edited September 2013
    If a too low roll results in a reroll the chance for a perfect roll depend on the class I will just do the math for a Paladin with minimum abilities S=12;D=3;C=8;I=3;W=13;Ch=17 .
    P(S=18)=1/81 ; P(D=18)=1/216 ; P(C=18)=1/160 ; P(I=18)=1/216 ; P(W=18)=1/56 ; P(Ch=18)=1/4.

    A perfect roll for a paladin has the probability 1/135444234240. So that you have more than 50% likelihood to roll a perfect result you need ~10*10^10 tries. With one try per second this would take nearly 3138 years.
    Post edited by Wittand on
  • karnor00karnor00 Member Posts: 680

    The only results from 3d6, presuming you are interested in the sum total, are
    111, 112, 113, 114, 115, 116, 122, 123, 124, 125, 126 ...blah blah blah.

    Um, 116 adds up to the same as 125. And 115 is the same as 124. etc, etc.

    The only results from 3d6, presuming you are interested in the sum total are numbers in the range from 3 to 18. Which is a range of 16 possible results. No idea where you are getting your 56 different results from - just seems to be a mistake on your part.

    If you don't ignore the order of the rolls then the odds of rolling any specific sequence is 1 in 216. So theres an equal chance of rolling 666, 566, 656, 665, etc. However only one of those sequences adds up to 18, which is 666 (so 1 in 216 change).

    Three of the 216 possible sequences add up to 17, hence the chance of rolling a 17 is 3/216 (=1/72). There are six different ways to roll 16 (664, 646, 466, 556, 565, 556) so there is a 6/216 chance of rolling a 16. etc, etc. The most likely roll is 10 or 11 (equal probability) simply because there are a lot of sequences which add up to 10 and 11.

  • karnor00karnor00 Member Posts: 680
    Wittand said:

    If a too low roll results in a reroll the chance for a perfect roll depend on the class I will just do the math for a Paladin with minimum abilities S=12;D=3;C=8;I=3;W=13;Ch=17 .
    P(S=18)=1/81 ; P(D=18)=1/216 ; P(C=18)=1/160 ; P(I=18)=1/216 ; P(W=18)=1/56 ; P(Ch=18)=1/4.

    A perfect roll for a paladin has the probability 1/135444234240. So that you have more than 50% likelihood to roll a perfect result you need ~10*10^10 tries. With one try per second this would take nearly 3138 years.

    Unfortunately this still isn't quite right because you've overlooked the fact that a roll total below 75 will be rerolled. That's going to skew the results somewhat - for example rolling a 3 in dex is much more likely to result in a full reroll than rolling an 18 in dex, so you are much less likely to see a 3 than an 18.

    It's a pretty complicated problem.

    On top of that, BG doesn't use a properly random system but a pseudorandom system based on a pregenerated random number sequence. And it's very possible that the pregenerated random sequence simply doesn't contain a suitable sequence for an all 18 roll. However, this does depend on exactly how the pregenerated sequence is accessed. But I wouldn't be too surprised if the actual chance turned out to be zero.

  • MathsorcererMathsorcerer Member Posts: 3,037

    @Wilbur Yeah, like the lottery - you either win it or you don't ;) We come to the same folly as @Mathsorcerer. The number of possible outcomes isn't the same as a probability distribution.

    What he said--this was clearly the flaw in my thinking on this particular topic, as evidenced by experimental data of rolling thousands or millions of instances of 3d6. p(18) = 1/216 so rolling all 18s =(1/216)^6 = 9.846*10^-15 so it will never happen.

    (I generally take the weekends off from the Internet)

  • JarrakulJarrakul Member Posts: 2,029

    The probability of rolling all 18s on the character screen is the same as the probability of rolling any other combination of numbers.

    At least that's what I like to tell myself when I press the "Reroll" button after 500th time.

    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).

    Now, @Mathsorcerer, we do know that the probability is somewhat better than p(18)^6, because the game discards a lot of rolls. The 75 minimum alone rules out 94.36% of the entire distribution. Racial and class minimums interact with that in ways that are annoying (or very time-consuming) to compute, but they do raise the odds somewhat more. Eyeballing it, though, I'd even believe that paladins and rangers could leave us with as little as the top .1% of the distribution. Which, of course, would still leave us with p(all 18s) ~= 9.846 * 10^-12. Which means that if you rolled once per second, on average, you'd be rolling for a bit more than 312,000 years before you got all 18s. So basically your point stands. :P
  • BelgarathMTHBelgarathMTH Member Posts: 5,653
    What I do really like about @Mathsorcerer's theory, though, is that, even though it is flawed, and probably turns out to be false, he is thinking outside the box, and trying to make intuitive leaps of insight. The field of mathematics needs people like that. That's how new theories get created, how "unsolvable" problems get solved, and how "unprovable" theorems get proved.

    Creativity in mathematics ties directly to the field of physics, and will be the way we might eventually travel the galaxy in warp starships, or say "Beam me up, Scotty!", and have it actually happen.

    One might come up with a thousand new mathematical or scientific theories that turn out to be false, but strike gold on that thousand and first. For that reason, I don't think we should discourage people in mathematics and the sciences from trying out new ideas and ways of looking at old ideas, as long as they are willing to submit those ideas to stringent peer review and testing, and are willing to say "Oh, yeah, I guess this doesn't work, after all."

    Even Stephen Hawking has admitted that some of his early theories turned out to be wrong. Almost no one doubts his genius despite that, and, in fact, I respect him more for admitting he was wrong about some things.

  • karnor00karnor00 Member Posts: 680
    Jarrakul said:

    Now, @Mathsorcerer, we do know that the probability is somewhat better than p(18)^6, because the game discards a lot of rolls. The 75 minimum alone rules out 94.36% of the entire distribution. Racial and class minimums interact with that in ways that are annoying (or very time-consuming) to compute, but they do raise the odds somewhat more. Eyeballing it, though, I'd even believe that paladins and rangers could leave us with as little as the top .1% of the distribution. Which, of course, would still leave us with p(all 18s) ~= 9.846 * 10^-12. Which means that if you rolled once per second, on average, you'd be rolling for a bit more than 312,000 years before you got all 18s. So basically your point stands. :P

    One of the things to be very careful about when assessing probabilities, is that if enough trials are run then the likelihood of an extreme result appearing can become quite likely.

    Let's assume paladin results are restricted to the top 0.1% of the full rolling distribution. And lets assume that 1m players have played BG over the years (for the sake of argument all playing paladins). And let's assume they have each clocked up 1000 stat rolls during their playing time.

    Suddenly our 9.8 * 10^-15 becomes 9.8 * 10^-3. Which would be about a 1 in 100 chance that someone has had a full 18 roll. Still unlikely, but no longer particularly outlandish. With a few more players or a bit more rolling it wouldnt' take too much before there is a reasonable chance of someone having seen such an event (assuming, of course, that the pseudorandom generator even contains the possibility).

    It's like playing the lottery. Odds of winning are millions to one. But with millions of players, odds are good that someone will win it.
  • Permidion_StarkPermidion_Stark Member Posts: 4,861
    Rolling all 18s is pretty unlikely. I doubt I've done it more than two or three times.
  • FinneousPJFinneousPJ Member Posts: 6,455
    @Karnor00 It's like everything that ever happened. You could say, that to call anything that has a finite probability a miracle or to say "it will never happen," is to grossly underestimate the number of things, events, there are ;)
  • WittandWittand Member Posts: 54
    karnor00 said:

    Jarrakul said:

    Now, @Mathsorcerer, we do know that the probability is somewhat better than p(18)^6, because the game discards a lot of rolls. The 75 minimum alone rules out 94.36% of the entire distribution. Racial and class minimums interact with that in ways that are annoying (or very time-consuming) to compute, but they do raise the odds somewhat more. Eyeballing it, though, I'd even believe that paladins and rangers could leave us with as little as the top .1% of the distribution. Which, of course, would still leave us with p(all 18s) ~= 9.846 * 10^-12. Which means that if you rolled once per second, on average, you'd be rolling for a bit more than 312,000 years before you got all 18s. So basically your point stands. :P

    One of the things to be very careful about when assessing probabilities, is that if enough trials are run then the likelihood of an extreme result appearing can become quite likely.

    Let's assume paladin results are restricted to the top 0.1% of the full rolling distribution. And lets assume that 1m players have played BG over the years (for the sake of argument all playing paladins). And let's assume they have each clocked up 1000 stat rolls during their playing time.

    Suddenly our 9.8 * 10^-15 becomes 9.8 * 10^-3. Which would be about a 1 in 100 chance that someone has had a full 18 roll. Still unlikely, but no longer particularly outlandish. With a few more players or a bit more rolling it wouldnt' take too much before there is a reasonable chance of someone having seen such an event (assuming, of course, that the pseudorandom generator even contains the possibility).

    It's like playing the lottery. Odds of winning are millions to one. But with millions of players, odds are good that someone will win it.
    Probability does not work that way.
    If the chance of a perfect roll is x, then the chance of at least one try of y results in a perfect roll is not x*y like you suggest but 1-(1-x)^y.
    With your method the probability could exceed 1, breaking the laws of probability theory.
  • XereckXereck Member Posts: 30
    Wow, looking at the numbers in this post makes me appreciate my 102 stat Cavalier even more :p
  • MathsorcererMathsorcerer Member Posts: 3,037
    Jarrakul said:


    Now, @Mathsorcerer, we do know that the probability is somewhat better than p(18)^6, because the game discards a lot of rolls. The 75 minimum alone rules out 94.36% of the entire distribution. Racial and class minimums interact with that in ways that are annoying (or very time-consuming) to compute, but they do raise the odds somewhat more. Eyeballing it, though, I'd even believe that paladins and rangers could leave us with as little as the top .1% of the distribution. Which, of course, would still leave us with p(all 18s) ~= 9.846 * 10^-12. Which means that if you rolled once per second, on average, you'd be rolling for a bit more than 312,000 years before you got all 18s. So basically your point stands. :P

    I freely admit that I do not know exactly what formula the game is using to generate the random stats; I suspect it is the "4d6 - the lowest" result, the analysis of which is listed above thanks to @arondes. It is true that stats like the paladin charisma follow at least the rule of max(17,3d6) or max(17, 4d6-lowest) to give only results of 17 or 18. Truly old-school gamers, though, know that you are supposed to roll your stats first and then pick a class that fits what you get.

    If I had to list all the times I had been incorrect, even when math is concerned, we would be here a while and I would run out of space to write.
  • ShYarivShYariv Member Posts: 119
    I'll just shamelessly put this here.

    It assumes 3d6 rolls for each stat and rerolls if the result is inapropriate. There is a better explanation in the linked thread.
    I actually have a much better updated version of that file, but I'm on a road trip right now and won't be able to upload it this week.
  • BelgarathMTHBelgarathMTH Member Posts: 5,653
    edited October 2013
    Hmm, I hope I am not about to derail this discussion of Baldur's Gate stat probability theory, but I have just been made by this discussion to think of something that is perhaps a bit more ultimately, humanly, religiously, scientifically, educationally, and politically significant. Especially humanly.

    Probability theory is often abused by creationists historically, and most recently, by proponents of so-called "intelligent design" theory, to attempt to refute the (imo iron-clad) Theory of Evolution in biology.

    The most frequent refutation of the use of probability theory to attempt to counter biological evolutionary theory, is that, given the billions of years of the existence of the universe, or even, "merely" the four billion years of the existence of the Earth, probability theory becomes irrelevant.

    That is, so the thinking goes, given enough enormity of time scale, *any* outcome that is even remotely possible, even to the billions to one in probability, *will* happen, inevitably. Up to and including every stage of evolution from helium, to hydrogen, to carbon, to inert organic compound, to amino acid, to protein, to DNA, to mitochondria, to single-celled LIFE (and that is the critical improbable event, through random probability alone), to bacteria, to virus, plankton, protozoa, to multicellular plant and animal, and every other myriad step from there to fully functioning, sentient, human being.

    Yet, many of the arguments I'm seeing here, under the name of "probability theory", seem to me to be saying that time scale is irrelevant, and that, the chance of even a 1/infinity event is exactly the same for every "roll", i.e. NEVER. Yet, every fortunate person out there who has ever won a lottery is there to intuitively tell us that time scale, and number of "rolls", absolutely DOES matter.

    If the chance of an outcome is one in a million billion, but you have 10 million billion rolls to make, then that outcome is GOING to happen ten times.

    That would mean, that if you cannot prove mathematically that some state of outcome is IMPOSSIBLE, under ANY circumstance, that it is actually INEVITABLE that it WILL occur. Somewhere, somehow, sometime.

    So, to anyone who might think I am going off-topic, I would attempt to bring this post back on-topic by asking, is the chance of rolling six 18's on six rolls of 3d6, greater, or less, than the probability of having a single-celled life form come into existence through random interaction of matter and energy as we know it since the big bang?

    Or, can we agree that, even though the likelihood of the 6 18's is greater than the likelihood of helium turning into a single-celled living organism, that the likelihood of either is so much greater than a human lifespan, that none of us will ever see either event, thus rendering the whole discussion kind of moot.

    The only thing I could see that would make this *not* moot, would be, is the probability of rolling 6 18's on 3d6 equal to or less than the probability of winning a lottery jackpot? And, if it is within that boundary, then, someone must have surely "won" it. All we need is a screenshot from that lottery winner showing the 6 18's to render this whole discussion moot (pending verifiability of authenticity). :)
    Post edited by BelgarathMTH on
  • ljboljbo Member Posts: 177
    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.

  • TJ_HookerTJ_Hooker Member Posts: 2,438
    edited October 2013

    Hmm, I hope I am not about to derail this discussion of Baldur's Gate stat probability theory, but I have just been made by this discussion to think of something that is perhaps a bit more ultimately, humanly, religiously, scientifically, educationally, and politically significant. Especially humanly.

    Probability theory is often abused by creationists historically, and most recently, by proponents of so-called "intelligent design" theory, to attempt to refute the (imo iron-clad) Theory of Evolution in biology.

    The most frequent refutation of the use of probability theory to attempt to counter biological evolutionary theory, is that, given the billions of years of the existence of the universe, or even, "merely" the four billion years of the existence of the Earth, probability theory becomes irrelevant.

    That is, so the thinking goes, given enough enormity of time scale, *any* outcome that is even remotely possible, even to the billions to one in probability, *will* happen, inevitably. Up to and including every stage of evolution from helium, to hydrogen, to carbon, to inert organic compound, to amino acid, to protein, to DNA, to mitochondria, to single-celled LIFE (and that is the critical improbable event, through random probability alone), to bacteria, to virus, plankton, protozoa, to multicellular plant and animal, and every other myriad step from there to fully functioning, sentient, human being.

    AKA the Law of Infinite Monkey

    Yet, many of the arguments I'm seeing here, under the name of "probability theory", seem to me to be saying that time scale is irrelevant, and that, the chance of even a 1/infinity event is exactly the same for every "roll", i.e. NEVER. Yet, every fortunate person out there who has ever won a lottery is there to intuitively tell us that time scale, and number of "rolls", absolutely DOES matter.

    Yes, the probability of rolling all 18s (for example) on a single roll is the exact same no matter how many rolls you make. But if you instead look at the probability of getting one roll of all 18s over the course of many rolls, your odds will of course improve. So as the number of rolls goes to infinity, the probability of rolling all 18s approaches 1.

    If the chance of an outcome is one in a million billion, but you have 10 million billion rolls to make, then that outcome is GOING to happen ten times.

    Not quite. One would expect it to happen 10 times. For any finite number of rolls, you can never say it will definitely happen.
    Post edited by TJ_Hooker on
Sign In or Register to comment.