[RPG] Roll and Keep in Anydice

anydicel5rstatistics

I want to check out the probabilities of the Roll and Keep system (as known from L5R 1-4th Edition) in Anydice. We luckily have boundaries:

  • We roll Skill + Stat + Modifier initial dice.
    • 10 explodes; A roll of 10-10-1 is counted as a single die of 21!
  • We keep (the best/worst) Ring dice of the roll.
  • there are at best 10 dice rolled, any 2 dice more that could be rolled add 1 die kept.
  • you can't ever keep more dice than you rolled.

For a roll of 10k3, this would be this code, but it fails to compute:

output [highest 3 of 10d [explode d10]] named "10k3"

How best to model this in a way that allows testing 1k1 to 10k5?

Best Answer

Cut your losses accuracy

When working with many kinds of modeling there is a tradeoff between accuracy and speed. Anydice cuts us off on our speed, so we need to lose some accuracy. Anydice already truncates to exploding twice anyway and seeing as exploding twice on a d10 will only happen in 1 in a hundred throws the error should be fairly small.

For simplicity — rather than implementing a custom explode function — we can simply create the truncated exploded dice like this:1

D: {{1..9}:90, {11..20}:9}

Which I'd call close enough:

plot comparing exploded die with truncated

Anydice will then model up to 8k3, at least fairly close. It will slant slightly lower, and obviously loses out on the extreme highs (which are pretty much 0 anyway).

You can consider the effect for this for pools were anydice is willing to calculate with explodes, say for 5k3:

output [highest 3 of 5dD] named "Truncated 5k3"
output [highest 3 of 5d [explode d10]] named "Exploded 5k3"

plot comparing truncated and exploded for 5k3


Carcer points out you can do the same thing by changeing anydice's explode depth:

set "explode depth" to 1

but I'll stick to the custom die method partly to show it off and because it appears to be slightly faster, but onfortunatly not enough to be give an actual benefit to us here.

Related Topic