> First count, regarding no consecutive valleys at the same height is OK. Bivariate g.f. G=G(t,z) for the statistic "number of consecutive valleys at the same height" (marked by t) is aG^2-bG+c=0, where a=z(1-z), b=(1-z)(1+z-tz), c=1-tz. I'll try to work out the other two cases. Emeric