The adaptive advantage of learning and a priori prejudice