Skip to content

Instantly share code, notes, and snippets.

@krishnanraman
Created January 17, 2024 22:42
Show Gist options
  • Save krishnanraman/ca3ff546d82b02eabad95458a7b69c3d to your computer and use it in GitHub Desktop.
Save krishnanraman/ca3ff546d82b02eabad95458a7b69c3d to your computer and use it in GitHub Desktop.
x<-seq(1,20)
n<-100000
mx<-c()
for (i in 1:n) {
mx<-c(mx,max(sample(x,10,replace=F)))
}
summary(mx)
Min. 1st Qu. Median Mean 3rd Qu. Max.
10.00 19.00 20.00 19.09 20.00 20.00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment