Dice game probabilities: Difference between revisions
m
→{{header|R}}: Syntax highlighting.
(→{{header|Wren}}: Now uses new core library method.) |
ReeceGoding (talk | contribs) m (→{{header|R}}: Syntax highlighting.) |
||
Line 1,992:
=={{header|R}}==
Solving these sorts of problems by simulation is trivial in R.
<lang
{
mean(replicate(10^6, sum(sample(facesCount1, diceCount1, replace = TRUE)) > sum(sample(facesCount2, diceCount2, replace = TRUE))))
|