Help us improve
Share bugs, ideas, or general feedback.
From randsum
Analyzes dice probability distributions using exact math or Monte Carlo simulation. Handles drop/keep, advantage, rerolls, and exploding dice for game systems.
npx claudepluginhub randsum/randsum --plugin randsumHow this skill is triggered — by the user, by Claude, or both
Slash command
/randsum:dice-probabilityThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Activate this skill when a user asks about:
Roll dice and interpret results for tabletop RPGs using RANDSUM notation. Supports various modifiers and game systems like D&D 5E, Blades in the Dark, PbtA.
Analyzes campaign dice roll data for fairness, anomalies, and statistical deviation. Useful for game integrity validation and detecting impossible values or biased distributions.
Routes probabilistic thinking to the right skill: base-rate anchoring, confidence calibration, expected value, or scenario weighting. Activates on queries about probability, likelihood, and uncertainty.
Share bugs, ideas, or general feedback.
Activate this skill when a user asks about:
For rolls with manageable outcome spaces (up to ~6 dice, up to 20 sides, no complex modifiers), enumerate all outcomes exactly.
Uniform (1dN): Every face is equally likely. P(X) = 1/N. Expected value = (N+1)/2.
Sum of NdS: Total outcomes = S^N. Enumerate or use convolution. Approximately normal for large N. Expected value = N * (S+1) / 2. Variance = N * (S^2 - 1) / 12.
For rerolls, exploding dice, large pools, or combined modifiers, use Monte Carlo simulation. Run 100,000+ iterations for stable results:
import { roll } from '@randsum/roller'
const N = 100_000
const results = Array.from({ length: N }, () => roll('4d6L').total)
const avg = results.reduce((a, b) => a + b) / N
For reproducible simulations, use a seeded random function:
import { roll } from '@randsum/roller'
import { createSeededRandom } from '@randsum/test-utils'
const config = { randomFn: createSeededRandom(42) }
const results = Array.from({ length: 100_000 }, () =>
roll('4d6L', config).total
)
| Scenario | Method |
|---|---|
1dN, NdS sums | Exact math |
| Drop/keep (small pools) | Exact enumeration |
| Rerolls, exploding, caps | Monte Carlo simulation |
| Comparing two strategies | Both -- exact if possible, simulation otherwise |
1dN)Uniform distribution. E = (N+1)/2, Var = (N^2 - 1)/12.
| Die | Expected | Std Dev |
|---|---|---|
| 1d4 | 2.5 | 1.12 |
| 1d6 | 3.5 | 1.71 |
| 1d8 | 4.5 | 2.29 |
| 1d10 | 5.5 | 2.87 |
| 1d12 | 6.5 | 3.45 |
| 1d20 | 10.5 | 5.77 |
NdS)E = N * (S+1) / 2. Distribution approaches normal as N grows.
| Roll | Expected | Std Dev |
|---|---|---|
| 2d6 | 7.0 | 2.42 |
| 3d6 | 10.5 | 2.96 |
| 4d6 | 14.0 | 3.42 |
| 2d10 | 11.0 | 4.06 |
| 2d12 | 13.0 | 4.88 |
4d6L (D&D Ability Score)Drop lowest of 4d6. Skewed high. E = 12.24, Mode = 13, Median = 12.
2d20L / 2d20H)1d20: E = 10.5, P(any face) = 5%See references/PROBABILITY_TABLES.md for full distribution tables.
| Modifier | Effect on Mean | Effect on Variance |
|---|---|---|
Drop lowest (L) | Increases | Decreases |
Drop highest (H) | Decreases | Decreases |
Keep highest (K) | Increases | Decreases |
Keep lowest (kl) | Decreases | Decreases |
Reroll low (R{<N}) | Slight increase | Slight decrease |
Explode (!) | Increases (extends upper tail) | Increases |
Compound (!!) | Same mean shift as explode | Higher variance on individual dice |
Cap (C{>N}) | Decreases (truncates top) | Decreases |
Cap (C{<N}) | Increases (truncates bottom) | Decreases |
Modifier execution order matters. Cap applies before drop/keep (priority 10 vs 20/21), so 4d6C{>4}L caps first, then drops -- the dropped die is from the capped pool.
When users ask "which is better?", compare along three axes:
Present results as: "Strategy A averages X (std dev Y) vs Strategy B averaging X' (std dev Y'). Against DC 15, A succeeds Z% of the time vs B at Z'%."
Example -- advantage vs flat +2 on 1d20:
2d20L (advantage): E = 13.82. P(>=15) = 51.0%1d20+2: E = 12.5. P(>=15) = 40.0%| Pool | P(Critical) | P(Success) | P(Partial) | P(Failure) |
|---|---|---|---|---|
| 0 (2d6kl) | 0% | 2.8% | 25.0% | 72.2% |
| 1d6 | 0% | 16.7% | 33.3% | 50.0% |
| 2d6 | 2.8% | 25.0% | 44.4% | 27.8% |
| 3d6 | 7.4% | 29.6% | 44.4% | 18.5% |
| 4d6 | 13.2% | 31.6% | 39.9% | 15.3% |
Critical = two or more 6s. Success = highest is 6. Partial = highest is 4-5. Failure = highest is 1-3.
| Stat | P(10+) Strong | P(7-9) Weak | P(6-) Miss |
|---|---|---|---|
| -1 | 8.3% | 33.3% | 58.3% |
| +0 | 16.7% | 41.7% | 41.7% |
| +1 | 27.8% | 44.4% | 27.8% |
| +2 | 41.7% | 41.7% | 16.7% |
| +3 | 58.3% | 33.3% | 8.3% |
P(success) = target / 20. Critical success on 1 (5%). Critical failure on 20 (5%).