3
\$\begingroup\$

We all know how to roll dice in WoD in anydice, but I stand in front of a different yet related problem:

There are some gifts (for example eye pluck for Corax) [and other powers] that demand a certain number of successes against a difficulty. In the named example, 4 successes against the difficulty 9 are needed.

This sounded ludicrous, till I ran the numbers and found out that (by manually summing the results) 6 dice would result in a 1.34% chance to do this, 7.17 with willpower, 11.29% with a specialization only and 22.27% with both. But... that is tedious.

How to model rolling Xd10 against difficulty Y with a demand of Z successes, only displaying the percentage of "minimum and more successes" "below threshold" and "botch"? If computation time limits wouldn't bitch out about it, it would be nice to run a loop of Z to 10 dice in addition.

\$\endgroup\$
0

1 Answer 1

2
\$\begingroup\$

How you'd like it

If you really want to do the summing directly in code, probably the easiest way would be to use a helper function like this:

function: COUNT:n minimum MIN:n {
  if COUNT < 0 { result: -1 }
  if COUNT < MIN { result: 0 }
  result: 1
}

This just takes a number COUNT (which could be the result of any dice roll) and compares it to a target number MIN, returning -1 if the count is negative, 0 if it's non-negative but less than the target, and 1 if it's equal to or greater than the target. Plotting e.g. [[roll X d NORMAL] minimum 4] will then directly give you the probabilities you asked for.

Of course, it's also easy enough to loop this over a range of dice pool sizes, if that's what you want.

The other way

There's no need to write any extra code for this, since the AnyDice user interface already provides the "At Least" and "At Most" modes that automatically sum the output probabilities.

For example, running the code by Jasper Flick from this answer (which, by default, uses DIFFICULTY: 7 and X: 4 dice) and clicking the "At Least" button gives the following output:

Screenshot

Looking at the bar labeled "4" in each graph, we can see that the probability of rolling at least 4 successes (with 4 dice against difficulty 7, in this case) is normally 2.56%, and rises to 11.86% with specialization, 15.36% with willpower and 27.94% with both.

Similarly, looking at the bar labeled "0" in the same output gives the probability of not botching (since the code treats a botched roll as -1 successes), which is 93.29% without willpower (and 100% with it). To get the probability of botching the roll, you can either subtract that from 100% (and, hopefully, get 6.71%), or just switch to "At Most" mode and look at the "-1" bar instead.

\$\endgroup\$
2
  • \$\begingroup\$ I did switch the two around, because I did want just the solution you crammed in at the end - the other solution is not helping in the process to analyse and probably fix the problem of those ludicious gifts. It only matters if it is a botch, success or fail. All the other numbers? not helpful. \$\endgroup\$
    – Trish
    Commented Sep 12, 2018 at 15:59
  • \$\begingroup\$ I realise where my error came from: I did up the difficulty to 9 in one test run, and only 7 in the other. \$\endgroup\$
    – Trish
    Commented Sep 12, 2018 at 16:10

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .