I have a matrix consist of the sum of dice 1 and dice 2 OR Y = D1 + D2
outer(1:6, 1:6, "+")
The output is:
[,1] [,2] [,3] [,4] [,5] [,6]
[1,] 2 3 4 5 6 7
[2,] 3 4 5 6 7 8
[3,] 4 5 6 7 8 9
[4,] 5 6 7 8 9 10
[5,] 6 7 8 9 10 11
[6,] 7 8 9 10 11 12
How do I put it in a data frame called Y with the sum and the probability of each sum, for example:
Sum pSum
2 1/36
3 2/36
4 3/36
.
.
.
12 1/36
When I calculate for sum(Y$pSum), it will equal to 1