• 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
Nathan said:
The denominator has to be d^n, not n^d, of course...

Right, I came up with that last night, thanks for noting that.

My program to verify this currently gives at least sane results for the case of 2Dd drop 1. However, other cases still don't appear correct, currently shows averages of:

2d1 drop 1 --> 1.000000
2d6 drop 1 --> 4.472222
3d6 drop 1 --> 3.402778
4d6 drop 1 --> 1.787809
5d6 drop 2 --> 3.379372
3d1 drop 1 --> 5.000000

I don't know if you have further comment on this, or I may have to start scratching out a 3dD drop 1 case by hand. Current .c program attached below.
 

Attachments

  • diceprob.txt
    2.7 KB · Views: 110

log in or register to remove this ad

dcollins

Explorer
Right, so with the current revised formula now consider a trivial case where we're rolling 3d1 and dropping 1 die. Clearly every roll is 2, so the average has to be 2.

n=3, d=1, k=1.
AVG = 1 * sum (l=1) sum (r=0) sum (u=1, 2, 3) [stuff]

Some preliminary values in every sum:
nCr = 3C0 = 1
(n-r)Cu = 3Cu (so that's 3, then 3, then 1)
(l-1)^r = 0^0 = 1
((d+1)*d/2 - (l+1)*l/2) = 2*1/2 - 2*1/2 = 1-1 = 0
By the last, the large last term disappears in every sum.

Thus:
AVG = 1*3*1*(0) + 1*3*1*1*(1) + 1*1*1*(2) = 0+3+2 = 5.

Which is not the "2" which we would expect.
Comments at this point?
 

LazarusLong42

First Post
Partial Success

All right... here we go.

The following expression is equal to the number of possible rolls available for a given result R, when rolling n dice with d sides each, and keep the highest k dice. To get the probability for that result, divide the value of this expression by the value of d^n

However, this is only a partial success, as the expression works only in the special case where n - k = 1 -- that is, in the case where you drop only the lowest die. But I'm using this as a jumping-off point for figuring probabilities where 1<k<n.

drop_lowest.png


dcollins... would you care to test? I've tested for several values myself, but I suspect you'll find any errors of mine quicker with your C programs, and I have no knowledge of C.
 

dcollins

Explorer
Interesting, let me ask a few questions first.

Well, first a comment... be careful, because:
Nathan defined k = number dropped.
Lazarus defined k = number kept.

Questions:
- Do the L-shaped brackets signify anything special, or are they just parentheses?
- Is it odd that the ranges i and j may have fractional upper bounds (division by k or d-j), same for that far right-hand term j/d?

Oh... I guess maybe the L-brackets are a "floor" operation (greatest lower integer)?
 

Nathan

First Post
dcollins said:
Interesting, let me ask a few questions first.

Well, first a comment... be careful, because:
Nathan defined k = number dropped.
Lazarus defined k = number kept.

Questions:
- Do the L-shaped brackets signify anything special, or are they just parentheses?
- Is it odd that the ranges i and j may have fractional upper bounds (division by k or d-j), same for that far right-hand term j/d?

Oh... I guess maybe the L-brackets are a "floor" operation (greatest lower integer)?
Yes.
 

LazarusLong42

First Post
dcollins said:
Well, first a comment... be careful, because:
Nathan defined k = number dropped.
Lazarus defined k = number kept.
I hadn't noticed that. The reason I defined k as number kept was that, as I was setting this up, I realized that the number kept was going to show up a lot more often, and would shorten the formula.
Questions:
- Do the L-shaped brackets signify anything special, or are they just parentheses?
- Is it odd that the ranges i and j may have fractional upper bounds (division by k or d-j), same for that far right-hand term j/d?

Oh... I guess maybe the L-brackets are a "floor" operation (greatest lower integer)?
Indeed, that's exactly what they mean--and you've answered both questions with that :)

When I have a chance (tomorrow, perhaps) I'll try to explain a bit about the deduction of the formula. Note I say 'deduction' rather than 'derivation,' because rather than using Nathan's first-principles approach, I tend to approach this sort of thing from the other side, looking at the numbers in front of me.
 

Nathan

First Post
dcollins said:
Right, so with the current revised formula now consider a trivial case where we're rolling 3d1 and dropping 1 die. Clearly every roll is 2, so the average has to be 2.

n=3, d=1, k=1.
AVG = 1 * sum (l=1) sum (r=0) sum (u=1, 2, 3) [stuff]

Some preliminary values in every sum:
nCr = 3C0 = 1
(n-r)Cu = 3Cu (so that's 3, then 3, then 1)
(l-1)^r = 0^0 = 1
((d+1)*d/2 - (l+1)*l/2) = 2*1/2 - 2*1/2 = 1-1 = 0
By the last, the large last term disappears in every sum.

Thus:
AVG = 1*3*1*(0) + 1*3*1*1*(1) + 1*1*1*(2) = 0+3+2 = 5.

Which is not the "2" which we would expect.
Comments at this point?

The problem is the following: u = 1 and u = 2 don't correspond to any valid roll.

There is also another problem with the [stuff] that makes it basically counting the wrong things.

I changed the formula and tested the new one with dcollins' C-program.

The new formula is:

sum over l = 1 to d of sum over r = 0 to k of sum over u = 1 to n-k of (n over r) ((n - r) over (u + k - r)) * (l - 1)^r * [(d - l)^(n - k - u) * l * u + X * ((d+1)*d/2-(l+1)*l/2)]

Here, X is defined by

X := (n - k - u) * (d - l)^(n - k - u - 1). If d - l = 0 and n - k - u = 0, set X := 0.

Some remarks:

In this formula, l is the lowest dice that won't be dropped and u is the number of dice showing l that won't be dropped. This has changed! The new formula should work with the case k = 0 as well.

I will attach the modified test program by dcollins.

Extensive testing is appreciated!
 

Attachments

  • diceprob.txt
    3 KB · Views: 134



KeithHays

First Post
Sabathius42 said:
I haven't had time to read the very long and though out analytical answer (and I will as soon as I get a few moments of peace without having to run around after work) but I just wanted to say YOU GUYS/GALS ROCK!

We have been trying to figure this out at work for a couple weeks now, and got nothin.

DS

Nothin? I gave you MeanGenes' solution a month ago! It may not be technically correct, but you can USE it! :D
 

Voidrunner's Codex

Remove ads

Top