• The VOIDRUNNER'S CODEX is coming! Explore new worlds, fight oppressive empires, fend off fearsome aliens, and wield deadly psionics with this comprehensive boxed set expansion for 5E and A5E!

Probability in Char. Gen.

Rystil Arden

First Post
Asmor said:
Gah!

See, this is why it's good to have other people look at your code... I dunno if it's just me, but I always miss simple stuff like that and assume I have a flaw in the logic somewhere. LOL!

Even more annoying since I did that exact same loop correctly a bunch of other times... ugh.

Now my output is 30.463321972692526, which is much better, I think.
Heh, but your results send a great ultimatum: If as a DM you want to force players to play 25 PB, you should just drop Charisma from the game ;)
 

log in or register to remove this ad

Asmor

First Post
Rystil Arden said:
Heh, but your results send a great ultimatum: If as a DM you want to force players to play 25 PB, you should just drop Charisma from the game ;)

After this most recent Dork Tower, I'm not entirely sure that's such a bad idea...
 


RedShirtNo5

First Post
I revised my program to calculate the probabilities as 1/1296 etc. (instead of using truncated percentages), and to use double precision floats. My result changed from 31.121 to 31.104.

There does seem to be something else going on, since there is still a significant spread:
Charwoman Gene: 30.055
Asmor: 30.463
RedShirt: 31.104
CRGreathouse: 33.957

-RedShirt
 

Charwoman Gene

Adventurer
RedShirtNo5 said:
There does seem to be something else going on, since there is still a significant spread:
Charwoman Gene: 30.055
Asmor: 30.463
RedShirt: 31.104
CRGreathouse: 33.957

-RedShirt

Asmor and I are using roughly equivalent algorithms. His is better (less round off error), aside from array index errors.

Your algorithm looks like ours, except for using dcollins's truncated percentage probabilities, as single precision floats. You also use a float for your total point buy value. I recalculated them into double precision floats. Asmor did me better by using long int values as weights.

CRGreathouse is using an algorithm where instead of calculating the point buiy values of each character, he calculates the chance of each value occuring and derives an aggregate probability like that. I don't trust it, myself, but I could be convinced to support it if a good argument was advanced.

Three results are within 1 point of each other, with one clearly containing less round off error.

The outlier is a very different algorithm.
 

CRGreathouse

Community Supporter
Charwoman Gene said:
CRGreathouse is using an algorithm where instead of calculating the point buiy values of each character, he calculates the chance of each value occuring and derives an aggregate probability like that. I don't trust it, myself, but I could be convinced to support it if a good argument was advanced.

There are two reasons my algorithm is good: It uses integer math exclusively (well, until the summary at the end at least) so it doesn't have roundoff, and it outputs complete probability for each stat. If all of the programs had tracking like this it would make it easier to compare.

I really hate the fact that none of the answers are close, and frankly being off by 1 would be really bad roundoff error. I think all the programs so far are computing answers to different problems (and roundoff is just making it hard to tell that they're actually not the same at all).
 


Asmor

First Post
CRGreathouse said:
There are two reasons my algorithm is good: It uses integer math exclusively (well, until the summary at the end at least) so it doesn't have roundoff, and it outputs complete probability for each stat. If all of the programs had tracking like this it would make it easier to compare.

I really hate the fact that none of the answers are close, and frankly being off by 1 would be really bad roundoff error. I think all the programs so far are computing answers to different problems (and roundoff is just making it hard to tell that they're actually not the same at all).

What kind of tracking would you like? I'd be happy to modify my program in any way which would help to clear up where the differences lie.

I'm going to try running Char's program on my computer and laptop... It might be that the CPUs round differently when the decimals get too long, causing the slight variation.
 

Asmor

First Post
Charwoman Gene said:
His is better (less round off error), aside from array index errors.

Heh. Light-hearted ribbing or back-handed compliment? :p :) I got the same result as you running your program on my computer, but I did notice that even after commenting out the extraneous reporting to System.out, it was significantly slower than mine... ;)
 

Asmor

First Post
Here's some more verbose output... Hopefully this is what you were looking for?

30.463321972692526
Total iterations: 16777216
Characters tossed: 8986646
Characters kept: 7790570
Total of tossed and kept: 16777216
Number of times each stat came up in a "good" character:
3: 1260600
4: 1617540
5: 1617540
6: 2016300
7: 2016300
8: 2445300
9: 2445300
10: 2889180
11: 2889180
12: 3330180
13: 3330180
14: 3835404
15: 3835404
16: 4271124
17: 4271124
18: 4672764
 

Remove ads

Top