Use R to list all possible sums from rolling three dice

重複抽取3次骰子算出總和,共產生10000組

dta<-replicate(10000,sum(sample(1:6,3,replace=T)))

查看所有骰子的組合

table(dta)
## dta
##    3    4    5    6    7    8    9   10   11   12   13   14   15   16   17 
##   41  133  288  441  642 1011 1105 1221 1324 1127  973  716  479  301  150 
##   18 
##   48

The End