Secretary problem

N rankable candidates. See them sequentially in random order, once seen can not be considered again, choosing one stops the process. Want optimal.
Algorithm: see 1/e of them remembering the rank of the best of them, then choose next that is better. Has 1/e chance of choosing the best.

N:     maxRandomRange:
How many trials?

Percent optimal choices:

Trials' numbers: (only displays if trials≤1000)