2
\$\begingroup\$

I am not learned enough to figure this out alone. Not yet at least.

I am trying to figure out how to use anydice.com to get probabilities of two different situations with dice.

The main question is to do with Skyrim The adventure game by Modiphius. It uses d6 with the sides being 1 1 1 2 2 3. Skill tests usually require you to roll at least 3 of those die and match specific outcomes, such as,

  • test pass if TWO 1's are rolled
  • test pass if ONE 1 and ONE 2 are rolled
  • test pass if TWO 2's and ONE 3 are rolled

I want to figure out how to get the probability of those mixed rolls using between 2 and 6 dice using anydice.com


The other less important question is how to use anydice.com to calculate the probability of rolling different types of Dice and getting at least a specific number when added together. For example, rolling a D 4 and D12 and D20 getting at least a 23 lets say

\$\endgroup\$
3
  • 1
    \$\begingroup\$ Hi Keith, welcome to RPG.SE. Take the tour when you get a chance, and visit our help center for more information. Generally we don't ask questions directly to a given user, just post your question as you have done and our community of experts will try to answer it. We have lots of experts on most topics so don't worry if a specific user does or doesn't see it. Thanks for participating, good luck and happy gaming! \$\endgroup\$
    – linksassin
    Commented Aug 22, 2023 at 3:11
  • \$\begingroup\$ You write "Skill tests usually require you to roll at least 3 of those die" and then you want to test 2 dice? \$\endgroup\$
    – Eddymage
    Commented Aug 23, 2023 at 9:05
  • \$\begingroup\$ Do you want to know the probability to pass a test or the probability to get a particular outcome? \$\endgroup\$
    – Eddymage
    Commented Aug 23, 2023 at 9:09

2 Answers 2

2
\$\begingroup\$

Thanks everyone for the answers and input. For redundancy to get an answer I did ask the creator of Anydice.com. He in fact wrote back and gave this answer. Its just amazing.

function: count occurrences in R:s {
 result: (R = 3) * 100 + (R = 2) * 10 + (R = 1)
}

loop N over {2..6} {
 output [count occurrences in Nd{1,1,1,2,2,3}] named "[N] dice"
}
\$\endgroup\$
1
  • 2
    \$\begingroup\$ It might be useful to document what this code does: given a pool of N < 10 dice with sides numbered from 1 to 3, it outputs the probabilities of rolling each possible outcome, with each outcome encoded as a three digit number ABC where the first digit A is the number of threes rolled, the middle digit B is the number of twos rolled and the last digit C is the number of ones rolled. \$\endgroup\$ Commented Aug 23, 2023 at 10:24
1
\$\begingroup\$

You can expand a pool into a sequence using a function, then use the built-in count function:

function: skyrim ROLL:s target ONES:n TWOS:n THREES:n {
  result: [count 1 in ROLL] >= ONES & 
          [count 2 in ROLL] >= TWOS & 
          [count 3 in ROLL] >= THREES
}

DIE: d{1, 1, 1, 2, 2, 3}

output [skyrim 3dDIE target 2 0 1]

This is three dice trying to achieve a target of 2 ones, 0 twos, and 1 three. Alternatively, you can define the target using a sequence as well:

function: skyrim ROLL:s vs TARGET:s {
  result: [count 1 in ROLL] >= [count 1 in TARGET] & 
          [count 2 in ROLL] >= [count 2 in TARGET] & 
          [count 3 in ROLL] >= [count 3 in TARGET]
}

DIE: d{1, 1, 1, 2, 2, 3}

output [skyrim 3dDIE vs {1, 1, 3}]

In my own Icepool Python package you can use the superset operator on pools:

from icepool import Die

die = Die([1, 1, 1, 2, 2, 3])
output(die.pool(3) >= [1, 1, 3])

how to use anydice.com to calculate the probability of rolling different types of Dice and getting at least a specific number when added together

There's an "At Least" button in AnyDice which will show the chances of getting at least each possible number on each roll you output. For example, enter the following program and then click the "At Least" button (or just click this link):

output d4 + d12 + d20
\$\endgroup\$
3
  • \$\begingroup\$ I really appreciate your reply. I fooled around with your links but honestly it’s above my knowledge how to translate that into ,for example, what is the prob of rolling two ones and a 3 on a single roll of 3 die. \$\endgroup\$ Commented Aug 22, 2023 at 6:57
  • \$\begingroup\$ I've edited the code to match your example. Let me know if this is any clearer. \$\endgroup\$ Commented Aug 22, 2023 at 7:06
  • \$\begingroup\$ @KeithPlunske: For the sake of completeness, you can also do e.g. output d4 + d12 + d20 >= 23 and get a direct answer to "how likely am I to roll at least 23 on d4 + d12 + d20?" (Remember that false = 0 and true = 1 in AnyDice.) But using the "At Least" mode is usually more convenient. In any case, while working with mixed dice pools in AnyDice can sometimes be awkward, one thing AnyDice handles very easily is adding different dice rolls together and then doing something with the sum. \$\endgroup\$ Commented Aug 22, 2023 at 10:54

You must log in to answer this question.

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