# Probability help on rolling two D4 with all doubles counting as zero except double 4s, which count as 4

So I have devised a game system involving two D4 being rolled to determine movement on a chart. It works by tabulating the difference between the dice pips on each die, e.g., Die 1=rolls '1' vs Die 2=rolls '4' resulting in 4-1=3 movement. The point is to allow for '0' movement when doubles are rolled. But I also wanted to allow for a roll of '4' so I set a roll of double 4s to equal 4 movement, while all other doubles cancel, or zero movement. I have tried calculating this myself but I would appreciate some help to check my work and offer any corrections or suggestions. So....

1. Five possible outcomes on two D4: 0,1,2,3,4
2. The probabilities for each option are not equal: 4 is least likely at 1/16 (0.0625)
3. 0 requires (1|1), (2|2) or (3|3), so that is 3x more likely than 1/16 so 1/16 + 1/16 + 1/16 = 3/16 (0.1875) correct? The rest I will do based on "differences" between the dice
4. Difference of 1: (1|2), (2|1), (2|3), (3|2), (3|4) and (4|3). So would my probability for a "1" be 6/16 (0.375)?
5. Difference of 2: (3|1), (4|2), (2|4) and (1|3). So 2 is 4/16 (0.25)?
6. Difference of 3: (4|1), (1|4). So 3 is 2/16 (0.125)?
7. Summary from highest probability to lowest: 1 (38%), 2 (25%), 0 (19%), 3 (13%), 4 (6%)

Did I get that right?

If so, then my last question concerns the mean value for everything? Definitely need some help here. The zeros are screwing with my brain here. I presume the mean value should be greater than 1 but less than 2.

• Welcome to RPG.SE! Take the tour and visit the help center if you haven't done so yet: you may find guidelines and useful suggestions about posting Q&A here. Happy gaming! Aug 27, 2023 at 17:35

### The probabilities are right, but beware of approximations.

You got the right probabilities in terms of fractions, but when you approximated them with percentages you get a sum of 101%. You are adding 0.5% in items 4 and 6.

A further confirm can be obtained by simulating the rolls and computing the distances via your rules. The histogram below depicts the simulation of 1 million rolls (blue bars) and compares the empirical distribution with the theoretical one (orange dots).

### For the average movement you can use the formula for the expected value.

The formula for the expected value $$\{\rm E}[X]\$$ of a discrete random variable $$\X\$$ that can take the values $$\x_1, x_2,\dots,x_n\$$ is given by $${\rm E}[X] = \sum_{i=1}^n x_i P(x_i)$$

where $$\P(x_i)\$$ is the probability of each value. This formula takes into account the fact that the values have different probabilities: this is a sort of weighted mean, where the weights are given by the probabilities. The higher the probability of a value is, the higher its contribution to the average is.

In this case you have $${\rm E}[X] = 0 \frac{3}{16} + 1\frac{6}{16} + 2\frac{4}{16} +3\frac{2}{16} +4\frac{1}{16} = \frac{24}{16} = 1.5$$

Your intuition that the average movement should be between 1 and 2 is correct.

• Wow! Thank you for both the promt and informative reply! Aug 27, 2023 at 19:02
• @behemothbeer You're welcome! You can wait a little bit, and if you find the answer useful you may mark it as accepted, meaning that it solves your problem. Usually, it may be ok to wait at least a day before marking an answer as accepted, in order to allow people from different timezones to see your question and eventually contribute. Aug 27, 2023 at 19:36
• Got it. Thanks. Aug 27, 2023 at 20:35
• Actually, I do have one further question. The "0" result could turn out to be a problem. Probably not, but I can see how it might. Making 0 and 3 equally likely would be the fix. But not sure how I could do that without making 4 more likely (i.e., making 1|1 doubles equal to 4), or making other rules convoluted. Aug 27, 2023 at 20:43

Eddymage's answer is correct, but I thought I would provide a supplementary answer to introduce one of RPG.SE's favorite tools: AnyDice. (We even have a tag for it: .)

After wrestling with some error messages for a while, I was able to implement your rolling strategy using two functions:

• movehelper: takes two numbers (i.e. the results of your rolls) and returns the difference between the higher and the lower, unless both numbers are 4, in which case it returns 4.
• move: feeds two 1d4s into movehelper and returns the result. (This is technically unnecessary—you could call output [movehelper 1d4 1d4] directly— but I liked the idea of having a neat wrapper.)

The program is here: https://anydice.com/program/3162d

As you can see, AnyDice shows you the probabilities of each result.

• 0: 18.75% chance
• 1: 37.5% chance
• 2: 25% chance
• 3: 12.5% chance
• 4: 6.25% chance

The two numbers in parentheses after "output 1" are the mean/average result (1.5) and the standard deviation (1.12).

You mentioned in a comment that you might want 0 and 3 to be equally likely. Under your current scheme, 0 has a 3/16 chance of occurring, while 3 has a 2/16 chance.

The simplest way to implement this would be to say that a double-1 roll is not a valid result, i.e. roll again. This would change the chances of both 0's and 3's to 2/15.

AnyDice program for that strategy: https://anydice.com/program/31632

This raises your mean result to 1.6.

• Wow, thanks for doing that! Definitely helpful. Aug 30, 2023 at 4:17
• I very much like the 1/1 null, so "roll again." That would actually work rather neatly as a bookend to the 4/4 roll. Thank you! Aug 30, 2023 at 4:21