I have a question about probabilities with custom 6-sided dice (not the regular 1,2,3,4,5,6 dice we all know and love, but a dice like 0,0,1,1,2,3). Now imagine having 3 different custom dice (blue, red and green, all with different sides) and that 2 players roll 3 of those dice (Player A is rolling R+G+B, player B is rolling 2R+G).

Now, I can calculate the probability of each result separately. For example, I know that Player A has a 68% to roll at least "3" with his chosen dice, while Player B has only 52% to roll "3" with his dice. Same for any other result. What I don't know is if it is possible (an algorithm or formula) to calculate the probability that Player A will win the roll regardless of the number of successes.

So I am not looking for statements of the type "68% vs 52% to roll "3", 53% vs 40% to roll "4", etc", but instead I am looking for the X in the following statement: "When you roll R+G+B and the opponent is rolling 2R+G, you have a X% to roll higher" (which equals winning the roll).

Any ideas about how/if I can come up with an answer to this question? I can code this in a small app so that it makes all the calculations by itself, but I have no idea where to start when it comes to this type of complex probability result. I assume it is a purely mathematical/probability question, so I hope I posted this in the correct forum.

  • $\begingroup$ Not sure this is clear. If you know the probability that $A$ throws a given sum, and the probability that $B$ throws a given sum, then you can compute the joint probability that $A,B$ will throw a given pair of sums (it's just the product)...and from that joint probability you can read off the probability that $A's$ throw will be higher than $B's$. Is that what you are asking? $\endgroup$ – lulu Oct 10 '17 at 13:25
  • $\begingroup$ Right now I have on an excel sheet all the probabilities for all possible outcomes when the 2 players throw any combination of 3 dice. So I know the probabilities for every possible result. I guess what I am asking is: Can I produce a "single number" that will give an idea about the overall probability that a player will win? For example, using the numbers I mentioned in the first post about the probabilities to roll 3 or 4 for the 2 different sets of dice, would it be correct to add the difference between the 2 probability sets and come up with a single result? - to be continued $\endgroup$ – kkostas Oct 11 '17 at 6:42
  • $\begingroup$ In this case would be (68-52) + (53-40) = 16 + 13 = 29% that Player A will win (if both roll 3 or 4)? I don't know much about probabilities but this feels very wrong. $\endgroup$ – kkostas Oct 11 '17 at 6:46
  • $\begingroup$ You know $P(i,j)$ for every pair $(i,j)$ (where $P(i,j)$ denotes the probability that $A$ throws an $i$ AND $B$ throws a $j$). Then the probability that $A$ wins is $\sum_{i>j}P(i,j)$. $\endgroup$ – lulu Oct 11 '17 at 12:40

The programmer's answer to this question is different from the mathematician's answer. The mathematician's answer is:

Without knowing the actual distribution of pips on the faces of the dice, the question is impossible to answer.

I think this is why nobody has responded to your question.

But you said you want to write an app that knows what the dice are and does the calculation, and this is easy. Let's suppose, just for concreteness, that $R$ and $G$ are six-sided, and that $G$ has the numbers 0 through 5 while $R$ has the standard numbers 1 through 6. Then imagine a table like this:

$$\begin{array}{c|cccccc} & 0 & 1 & 2 & 3 & 4 & 5 \\ \hline 1 & R & - & G & G & G & G \\ 2 & R & R & - & G & G & G \\ 3 & R & R & R & - & G & G \\ 4 & R & R & R & R & - & G \\ 5 & R & R & R & R & R & - \\ 6 & R & R & R & R & R & R \\ \end{array} $$

The row shows the number rolled on the red die, the column shows the number rolled on the green die, and the table shows the winner: $R$ for red, $G$ for green, and $-$ for a tie. We count up $21 R$ and $10 G$, so that $R$ has a $\frac{21}{10+21} \approx 67.7\%$ chance to win, assuming that on a tie you throw it away and start over. (Or, if ties aren't do-overs, $R$ has a $\frac{21}{36} \approx 58.3\%$ chance to win and a $\frac5{36}\approx13.9\%$ chance to tie.)

It is quite easy for the computer to do the counting, without even constructing the table. I am going to write some pseudocode here. Let's say $R$ and $G$ are as above, and represent them in the program as follows:

    R = [0, 1, 1, 1, 1, 1, 1]
    G = [1, 1, 1, 1, 1, 1]

Here R[3] is the number of faces of the $R$ die that show the number 3. R[0] is 0 because $R$ has no faces that show zero, but G[0] is 1 because $G$ does have a zero. If we had a die with the faces $1,2,2,2,7,7$, we would represent it as [0, 1, 3, 0, 0, 0, 0, 2]. If one player is rolling two standard dice, which is $R+R$, we can instead pretend they are rolling one 36-sided die that we represent as

    [0, 0, 1, 2, 3, 4, 5, 6, 5, 4, 3, 2, 1].

I hope this is clear. The computer can easily calculate the list for $R+R$ from the list for $R$ itself.

Now we can compare two dice $d_1$ and $d_2$ like this:

    total = d1_wins = d2_wins = ties = 0

    for i from 0 to d1.max
      for j from 0 to d2.max
        prob = d1[i] * d2[j]
        total = total + prob
        if i > j then
          d1_wins = d1_wins + prob
        else if i < j then
          d2_wins = d2_wins + prob
          ties = ties + prob

    print "Probability of D1 winning: ", d1/total
    print "Probability of D2 winning: ", d2/total

Or, if ties are do-overs, just change total = total + prob to

    if i ≠ j then
      total = total + prob

and leave everything else the same. If you want to convert the probabilities to percentages, you simply multiply by 100%.

I hope this is helpful and answers your question.

| cite | improve this answer | |
  • $\begingroup$ I have placed my Perl implementation of this method at gist.github.com/mjdominus/ac2c3c36c50d7ae97b0f06bf94346061 . The code is in the public domain. $\endgroup$ – MJD Oct 14 '17 at 15:29
  • $\begingroup$ I apologize for the late reply, but I was stuck thinking of other problems. Many, many thanks, MJD for the answer. So simple and yet I didn't consider it before. You are right that dealing with it thinking as a programmer instead of a mathematician is more efficient (at least with my set of skills). I think the easiest thing for me to do is use as a base your first example with the table, but expand to treat all outcomes of each combination of 3 dice as the sides of a 6x6x6=216-sided dice and then let the program determine the success rate after building a table for each set of fice. $\endgroup$ – kkostas Oct 24 '17 at 12:15
  • $\begingroup$ @kkostas If you found the answer acceptable, you can click the check mark next to it to indicate that the question has been answered satisfactorily. This will prevent it from showing up in lists of unanswered questions. $\endgroup$ – MJD Oct 24 '17 at 13:33
  • $\begingroup$ Done. Thanks again for your help. $\endgroup$ – kkostas Oct 24 '17 at 21:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.