A Search-Theoretic Approach to Discrimination