birthday

n人の中で同じ誕生日の人がいる人確率は?

birthday <- NULL
for (i in 1:100) birthday[i] <- pbirthday(i)
plot(1:100, birthday)
points(1:100, 1 - birthday, pch = 19)
abline(h = 0.5, v = 23)

plot of chunk unnamed-chunk-2