It's a Wand! It's a Crossbow Bolt! It's a Floor Wax!

radferth said:
This problem does not call for iterations. It is a discrete probability question with a discrete answer. Borlon is right for the probablity that it will take x number of rolls for a 1 to come up (for d20 5% for one roll, 5(100-5)% for two rolls, etc.). If one takes this all the way out, you end up with the median number of rolls needed to get a 1 and just a bit over half the number of sides on the die. This means that for the d20-d12-d10-d8 method, the average would be a bit over 25.

No. That's the mistake we were making earlier, you CAN'T simply add up the medians for each discrete die and call that the total median, because when you're adding the dice together, the distance FROM the median starts becoming important when determining the new distribution. The dice can't be considered separately. If they were nice, linear distributions (like a d6 roll) then sure, you could add them, but they're skewed distributions instead. If I go through four stages, I should expect my "median" case to be where two are below the average, and two are above the average. However, the ones above the average will be further from the mean than the ones below, so the median SUM will be higher than simply the sum of the medians.

I teach this sort of thing to college students, so I'm kicking myself that I didn't catch this mistake the first time.

---------------
I ran more numbers, and found the mistake that was causing babomb and I to differ. I had accidentally capped the rolls at around 30-40 per die, so it was ruling out the combinations that had one really long streak. I upped the limit to 100 per die, and it started working fine (since I'm only breaking down probabilities for combinations of less than 100 total rolls).

Also, this isn't an "iteration" logic. It works like this:

Define N1 as the number of rolls it takes for die number one to hit a 1. Define N2, N3, etc. the same way.
Loop N1 from 1 to 100, N2 from 1 to 100, etc. in a series of nested loops
For each combination (N1,N2,N3,etc.), figure out the probability of that combination occurring. This is just the product of the individual probabilities we discussed earlier.
Prob[T] = Prob[T] + p(N1)*p(N2)*p(N3)... where T = N1+N2+N3... is the total number of rolls.
end loops

(If you want to be more elegant, replace the brute-force loops with a convolution of vectors containing the elements for each die. But it's the same effect.)

The result of this, Prob[X], is a probability profile showing the chances of ending at exactly X rolls. Now, to find out the chance of running out within the first Y charges, just sum Prob[0:Y].

Going d20-d12-d10-d8, I get the following:
Mean: 50
Median: 44.74
The lowest possible result, 4, happens 0.00521% of the time (1 in 20,000)
10 or less happens 0.7% of the time. (That is, you'll have the four 1s within the first 10 rolls.)
20 or less happens 8.0% of the time.
30 or less happens 23.3% of the time.
40 or less happens 41.7% of the time.
50 or less happens 58.5% of the time.
60 or less happens 71.9% of the time.
70 or less happens 81.6% of the time.
80 or less happens 88.3% of the time.
90 or less happens 92.6% of the time.
And you have about a 4.5% chance of making it past 100 uses.

This gives pretty much what you wanted, I think. You could add the d6, bringing the median to just over 50 (and more importantly reducing the chance of really-low-use wands), but I wouldn't add the d4. (and don't ask me to calculate it, each additional die increases the processor time needed by a factor of 100.) I'm running the numbers with the d6 added now, but it's taking a while.

Edit: Got the d6 numbers. Took a little under three hours to run, so there's no way I'm spending two weeks working out the d4 numbers.
10 or less now only happens 0.14%.
20 happens 3.6%.
30 happens 14.5%
40 happens 31.0%
50 happens 48.5%
60 happens 63.8%
70 happens 75.7%
80 happens 84.1%
90 happens 89.9%
and you have just under a 6% chance to make it past 100.
Median was 50.894. Mean was 56.

So actually, the 5-die progression ending with the d6 seems best to me; the mean's slightly higher than before, the median is right on 50, and the chances of a really short-duration wand go way down without drastically increasing the top end. Adding the d4 would be a bit much, IMO, pushing the median to 54ish and the mean to 60, but you COULD do it.
 
Last edited:

log in or register to remove this ad

I love when math geeks unite. :D


thinking about it, I think some of the 'fun' comes from being on the last die, and knowing it could go at any minute... you may start trying to hoard it. Plus, there will be more tension from rolling a D4 than a D8. So I was thinking about going D20-12-8-6-4. Still gives a 50 average... but adds more tension at the end.

Any thoughts?
 

Borlon said:
There is a 0.05 chance of getting a 1 on your first roll. The chance of getting a 1 on your second roll is (0.95 * 0.05), a little bit less. The chance of getting a 1 on your third roll is (0.95 * 0.95 * 0.05) and so on. And so on. The chance that it will be your 225th roll that comes up 1 is very, very small, about 2 million to 1. Much less than 0.05.

And the expected rolls to get "1" is a series of:

1/20+(1/20)*(19/20)*2+(1/20)*(19/20)^2*3+(1/20)*(19/20)^3*4+... etc .. I've forgotten though how analytically solve that (if I knew it in the first place), but it converges to 20 indeed.
 

Coredump said:
So I was thinking about going D20-12-8-6-4. Still gives a 50 average... but adds more tension at the end.

Any thoughts?

Those dice are the five platonic solids. What could be more magical?
 

Numion said:
And the expected rolls to get "1" is a series of:

1/20+(1/20)*(19/20)*2+(1/20)*(19/20)^2*3+(1/20)*(19/20)^3*4+... etc .. I've forgotten though how analytically solve that (if I knew it in the first place), but it converges to 20 indeed.

The sum of 1 + X + X^2 + ... is equal to 1/(1-X). So in this case X = 0.95, and you can break it down to
1/20 *( (1 + X + X^2 + X^3) + X*(1 + X + X^2 + ...) + X^2*(1 + X + X^2...) )
= 1/20 * (1 + X + X^2 + X^3 + ...)^2 = 1/20 * (1 / (1-0.95)^2) = 1/20 * 20^2 = 20

---------
Coredump:
Oh great, now I have to figure out without the d10? Okay, I'll run the numbers overnight. The quick-n-dirty method I use says that a 20-12-8-6-4 has a median of around 45. I'll get the exact value and the distribution later.
 

Spatzimus: It's possible to do this task *much much* faster, if you calculate the raw probabilities instead of the full combinatorial possibilities.

Start by making a table of (1..n, say 1..100) your first die. The 1 entry is the chance you stop at one roll (1/d), the 2 entry is the chance to stop at two rolls (1/d)((d-1)/d), the 3 entry is the chance to stop at 3 rolls (1/3)((d-1)/d)^2, and so on. Each entry is (1/d) * ((d-1)/d)^(r-1), where d is the die size, and r is the number of rolls.

Once you've made a table for each die like this, you can combine two tables at a time. So take your d20 table and combine it with a d12 table to produce the probability of a given number of rolls using a d20 and a d12 together. This is only 10,000 combinations, if you look at chances for up to 100 rolls only. When you're done, sum the probabilities for each resulting number of rolls, and discard any possibilities over 100 rolls. Now repeat the process with the next die size down.

The results for d20-d12-d8-d6-d4 are: (whoops--put the 20-12-10-8 in the first time I did this, sorry. Edited to fix.)

Code:
   0.00% |   5
   0.01% |   6
   0.04% |   7
   0.09% |   8
   0.17% |   9
   0.30% |  10
   0.50% |  11
   0.76% |  12
   1.11% |  13
   1.55% |  14
   2.08% |  15
   2.72% |  16
   3.46% |  17
   4.31% |  18
   5.26% |  19
   6.33% |  20
   7.49% |  21
   8.76% |  22
  10.12% |  23
  11.57% |  24
  13.10% |  25
  14.70% |  26
  16.38% |  27
  18.11% |  28
  19.90% |  29
  21.74% |  30
  23.61% |  31
  25.51% |  32
  27.44% |  33
  29.39% |  34
  31.35% |  35
  33.31% |  36
  35.27% |  37
  37.23% |  38
  39.17% |  39
  41.10% |  40
  43.02% |  41
  44.91% |  42
  46.77% |  43
  48.60% |  44
  50.40% |  45
  52.17% |  46
  53.90% |  47
  55.59% |  48
  57.25% |  49
  58.86% |  50
  60.43% |  51
  61.96% |  52
  63.45% |  53
  64.90% |  54
  66.30% |  55
  67.66% |  56
  68.97% |  57
  70.25% |  58
  71.48% |  59
  72.67% |  60
  73.82% |  61
  74.93% |  62
  76.00% |  63
  77.03% |  64
  78.02% |  65
  78.97% |  66
  79.89% |  67
  80.78% |  68
  81.62% |  69
  82.44% |  70
  83.22% |  71
  83.97% |  72
  84.70% |  73
  85.39% |  74
  86.05% |  75
  86.68% |  76
  87.29% |  77
  87.88% |  78
  88.43% |  79
  88.97% |  80
  89.48% |  81
  89.97% |  82
  90.43% |  83
  90.88% |  84
  91.31% |  85
  91.72% |  86
  92.11% |  87
  92.48% |  88
  92.83% |  89
  93.17% |  90
  93.50% |  91
  93.81% |  92
  94.10% |  93
  94.38% |  94
  94.65% |  95
  94.91% |  96
  95.15% |  97
  95.38% |  98
  95.61% |  99
  95.82% | 100

(And, of course, the chance of > 100 charges is 4.18%.)

This only took a few seconds of computation time to produce using my technique. (I controlled the table generation by hand, so it took a couple of minutes to type the commands to produce all of the intermediate tables and the result.)
 
Last edited:

Anax said:
Spatzimus: It's possible to do this task *much much* faster, if you calculate the raw probabilities instead of the full combinatorial possibilities.

Oh, I know the way I'm doing it is horribly slow. The absolute fastest way is to loop a few million times, see what the result each time is, then drop it into a simple distribution and extract the probabilities. Especially since we don't care about the second or third decimal place for something like this.
But since some people upthread were complaining that our methods that showed the medians couldn't add were flawed because iterating is bad, I felt like solving it more rigorously. The way I'm doing it now is exact, running every single combination down and weighting by the total probability, so there's really no way to argue that it's wrong. Inefficient, sure, but not wrong. And while the way you're doing it is just as accurate, I figured sooner or later someone would argue that order of operations is important, so the vector/matrix multiplication route was out unless you wanted to manipulate 5d matrices before reducing.

Anyhoo, no one really cares about this math stuff. Bottom line, any of the distributions we've talked about would work. The 20-12-8-6-4 distribution seems like it'd work nicely as a substitute for the flat 50-charge wand. Mean's 50, median's just under 45, and the chance of getting a lousy wand (10 or fewer charges) is tiny. I'd say go with that.
 

Spatzimaus said:
Coredump:
Oh great, now I have to figure out without the d10? Okay, I'll run the numbers overnight. The quick-n-dirty method I use says that a 20-12-8-6-4 has a median of around 45. I'll get the exact value and the distribution later.
Heh, don't do it on my account. :D I realize the median would be about the same as before, and that is close enough for my uses. I only get that anal when posting on boards. :D :D


anax said:
Once you've made a table for each die like this, you can combine two tables at a time.
I wanted to do this, but could not figure out an easy way of combining the two tables. How did you do it? (I am a math geek, but not a programmer, so if you had to write a program, nevermind..)
 

Spatzimaus said:
Anyhoo, no one really cares about this math stuff.

Who are you kidding? over half this thread is about the math!

Me, I be a programmer.. I figure its easier to get the computer to to the hard work :)

Have we all agreed that D20-D12-D8-D6-D4 would produce near the desired results and provide an elevated roleplaying experience at the table?
I lost track of that in the discussion of probabilities and such :)
 

Primitive Screwhead said:
Who are you kidding? over half this thread is about the math!

Yeah, but we're geeks. We don't have a lot of choices when it comes to arguments; it's either argue math, or go back to ninja vs. pirate, superman vs. batman, and star trek vs star wars.

Have we all agreed that D20-D12-D8-D6-D4 would produce near the desired results and provide an elevated roleplaying experience at the table?
I lost track of that in the discussion of probabilities and such :)

Yes, in my opinion. You want something with at least 5 dice to reduce the chances of really bad wands. You want something with a median of slightly below 50. That progression fits all those criteria.

Oh, and because no one in this thread said this in regards to the topic: "It's a Dessert Topping!"
 

Remove ads

Top