The science
Reject the first 37% of candidates outright, then take the first one who is better than everyone you have seen. In the classic 'secretary problem' this picks the single best candidate about 37% of the time, and the number of candidates barely matters: as the pool grows, the success rate settles at 1/e = 36.8%. Within the problem's rules, no strategy does better.
The rules matter: candidates arrive in random order, you know how many there are, you can only compare them with each other, every yes or no is final, and only the very best counts. Popular books (e.g. Christian & Griffiths, Algorithms to Live By, 2016) apply the '37% rule' to flat-hunting and dating; real searches rarely meet these conditions, so read it as maths, not advice.
Everything on screen is computed. The single run is a real random draw, picked as one where the rule wins (it loses in about 63% of draws); the 10,000-run tally is a real simulation (36.9%; the exact value for 100 candidates is 37.10%); the curves are exact: the best possible success rate for every pool from 1 to 1,000,000 candidates, and the success rate of every cutoff with 100.
Sources
- Ferguson, T. S. (1989). Who Solved the Secretary Problem? Statistical Science 4(3), 282–289. https://doi.org/10.1214/ss/1177012493
- Gardner, M. (1960). Mathematical Games. Scientific American 202(2), 150 (February; solution in the March issue). https://doi.org/10.1038/scientificamerican0260-150
- Lindley, D. V. (1961). Dynamic Programming and Decision Theory. Applied Statistics 10(1), 39–51. https://doi.org/10.2307/2985407