Using R to simulate a biased 6 sided dice

前端 未结 3 366
执笔经年
执笔经年 2021-01-28 12:45

In R I want to figure the code to simulate a biased 6 sided die being thrown 44 times. The die is biased in the sense that the number 6 is twice as likely to be thrown as any ot

3条回答
  •  一整个雨季
    2021-01-28 13:31

    You can use sample and specify probabilities for each number.

      sample(x = 1:6, size = 44, replace = T, prob = c(rep(1/7, 5), 2/7))
    

提交回复
热议问题