Guessing my book list

Hi Bingqing, good job on guessing 5/10 books that I have read!

I was thinking about how you would compare if I gave this test to a bunch of chimpanzees… but since there aren’t too many chimpanzees in Switzerland (sample size is important!), I thought I would just simulate it.

set.seed(0)

# initialize my vector of books
# 10 I have read (denoted as 1)
# 10 I have not read (denoted as 0)
books <- c(rep(1, 10), rep(0, 10))

# get each chimpanzee to sample 10 books out of my list of books
# let's do this for a large number of chimpanzees... because we can.
n_chimpanzees <- 1000000
chimpanzees_score <- rep(NA, n_chimpanzees)
for (i in seq(n_chimpanzees)){
  chimpanzees_choices <- sample(books, 10)
  chimpanzees_score[i] <- sum(chimpanzees_choices)    # max score is 10
}

Cool, we’ve just sampled 106 chimpanzees. Let’s see how they did as a collective…

h <- hist(chimpanzees_score, breaks=10)

plot of chunk plot_scores

Amazing! There was 1 chimpanzee that got a perfect score! He deserves a barrel of bananas!

Now… let’s see which bar you fit in, Bingqing…

plot(h, col=replace(rep("white", length(h$breaks) - 1), bingqing_score, "red"))

plot of chunk plot_scores_color_bingqing

Unfortunately, there were 328875 (32.8875%) chimpanzees that beat your score… and 342726 (34.2726%) chimpanzees tied your score…

But hey, let’s look on the bright side, at least you beat 328399 chimpanzees!