Skip to content

Instantly share code, notes, and snippets.

@Akiyah
Last active August 29, 2015 14:17
Show Gist options
  • Save Akiyah/2b08be2f562cfc6bc2fb to your computer and use it in GitHub Desktop.
Save Akiyah/2b08be2f562cfc6bc2fb to your computer and use it in GitHub Desktop.
set.seed(0) # 同じ値を再現できるようにしておく
data <- c(
rep( 100000, 10),
rep( 10000, 100),
rep( 1000, 1000),
rep( 100, 10000),
rep( 0, 100000 - 11110)
)
a <- sample(data, 10000)
mean(a) #=> 40.86
b <- sample(data, 10000)
mean(b) #=> 30.96
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment