dice sums.math

2 and 3 standard dice sums. (d6) another method using a table with sums. Google sheet below.

**********************

A link to a text file for '1 to 10 d6' (1 to 10 standard fair dice) showing the dice sums, number of ways and distribution probabilities. Created using pari/gp calculator. Has exact fractions.

1to10d6 Text file distribution

Another link to another text file (created with R code, all decimal results) for '1 to 30 d6' (1 to 30 standard fair dice)showing the dice sums, number of ways and distribution probabilities.

1to30d6 Text File distribution (R code produced)


3d6-sums

worksheet using recursion for 1d6 to 12d6 sums. shows the number of ways to get each sum using X number of dice.

dice-sums-12d6

1r. R code for dice sums. uses expand.grid() that basically lists all permutations and sums.

large number of dice may slow calculations. (9d6 or higher for example)

not fully tested for crash limits.

default is for 2d6 (2 standard dice)

values to change if required:

Lines 10 (minSum), 11 (maxSum),14 (dice in expand.grid() )


2r. Method for dice sum range probabilities using R code. uses convolve() and matrix().

Much faster for many dice (up to 10000).

function takes a range and number of same type dice ( lowerSum, upperSum, number of dice, faces)

IF lowerSum = upperSum then probability is for 1 sum only

Note: code uses standard dice greater than 1 and less than 4001

3r. R code. dice sums ways and probabilities. All dice are the same.

Default is for 6-sided dice. Uses Martix() and convolve().

function calls with diceSums(2) meaning 2 6-sided dice are rolled

diceSums(2, 6) is the same

number of dice needs to be greater than 1 and less than 51.