what im trying to solve is simulation of dice roll and it goes as follows:
- numbers are default for dice 1,2,3,4,5,6 and it follows probability distribution of {0.15,0.15,0.2,0.2,0.2,0.1}
- set.seed is 555
- there will be 100 rolls
- result should be in mean from numbers that were given
Here is what i did:
set.seed(555)
sample(1:6, size = 100, prob = c(0.15,0.15,0.2,0.2,0.2,0.1), replace = TRUE)
#and previous one gives me result of
[1] 5 2 1 4 1 3 6 5 3 2 2 5 4 4 6 1 4 3 1 6 5 3 5 5 3 4 3 6 5 3 4 5 1 5 5 5 3 5 1 5 2 4 1 1 3 3
[47] 2 3 3 3 4 3 1 3 4 5 4 5 6 2 4 3 5 3 1 2 4 4 5 1 4 3 5 1 1 2 5 1 3 5 6 6 6 2 2 2 5 4 3 1 1 5
[93] 1 6 5 2 6 5 3 1
Now issue is what i have is that i dont understand how can you get mean out of this number or what function to use. I know that rnorm and mean are used but i do not understand how.