Generalized statistics on Sn and pattern avoidance

Natural q analogues of classical statistics on the symmetric groups Sn are introduced; parameters like: the q-length, the q-inversion number, the q-descent number and the q-major index. Here q is a positive integer. MacMahon's theorem (Combinatory Analysis I-II (1916)) about the equidistribution of the inversion number and the reverse major index is generalized to all positive integers q. It is also shown that the q-inversion number and the q-reverse major index are equi-distributed over subsets of permutations avoiding certain patterns. Natural q analogues of the Bell and the Stirling numbers are related to these q statistics--through the counting of the above pattern-avoiding permutations.