I am looking to output the probability of n classic six-sided dice but I am not sure how to go about starting. This is what I have written out so far, but no way to go about accounting for n dice for every roll.
Dice[n_Integer] := Dice[n, Black]
Format[Dice[n_Integer, c_]] :=
With[{dots = {1 -> {5}, 2 -> {3, 7}, 3 -> {3, 5, 7},
4 -> {1, 3, 7, 9}, 5 -> {1, 3, 5, 7, 9},
6 -> {1, 2, 3, 7, 8, 9}} /.
l : {__Integer} :>
Sequence @@ Thread[l -> Graphics[{c, Disk[]}, ImageSize -> 16]],
face = Partition[Range@9, 3]},
Panel[Grid[face /. {n /. dots, _Integer -> Null}, ItemSize -> All]]]
Dice /@ Range@6 // Row
RollDice[] := GraphicsRow[RandomChoice[Array[Dice, {6}], {2}]];
prob = Probability[Dice~DiscreteUniformDistribution[{1, 6}]]
RollDice[n_] := Table[Dice[], {n}]
RollDice[9]
The probability for a single roll of n dice should be P = (1/s)^n where s = the sides of the die and n = the number of die available. Therefore the number should always stay the same (1/6), but n must be updated. So I was thinking Prob = (1/6)^Dice[]...
EDIT: I seem to be getting an error when I run the code. It prints "Dice(n_Integer(k))" instead of printing the row of dice needed. Can anyone tell me how to improve here?
EDIT #2: After inputting the built-in probability function, I seem to be getting an error where the code prints out {Dice{}...Dice{}} for an n amount of dice when I need the dice and the probability value of that particular roll.
Probability
[Dice~DiscreteUniformDistribution[{1, 6}]]` is wrong syntax. As well asTable[Dice[], {n}]
$\endgroup$