Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Dark Dreams of Furiae - a new module for NWN:EE! Buy now
Attention, new and old users! Please read the new rules of conduct for the forums, and we hope you enjoy your stay!

The true odds of rolling 108

JarrakulJarrakul Member Posts: 2,029
So, every so often, someone asks what the probability is of roll a perfect 108 statline. Consistently, people give a lot of wrong answers (1/6^18 is a common favorite), and a lot of "I don't know"s. Because, well, the problem is hard. The game's built-in rerolling of too-low stats complicates the probabilities dramatically. For a long time, all we knew was that the true probability was very low, but much higher than 1/6^18. Until now.

Through the wonders of linear algebra and Matlab, it's now possible to instantly compute the probability of rolling a 108 (or any other total) for any given race/class combination. Multiclasses are still a work in progress, but that's just because I'm excited to post this, not because they're at all hard to add.

So what are the odds? Well, there are a lot of possible combinations, so I'll just post the ones that give the best and worst odds:

Human fighter (/thief/cleric/mage): 1 in 496.25 billion
Human paladin: 1 in 5.3104 billion
Elf ranger: 1 in 198.03 million

Note that I made a couple assumptions when computing these probabilities. In particular, I assumed that the game rerolls any statline below a given minimum (which is supported by my testing), and that racial modifiers (the elf +1 Dex, for example) are added after the roll is made but before the roll is compared to the various minimums (this is less supported by evidence, but I'm not sure how else they'd do it).

EDIT: I'm also assuming the game rolls 3d6 to generate stats, as opposed to 4d6 drop lowest. This is most likely correct, but the two are very difficult to distinguish without extensive testing.

Post edited by Jarrakul on
GrumJuliusBorisovjoluv

Comments

  • semiticgoddesssemiticgoddess Member Posts: 14,768
    When you were calculating this, did you assume a flat 3d6 roll, or roll 4d6 and drop the lowest? BG2 uses the 4d6 roll, which would influence the results.

    JuliusBorisov
  • JarrakulJarrakul Member Posts: 2,029
    I was using the 3d6 roll, because in my testing, that seems to be what the numbers are doing. Are you saying it's actually different between games? I'll admit, I didn't cross-check.

  • JarrakulJarrakul Member Posts: 2,029
    Testing 147 rolls' paladin charisma scores (73 from BG2, 74 from BG1; I just kept rolling until I rolled 50 17s for each game), they look like they're using the same rolling method, and the numbers are bit closer to what you'd expect from 3d6 (p = .98) than what you'd expect from 4d6 (p = .88), but the margin is way too close to say for sure. On either count, really.

  • semiticgoddesssemiticgoddess Member Posts: 14,768
    @Jarrakul: I don't know about vanilla BG1 or IWD, or if EE is any different, but it was my understanding that 4d6 was the case for BG2, and I assume the other IE games worked the same way. I haven't done tests myself; this is just what I've heard.

  • deltagodeltago Member Posts: 7,723
    Jarrakul said:


    So what are the odds? Well, there are a lot of possible combinations, so I'll just post the ones that give the best and worst odds:

    Human fighter (/thief/cleric/mage): 1 in 496.25 billion
    Human paladin: 1 in 5.3104 billion
    Elf ranger: 1 in 198.03 million

    perspective:

    chance to win 7/7 on a 1 to 49 lottery ticket = 1 in 28,633,528.

    sarevok57MacHurto
  • JarrakulJarrakul Member Posts: 2,029
    Hm. Well, will test further next time I'm very bored. Thanks for bringing that up, @semiticgod . I'll edit the OP to mention that assumption.

    Also, have an estimate of the probabilities for 4d6 drop lowest. Some of the math for these ones is taken from anydice.com, which is why it's an estimate; anydice is great, but it's a simulator, which means it's not always fully accurate. I could do a true algorithmic solution, but it's kind of a pain, and I'm annoyed by the inelegance of the math when I just got a beautiful solution working for the 3d6 version. Which is nobody's fault, of course. It's just that dropping the lowest die breaks all my pretty linear algebraic formulas.

    Human fighter: 1 in 84.873 billion
    Human paladin: 1 in 2.1703 billion
    Elf ranger: 1 in 18.22 million

    semiticgoddess
  • sarevok57sarevok57 Member Posts: 5,474
    if from what I can recall, back in the vanilla days, I noticed that it was harder to get higher roll stats in bg2 than it was in bg1, unless I made a paladin or ranger in bg2, I rarely if EVER saw over 90 in vanilla bg2 ( and trust me a made A LOT of characters and I rerolled A LOT as well) I always noticed that back in the vanilla days I would always get higher roll stats in vanilla bg1 as apposed to vanilla bg2

  • FinneousPJFinneousPJ Member Posts: 6,456
    Cool. Care to share the code?

  • JarrakulJarrakul Member Posts: 2,029
    I would love to share the code, but give me a bit to clean it up, write some running instructions, and add a new feature or two (it'll eventually have a "give me the odds of rolling at least this number" feature, which I suspect people will find useful). Also, it's Matlab code (because Matlab does linear algebra crazy fast), which means it might be difficult for a lot of folks to run. What with Matlab being proprietary and costing hundreds of dollars and all. School computers usually have it, though, so if you have a college computer lab nearby you could probably run it there.

    FinneousPJ
  • JarrakulJarrakul Member Posts: 2,029
    edited June 2016
    Well that took less time that I thought it would. Knock yourselves out. I should probably warn you, my programming training has been largely informal, and my commenting sometimes suffers as a result.

    If you just want to run the code, check the readme. It should have all the info you need.

    EDIT: Realized I was slightly wrong for dwarves and halflings. Edited to upload the fixed version. Note that dwarves and halflings can't actually roll 108, due to their negative total racial modifiers.

    Post edited by Jarrakul on
    FinneousPJ
  • FinneousPJFinneousPJ Member Posts: 6,456
    @Jarrakul Yes, I have the student version. Of folks are interested but lack Matlab, Octave may be able to run the code.

    kotekoJarrakul
  • ShYarivShYariv Member Posts: 119
    I tried to do a similar thing a few years ago using excel (my Matlab skills are rudimentary at best). My assumptions are described in this old post, but I never tested to see if they were accurate. I think its pretty close to what's described here, though we get different results - my probabilities seem lower...

    I've since made a version of the excel file that I never posted there (attached here), that allows you to choose a race and a class and calculates the probabilities automatically (though it doesn't disallow illegal race/class combinations). Check it out if you like.

  • JarrakulJarrakul Member Posts: 2,029
    Well that's cool to see. I must say, your excel-fu is far stronger than mine. I'm a bit disturbed that we get different results, though. I can't find an obvious error in either yours or mine, but our results are off by an order of magnitude or two for the 108 probabilities.

Sign In or Register to comment.