Probability Sticky

phatonin

Chaos is a bladder
Validated User
Yes you are right! Which makes me realize that my modified script above only works if B=1. It does not compare the 2nd highest black dice etc...
Normally you will have at least one more white than black dice. I’m thinking that pushing your luck to the extreme may require a roll with more black than white which could result in all white dice being removed = catastrophic failure.
Thanks again! The fact that I was at all able to modify your script shows that your program is easy and intuitive .
Thanks again!
This is really not trivial, paste this in the editor (including the triple dashes) and voilà:

Code:
bnw = fun(whites, blacks, N) {
  if not whites[N]
  then 0
  else (
    if whites[N] > blacks[N]
    then whites[N]
    else bnw(whites, blacks, N + 1)
  )
}

---

sample (
  W = 2;
  B = 1;
  whites = reverse (sort Wd10);
  blacks = reverse (sort Bd10);
  bnw(whites, blacks, 0)
) as "bnw"
 

Tesral

Dean of Old School
Validated User
I just joined this. Has anyone mention reverse die test? Having a fixed target number of target or lower, and controlling difficulty by adding more dice?

Per example, a stat range of 3d6. The target number being the rolled stat. Easy being 2 or 3d6, harder 4 to 5d6 and very hard 7d6.

I used this to good success before D&D went all d20 mechanic.
 

SibKhatru

Registered User
Validated User
A question for anydice experts.

Thinking of things I might do with a Fate/Fudge die pool. It has a small twist. Each die is { blank | blank | + | + | - | - } and my thought is to use a die roll with results of 0 (33%) 1 (33%) and 2 (33%). It's a d3-1 thing, yes, but the system is counting the bones with sticks present, where the + result shows two sticks. (This would in a nifty way fit with my notion of a "casting sticks" sort of mechanical name for what's tested).

So, what I am wondering, in light of my chaotic life and hefty amount of drugs (presently on bedrest with bronchial infection) I was wondering if anyone knows the coding for a dice pool for Xd3-1? I am sure it's easy... just foggy at the moment.

Help much appreciated.
 

Naeddyr

two
Validated User
https://anydice.com/program/11e89

The simplest anydice script is just

Code:
output 3d6 named "3d6"
The output lines are mandatory for, well, output. You can have several, and each separate output creates a new line on the graph that comes out. The "named" is just to clarity on the graph.

If you want just to output a specific kind of roll, write it normally, like 3d6 above.

You can specify the die more by using a { ... } list of values instead of a simple number. {0, 1, 2} is a d3 with the sides 0, 1 and 2. These can be arbitrary.

You can also have function outputs and more complicated dice outputs as the "die". For example, if you write 6d(1d10 >= 8), first the script evaluates the (1d10 >= 8). It outputs a graph with two columns: a 0 column and a 1 column, with their own probabilities (80% and 20%), and than it takes that output and turns it into a die that can be rolled itself, because as far as the program is concerned, any set of probabilities for specific values to be rolled is just a funky kind of die. 6d(1d10 >= 8) is just a six dice dicepool where a die succeeds when it rolls 8 or higher.

Other ways to do this:

6d{0,0,0,0,0,0,0,0,1,1}
6d{0:8, 1:2}
6d{0:4,1:2}

etc.
 

Kath

The Furthest Away
RPGnet Member
Validated User
Is it possible to use programmes like AnyDice for dice with symbols rather than numbers? For example, the new edition of Legend of the Five Rings uses two types of custom dice, with four different symbols in varying combinations on them. To further complicate probabilities, it's a roll and keep system - you roll X+Y dice and keep X of that pool.
 

Naeddyr

two
Validated User
Is it possible to use programmes like AnyDice for dice with symbols rather than numbers? For example, the new edition of Legend of the Five Rings uses two types of custom dice, with four different symbols in varying combinations on them. To further complicate probabilities, it's a roll and keep system - you roll X+Y dice and keep X of that pool.
You can usually model those with numbers, depending what you *want* out of it.

For example, if you want the distributions of various kinds of results you can use this trick:

Assign one symbol as the 1's, another as the 10's, a third as the 100's etc.

Then make a function that rolls the dice, using a die with appropriate distributions for those numbers. The results you get are stuff like 10101 and 1011, each with its own individual probability that tells you something.

Googling L5R dice, seems like the same fave can have many symbols. This isn't a problem, just use a composite number like "110".
 

Alban

Registered User
Validated User
Is it possible to use programmes like AnyDice for dice with symbols rather than numbers? For example, the new edition of Legend of the Five Rings uses two types of custom dice, with four different symbols in varying combinations on them. To further complicate probabilities, it's a roll and keep system - you roll X+Y dice and keep X of that pool.
Note that only 4 combinations exist on L5R dice.
D6s only have Strife+Activation, Strife+Success and Strife+Reroll. Other sides are either blank or only have 1 symbol.
D12s have the same, plus Activation+Success.
-----
There are ways to do it, I think, but it would require you to make unusual use of numbers.
For instance, a d6 would be labelled d{0,10,11,100,101,1000}
Sides noted 1X would be those with 1 activation symbol, and X indicating a strife or not.
101 would mean 1 success and a strife, 100 1 success.
1001 would be 1 reroll and a strife.

So, when rolling 4 of those dice, 123 would mean 1 success, 2 activation and 3 strife.

That's the basic. Re-rolling, and discarding dice with strife would not be easy...

Edit: scooped by Naeddyr...
 
Last edited:

Knaight

Registered User
Validated User
Halp meh, friends!

Let's say, an attack roll is 1d6. And, I'm running a battle where 60 soldiers attack in one turn. Let's also say I don't want to roll 60d6. I know that, on average, roughly 10 will roll a 1, 10 will roll 2, and so on.

Let's say I still want to have a little randomness, so that the soldiers may acquit themselves well or poorly. What I want is to roll 1d6, and consult a table that tells me how many guys roll a 1, how many roll a 2, and so on.

Is there a way that I can have six reasonably probable results? Like, roughly 1 in 6 rolls of 60d6 will have m results of 1, n results of 2, and so on? Ranging from 1-in-6 odds they'll roll this badly, to 1-in-6 odds they'll roll this well?

Does this make any sense? I hope so!
You can do this pretty easily to decent approximation. The easiest way to do this is to treat the Nd6 curve like it's a perfect bell curve (it isn't, but at 60d6 it's pretty close). The d6 can then be treated as if it determines where on the curve it is, using (1/7, 2/7, 3/7, 4/7, 5/7, 6/7), tied to the normal distribution. A quick lookup gets [-1.067, -0.566, -0.18, 0.18, 0.566, and 1.067] as the corresponding standard deviations out. Anydice gives you standard deviation, so at this point you just need to make a table in Excel for varying numbers of dice, and then call it a day - this assumes you just need totals.

If you need the numbers for each result you can get something similar using the calculated standard deviation of the binomial distribution, where you can use Anydice again with the custom die (1,0,0,0,0,0), then feed that into Excel to get your d6 mapping. It's a bit messier though, where just using the binomial distribution for how many soldiers hit when they all roll 1d6 where you calculate the hit probability first is much cleaner. The normal distribution is again a reasonable approximation.

Is it possible to use programmes like AnyDice for dice with symbols rather than numbers? For example, the new edition of Legend of the Five Rings uses two types of custom dice, with four different symbols in varying combinations on them. To further complicate probabilities, it's a roll and keep system - you roll X+Y dice and keep X of that pool.
I'm not aware of a way to do this properly - but you can use custom dice with the right numbers on them to do symbolic work. I assume L5R doesn't exceed dice pools of 9 dice (it doing so makes this harder, but still doable), so consider the custom die d[1,10,100,1000]. If you roll up to 9 of them the number that gets put shows a distribution of 4 symbols across 9 dice. The varying combinations can be handled by altering the custom die, where something like d[1,10,10,100,1000,1000] weights whatever symbol you're using for the 10 and 1000 twice as high. You don't need to use a base-10 system for this, which lets you get more than 10 dice in, but it starts getting into a much bigger pain (though I suppose you could just use a base 100, and get 2 digit results for each).

A question for anydice experts.

Thinking of things I might do with a Fate/Fudge die pool. It has a small twist. Each die is { blank | blank | + | + | - | - } and my thought is to use a die roll with results of 0 (33%) 1 (33%) and 2 (33%). It's a d3-1 thing, yes, but the system is counting the bones with sticks present, where the + result shows two sticks. (This would in a nifty way fit with my notion of a "casting sticks" sort of mechanical name for what's tested).

So, what I am wondering, in light of my chaotic life and hefty amount of drugs (presently on bedrest with bronchial infection) I was wondering if anyone knows the coding for a dice pool for Xd3-1? I am sure it's easy... just foggy at the moment.

Help much appreciated.
I'm assuming you want only some of them, given the use of the term dice pool. So:
Code:
output [highest M of Nd{0,1,2}]
 
Top Bottom