Every story and comment from the Hacker News API, in a layout borrowed from 2001.
A comment on Using Face ID to unlock brother’s iPhone X after entering PIN. Parent comment
qbirthday(prob = 0.5, classes = 1e6, coincident = 2)
# 1178
You could also just calculate a bunch of the probabilities and find the minimum more "maunually"
in.room <- 1000:1500
probs <- sapply(in.room, function(x) prod(((1e6 - (x - 1)):1e6)/1e6))
in.room[which.min(abs(probs - .5))]
There are no comments on this comment yet.
qbirthday(prob = 0.5, classes = 1e6, coincident = 2)
# 1178
You could also just calculate a bunch of the probabilities and find the minimum more "maunually"
in.room <- 1000:1500
probs <- sapply(in.room, function(x) prod(((1e6 - (x - 1)):1e6)/1e6))
in.room[which.min(abs(probs - .5))]
# 1178