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

5D6 drop the lowest two (math ?)

dcollins

Explorer
Re: Analytical solution

Okay, hopefully this can be considered a peer review. First, I'm not familiar with this "classification" strategy but as I follow it I note the following...

Nathan said:
We now subdivide this classification further by the number r of dice that are lower than l. We see that r can run from 0 to n - 1. In our examples:

It seems like r should run from 0 to k-1. If I'm mistaken, I'd like to see an example for our 5d6 case where r = n-1 = 5.

Nathan said:
...where the number of B's is l

I think you mean the value of the B's is l, not that it affects what follows.

Nathan said:
All the r dice below l don't count for the total so let us neglect them.

I'll assume that the number of dice that are l that also get dropped don't affect this multiplicity?

Nathan said:
By the Gaußian summation formula, we have...

This is the part that I'm not familiar with, so I'll have to take your word for it. I'm surprised that the various possibilities for C are all handled by this step.

Nathan said:
1/n^d * [the sum over l = 1...r of the sum over r = 0...k-1 of the sum over u = 1..n - r of (n over r) * ((n - r) over u) * (l - 1)^r * (l*(u - (k - r)) + (n - u - r) * ((d + 1) * d / 2 - (l + 1) * l / 2)].

I think your parentheses are a bit unbalanced... perhaps you need another curved closed parenthesis right at the end (to balance the one italicized above)?


I'd like to see your comments as to if you feel this (esp. the first quote) affects your final formula, and then I too would like to see some numerical confirmation that this actually works out. (Although, again, the really useful thing would be a mass probability function.)
 
Last edited:

log in or register to remove this ad

dcollins

Explorer
LazarusLong42 said:
I didn't also use the drop-lowest, but I'm going to have to take some time to look through Nathan's solution :)

Lazarus, so if I'm reading you correctly, your formula doesn't take into account the dropping of low dice, which experience shows is really the hard part of this endeavor.


LazarusLong42 said:
dcollins: What you describe would be nice, but using summations like these--though, yes, the mathematical equivalent of the brute-force approach--is exactly what you have to do. The difference being that a mathematical description of the brute force approach is a lot easier to program into a computer. :)

I can't agree with that. It seems a lot easier to describe:
- Make n nested loops from 1..d.
- (For dropping) Sort the n values at each step.
- Add up the high values and increment to an array of probability counts.
- After looping, print out (or whatever) that array.
 

Ferret

Explorer
I know this is hardly need or on topic but I worked out a while ago all the possible characters, stats race and single class. Hear are the mamoth numbers (1694 digits):

6.5076372374886954161012848881273e+1694
 

LazarusLong42

First Post
dcollins said:
Lazarus, so if I'm reading you correctly, your formula doesn't take into account the dropping of low dice, which experience shows is really the hard part of this endeavor.
Correct on both counts; it is extremely hard to do. I figured I'd put my formula out there for reference and as a starting point, as someone had already mentioned 3d6 + 1d8 drop lowest.

I can't agree with that. It seems a lot easier to describe:
- Make n nested loops from 1..d.
- (For dropping) Sort the n values at each step.
- Add up the high values and increment to an array of probability counts.
- After looping, print out (or whatever) that array.
I suppose it depends on your situation and what you're trying to do. If you're trying to find the average, then that might be slightly faster. If, however, you want to find the probability of rolling, say, 65 on 20d6, I'll guarantee you that one summation/nested loop (mathematical formula) is faster than 20 nested loops (your way).

For the dropping problem... the verdict is out, I'd say. I still haven't properly understood what Nathan's written above. :) But even if it takes three extra nested loops for dropping, four nested loops (3 + 1) to run 5d6 drop 2 is faster than your five nested loops (one per die).


Edit: I've just realized I'm mixing terminology. What you describe may be easier to write a program for. The difference, I suppose, would be that my program will finish today for calculating the probability of getting 65 on 20d6 (the loop will run through the same few operations 8 times).

Your suggestion will run through the same set of operations 3,656,158,440,062,976 (6^20) times. Assuming you only have one operation in your loop, and you are lucky enough to eke out a gigaflop from a Pentium machine, your program will finish running middle of next month.

So, yes, what you describe is easier to write, but it would be cumbersome to run. :)
 
Last edited:


Nathan

First Post
SpuneDagr said:
Nathan, I rewrote your formula (not in ascii). It makes more sense to me this way. Is it right?
Thank you!

One note: you should write the binomial coefficients (n over r) without the line between the n and the r, otherwise they look like fractions...
 

Nathan

First Post
Re: Re: Analytical solution

dcollins said:
Okay, hopefully this can be considered a peer review. First, I'm not familiar with this "classification" strategy but as I follow it I note the following...



It seems like r should run from 0 to k-1. If I'm mistaken, I'd like to see an example for our 5d6 case where r = n-1 = 5.
Yes, you're right. And this has already been right in the formula.


I think you mean the value of the B's is l, not that it affects what follows.
Again, my mistake: I wanted to say the number of B's is u. It's value is l, of course.


I'll assume that the number of dice that are l that also get dropped don't affect this multiplicity?
Yes!


This is the part that I'm not familiar with, so I'll have to take your word for it. I'm surprised that the various possibilities for C are all handled by this step.
Formula by Gauß:

1 + 2 + 3 + 4 + ... + N = N * (N + 1) / 2.

Proof for this? Look at: (1 + N) + (2 + (N - 1)) + ... + (N/2 + (N/2) + 1) if N is even. Similar case for N odd.


I think your parentheses are a bit unbalanced... perhaps you need another curved closed parenthesis right at the end (to balance the one italicized above)?

New formula:
1/n^d * [the sum over l = 1...r of the sum over r = 0...k-1 of the sum over u = 1..n - r of (n over r) * ((n - r) over u) * (l - 1)^r * (l*(u - (k - r)) + (n - u - r) * ((d + 1) * d / 2 - (l + 1) * l / 2))].

Hope, the parentheses are paired now!


I'd like to see your comments as to if you feel this (esp. the first quote) affects your final formula, and then I too would like to see some numerical confirmation that this actually works out. (Although, again, the really useful thing would be a mass probability function.)
Thank you very much for your comments!

Hope you are familiar with the classification strategy right now...
 

JayOmega

First Post
It's not a formula, but rec.games.frp.dnd had a post long ago that detailed all the possibilities for 3d6 drop 0 to 9d6 drop 6.

Nd6 probabilities

Faster than doing all those summations, unless you need a 3d6+2d8 result or some such.
 

dcollins

Explorer
LazarusLong42 said:
If, however, you want to find the probability of rolling, say, 65 on 20d6, I'll guarantee you that one summation/nested loop (mathematical formula) is faster than 20 nested loops (your way).

Of course, what I was responding to was your original comment was that it was "easier to program", not that it's "faster to execute". What you're saying now may in fact be true for sizable numbers of dice (like 20d6).

But again, what you specify above is an easy problem -- I believe there's a formula for that directly implied by standard probability theory. The hard part is "drop k dice", for which fundamental techniques exist that every programmer knows, whereas to date I've never seen a concise mathematical formula which solves the problem.
 
Last edited:

dcollins

Explorer
Re: Re: Re: Analytical solution

Nathan said:
New formula:
1/n^d * [the sum over l = 1...r of the sum over r = 0...k-1 of the sum over u = 1..n - r of (n over r) * ((n - r) over u) * (l - 1)^r * (l*(u - (k - r)) + (n - u - r) * ((d + 1) * d / 2 - (l + 1) * l / 2))].

Ah, one more thing, Nathan:
Should that first summation be "the sum over l = 1..d" ?
 

Voidrunner's Codex

Remove ads

Top