Surname distribution in population genetics and in statistical physics