-
-
Save itsdebartha/0e883e231f8ff822d7dfbc43ff413738 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rolls<-function(n) #function | |
{ | |
x<-sample(1:6,n,replace=T) #roll n times | |
if(length(unique(x))==6) return(1) #if the number of unique outcomes is 1 | |
#return 1 | |
else return(0) #else return 0 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment