Some connections between ergodic theory and the iteration of polynomials