Probability Distribution for Sum of 3 Dice

making the lists of sums and related values

we create a table of the values we will obtain.  We make a list of zeroes to begin the counts of the values of each sum.  We make a list of bin cateogries for the histogram.

Clear[DiceSumValues,die1, die2,die3,DiceSumCount,DiceCategories];
DiceSumValues = Table[i,{i,3,18}]
DiceSumCount = Table[0,{i,3,18}]
DiceCategories = Table[i-.5,{i,3,19}]

See how to obtain a single value from a list

DiceSumValues[[1]]

DiceSumValues[[15]]

count the number of times a sum appears. For ease in using Mathematica's histogram, make a list of individual sum values.

Clear[value,DiceSumList];
DiceSumList ={};
For[die1 = 1, die1 ≤ 6, die1 ++, 
For[die2 = 1, die2 ≤ 6, die2 ++, 
For[die3 = 1, die3 ≤ 6, die3 ++, 
value = die1 + die2 + die3; 
(DiceSumCount[[value -2]]) ++ ;
AppendTo[DiceSumList,value]
]]]
DiceSumCount
DiceSumList

the probabilities

we know the number of elements in the list of ordered triples for the sum of three dice:

6^3

We show the value of the sum of the 3 dice, the count or frequency of times this occurs, and the fraction of time this occurs.

Print["value, count, probability (fraction, decimal)"]
TableForm[Table[{DiceSumValues[[i]],DiceSumCount[[i]],DiceSumCount[[i]]/216,DiceSumCount[[i]]/216.},{i,1,16}]]

the probability distribution (value and its associated probability)

Print["value, probability"]
TableForm[Table[{DiceSumValues[[i]],DiceSumCount[[i]]/216.},{i,1,16}]]

a nonstandard plot of the distribution

A simple plot of the distribution (value along the horizontal axis and probability along the vertical axis).

ListPlot[Table[{DiceSumValues[[i]],DiceSumCount[[i]]/216.},{i,1,16}]]

ListPlot[Table[{DiceSumValues[[i]],DiceSumCount[[i]]/216.},{i,1,16}],AxesOrigin->{0,0}]

standard plot of the distribution

Use Mathematica's extra package for histograms.

Needs["Histograms`"]

Histogram[DiceSumList]

Histogram[DiceSumList,HistogramCategories->DiceCategories]