Skip to content

Instantly share code, notes, and snippets.

@itsdebartha
Last active May 12, 2022 13:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save itsdebartha/240f0a6a9a2135297eb514f5515b55b3 to your computer and use it in GitHub Desktop.
Save itsdebartha/240f0a6a9a2135297eb514f5515b55b3 to your computer and use it in GitHub Desktop.
mean_mat<-matrix(,nrow=12,ncol=12) #create a 12*12 matrix
for(i in 1:12) #loop 12 times
{
for(j in 1:12) #loop 12 times again
{
x<-replicate(10000,rolls(i,j)) #repeat the function 10000 times
mean_mat[i,j]<-mean(x) #add the mean of the above repitition to the matrix
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment