For the task described in Exercise 23, it can be shown that the best strategy is to pass over the first k−1 candidates where k is the smallest integer for which
k1+k+11+⋯+n−11≤1.
Using this strategy the probability of getting the best candidate is approximately 1/e=.368. Write a program to simulate Barbara Smith's interviewing if she uses this optimal strategy, using n=10, and see if you can verify that the probability of success is approximately 1/e.