On the probability of the emergence of a protein with a particular function