Chapter 5 Question 17:

The probability of a royal flush in a poker hand is p = 1/649,740. How large must n be to render the probability of having no royal flush in n hands smaller than 1/e?

flush <- 1/649740
no_flush <- 1-flush

prob <- qgeom(1/exp(1), prob = flush, lower.tail = F) ##Note that 1/e in this case is 1/exp(1)
cat("n must be", prob, "large to eliminate the probability of having no royal flush in n hands smaller than 1/e")
## n must be 649739 large to eliminate the probability of having no royal flush in n hands smaller than 1/e