Como posso calcular a soma dos dados aleatórios 2 de um pool 3d6 no AnyDice?

6

With AnyDice it's pretty easy to calculate probalities for highest and lowest 2 of a 3d6 pool, namely with:

output [highest 2 of 3d6]
output [lowest 2 of 3d6]

However, this has a bias towards the highest and lowest thrown dice. What I want to calculate is the possible results, without bias. Reasoning behind this is that I want my players to control the outcome. It's not necessarily that the highest or lowest outcome are worse or better, it's simply that I want to offer them a decision. They choose two of the dice, add them together and there is a result. I want to give the luck d20 roll with result such as an encounter more meaning and mental impact ("why did you pick those dice!").

I had hoped AnyDice to have a random function, something like [random 2 of 3d6] but that doesn't exist. My hypothesis was that I could simply add the percentages of [2 mais alto de 3d6] e [lowest 2 of 3d6] and divide that number by 2 (since I'm adding two probability calculations with a total of 100%).

But somehow this doesn't feel right. It doesn't include the possibility of a player picking the highest and the lowest number instead of the two highest or lowest.

I've been doing some tutorials in AnyDice and I reckon this definitely CAN be done with a function where the following would happen:

  • Roll 3d6. Then also roll a d3 twice (not 2d3 as it would add up).
  • If the d3 rolls are equal, reroll one until you get two unique d3 rolls.
  • Then use the unique d3 rolls and take those dice from the 3d6 pool.
  • Add those dice together, show results.

An approach of this chance could be that I take simply the average of a single die in the 3d6 pool and then multiply by 2, theoretically approaching all the possible results. This is incorrect as well as it includes all three dice and thus the average can go higher than the max of 2d6.

Perhaps I'm overthinking this calculation by using AnyDice. As the the dice order isn't relevant at all, I simply need to know all possible dice combinations a 3d6 pool can have. Not the sum, but the combinations. This is super simple, because every dice has 6 sides. So 3d6 has 6 * 6 * 6 = 216 total combinations, this includes repetition as I am interested in the probability of each throw. However, I again don't need all three dice. Only 2, which for the sake of calculation can be presumed to be picked randomly.

Another option I can think of in AnyDice is:

  • Roll 3d6 and 1d3.
  • Remove from 3d6 sequence the number in position 1d3.
  • Add the remaining sequence's result and output probabilities.

Okay, long wall of text, but I am just not familiar enough with AnyDice to figure this out. Any help is greatly appreciated.

por Topple 10.07.2019 / 12:08

3 respostas

The sum of 2 random dice from 3d6 is the same as just rolling 2d6

If you are rolling 3d6 and then picking 2 dice at random, the results are statistically the same as just adding 2d6. I am having trouble finding a way to explain this at all as it is just intuitive to me. The fact that you add a third die, then just discard a random one still means that you are just taking two results from 2d6 dice and adding them together. The extra step of adding a d6 to the pool then discarding one d6 does nothing (for any number of added and discarded from the pool, actually).

Naturally you can't just trust my intuition so consider this anydice program:

function: X:n choice {
  if X = 1 {
   result: {2,3}@3d6
  }

  if X = 2 {
   result: {1,3}@3d6
  }

  if X = 3 {
   result: {1,2}@3d6
  }
}

output [d3 choice] named "random 2 of 3d6"
output 2d6 named "2d6"

Which gives this result:

graphic result

What that choice function (called with a d3) is doing is picking randomly between 3 cases: choosing the 2 highest dice from the 3d6, choosing the 2 lowest, or choosing the highest and lowest. As you can see, the results end up being the same as just rolling 2d6.

10.07.2019 / 13:07

Two random dice from 3d6 is the same as 2d6

No matter how many dice you roll, each die roll is stochastically independent. This means none of the individual dice alters the probability distribution of the outcome of any other die in any way, and it follows that rolling dice that are simply ignored in the final result can simply be not rolled at all. Intuitively, you could give the player the choice antes rolling and the result wouldn't be changed at all.

For a simpler example case, consider that you want the distribution of a random 1d6 from 2d6 (so one die less rolled, and one die less in result). Let's call the dice \$R\$ e \$G\$ for red and green respectively, and assume they're identical otherwise. This is what the usual distribution of the 2d6 would look like:

\$ \begin{array}{|c|c|c|c|c|c|c|} \hline & \textbf{G=1} & \textbf{G=2} & \textbf{G=3} & \textbf{G=4} & \textbf{G=5} & \textbf{G=6} \\ \hline \textbf{R=1} & {2} & {3} & {4} & {5} & {6} & {7}\\ \hline \textbf{R=2} & {3} & {4} & {5} & {6} & {7} & {8}\\ \hline \textbf{R=3} & {4} & {5} & {6} & {7} & {8} & {9}\\ \hline \textbf{R=4} & {5} & {6} & {7} & {8} & {9} & {10}\\ \hline \textbf{R=5} & {6} & {7} & {8} & {9} & {10} & {11}\\ \hline \textbf{R=6} & {7} & {8} & {9} & {10} & {11} & {12}\\ \hline \end{array} \$

Each cell has an equal probability: 1/36. If we ignore one of the dice, say \$G\$, it'll look like this:

\$ \begin{array}{|c|c|c|c|c|c|c|} \hline & \textbf{G=1} & \textbf{G=2} & \textbf{G=3} & \textbf{G=4} & \textbf{G=5} & \textbf{G=6} \\ \hline \textbf{R=1} & {1} & {1} & {1} & {1} & {1} & {1}\\ \hline \textbf{R=2} & {2} & {2} & {2} & {2} & {2} & {2}\\ \hline \textbf{R=3} & {3} & {3} & {3} & {3} & {3} & {3}\\ \hline \textbf{R=4} & {4} & {4} & {4} & {4} & {4} & {4}\\ \hline \textbf{R=5} & {5} & {5} & {5} & {5} & {5} & {5}\\ \hline \textbf{R=6} & {6} & {6} & {6} & {6} & {6} & {6}\\ \hline \end{array} \$

Each cell still has a 1/36 probability, but there are now only six distinct outcomes, each with a total probability of 1/6. The \$G\$ die doesn't matter anymore and we might as well have not rolled it at all. The reverse case where we omit \$R\$ from the result is identical; swap the labels of the second array if you don't believe me! You can construct a similar, three dimensional grid to assure yourself that this remains true in the "3d6, pick two at random" case.

10.07.2019 / 13:15

I don't know much about AnyDice, but here's how I would

Calculate this in Python

from collections import defaultdict as dd

result = dd(int)
for x in range(1,7):
    for y in range(1,7):
        for z in range(1,7):
            a,b,c = sorted((x,y,z))
            result[a+b, a+c, b+c] += 1

accum = dd(int)
for key,value in result.items():
    for a in set(key):
        accum[a]+=value


for k in sorted(accum.keys()):
    print(k, accum[k], accum[k]/216)


for k in sorted(result.keys()):
    print(k, result[k], result[k]/216)

Which (with some formatting) gives the below tables. The first lists the number of times each value is an option (that is, rolling three 1s gives you the option to choose 2 once, not three times). The probability column doesn't sum to 1 because of the inherent overlap caused by the choice you give the players.

The second, much longer, table lists the choice of three options first, then how many times it shows up, then its ultimate probability.

\$ \begin{array}{|c|c|c|} \hline \textbf{Value} & \textbf{Is an option N times} & \textbf{Probability} \\ \hline 2 & 16 & 0.07407407407407407 \\ \hline 3 & 30 & 0.1388888888888889 \\ \hline 4 & 46 & 0.21296296296296297 \\ \hline 5 & 60 & 0.2777777777777778 \\ \hline 6 & 76 & 0.35185185185185186 \\ \hline 7 & 90 & 0.4166666666666667 \\ \hline 8 & 76 & 0.35185185185185186 \\ \hline 9 & 60 & 0.2777777777777778 \\ \hline 10 & 46 & 0.21296296296296297 \\ \hline 11 & 30 & 0.1388888888888889 \\ \hline 12 & 16 & 0.07407407407407407 \\ \hline \end{array} \$

\$ \begin{array}{|c|c|c|} \hline \textbf{Options} & \textbf{Count} & \textbf{Probability} \\ \hline (2, 2, 2) & 1 & 0.004629629629629629 \\ \hline (2, 3, 3) & 3 & 0.013888888888888888 \\ \hline (2, 4, 4) & 3 & 0.013888888888888888 \\ \hline (2, 5, 5) & 3 & 0.013888888888888888 \\ \hline (2, 6, 6) & 3 & 0.013888888888888888 \\ \hline (2, 7, 7) & 3 & 0.013888888888888888 \\ \hline (3, 3, 4) & 3 & 0.013888888888888888 \\ \hline (3, 4, 5) & 6 & 0.027777777777777776 \\ \hline (3, 5, 6) & 6 & 0.027777777777777776 \\ \hline (3, 6, 7) & 6 & 0.027777777777777776 \\ \hline (3, 7, 8) & 6 & 0.027777777777777776 \\ \hline (4, 4, 4) & 1 & 0.004629629629629629 \\ \hline (4, 4, 6) & 3 & 0.013888888888888888 \\ \hline (4, 5, 5) & 3 & 0.013888888888888888 \\ \hline (4, 5, 7) & 6 & 0.027777777777777776 \\ \hline (4, 6, 6) & 3 & 0.013888888888888888 \\ \hline (4, 6, 8) & 6 & 0.027777777777777776 \\ \hline (4, 7, 7) & 3 & 0.013888888888888888 \\ \hline (4, 7, 9) & 6 & 0.027777777777777776 \\ \hline (4, 8, 8) & 3 & 0.013888888888888888 \\ \hline (5, 5, 6) & 3 & 0.013888888888888888 \\ \hline (5, 5, 8) & 3 & 0.013888888888888888 \\ \hline (5, 6, 7) & 6 & 0.027777777777777776 \\ \hline (5, 6, 9) & 6 & 0.027777777777777776 \\ \hline (5, 7, 8) & 6 & 0.027777777777777776 \\ \hline (5, 7, 10) & 6 & 0.027777777777777776 \\ \hline (5, 8, 9) & 6 & 0.027777777777777776 \\ \hline (6, 6, 6) & 1 & 0.004629629629629629 \\ \hline (6, 6, 8) & 3 & 0.013888888888888888 \\ \hline (6, 6, 10) & 3 & 0.013888888888888888 \\ \hline (6, 7, 7) & 3 & 0.013888888888888888 \\ \hline (6, 7, 9) & 6 & 0.027777777777777776 \\ \hline (6, 7, 11) & 6 & 0.027777777777777776 \\ \hline (6, 8, 8) & 3 & 0.013888888888888888 \\ \hline (6, 8, 10) & 6 & 0.027777777777777776 \\ \hline (6, 9, 9) & 3 & 0.013888888888888888 \\ \hline (7, 7, 8) & 3 & 0.013888888888888888 \\ \hline (7, 7, 10) & 3 & 0.013888888888888888 \\ \hline (7, 7, 12) & 3 & 0.013888888888888888 \\ \hline (7, 8, 9) & 6 & 0.027777777777777776 \\ \hline (7, 8, 11) & 6 & 0.027777777777777776 \\ \hline (7, 9, 10) & 6 & 0.027777777777777776 \\ \hline (8, 8, 8) & 1 & 0.004629629629629629 \\ \hline (8, 8, 10) & 3 & 0.013888888888888888 \\ \hline (8, 8, 12) & 3 & 0.013888888888888888 \\ \hline (8, 9, 9) & 3 & 0.013888888888888888 \\ \hline (8, 9, 11) & 6 & 0.027777777777777776 \\ \hline (8, 10, 10) & 3 & 0.013888888888888888 \\ \hline (9, 9, 10) & 3 & 0.013888888888888888 \\ \hline (9, 9, 12) & 3 & 0.013888888888888888 \\ \hline (9, 10, 11) & 6 & 0.027777777777777776 \\ \hline (10, 10, 10) & 1 & 0.004629629629629629 \\ \hline (10, 10, 12) & 3 & 0.013888888888888888 \\ \hline (10, 11, 11) & 3 & 0.013888888888888888 \\ \hline (11, 11, 12) & 3 & 0.013888888888888888 \\ \hline (12, 12, 12) & 1 & 0.004629629629629629 \\ \hline \end{array} \$

11.07.2019 / 05:34