The length ℓ ℓ ( g ) of an element g of a Coxeter group G is the smallest number k such that g can be written as a product g = s i 1 ⋯ ⋯ s i k of k Coxeter generators of G. Geometrically, the length of an element g in S ~ ~ n is the number of reflecting hyperplanes that separate A 0 and A 0 ⋅ ⋅ g , where A 0 is the fundamental alcove (the simplex bounded by the reflecting hyperplanes of the Coxeter generators s 0 , s 1 , … … , s n − − 1 ). Combinatorially, the length of an affine permutation is encoded in terms of an appropriate notion of inversions : for an affine permutation u, the length is ℓ ℓ ( u ) = # # { ( i , j ) : : i ∈ ∈ { 1 , … … , n } , i < j , and u ( i ) > u ( j ) } . Alternatively, it is the number of equivalence classes of pairs ( i , j ) ∈ ∈ Z × × Z such that i < j and u ( i ) > u ( j ) under the equivalence relation ( i , j ) ≡ ≡ ( i ′ , j ′ ) if ( i − − i ′ , j − − j ′ ) = ( k n , k n ) for some integer k. The generating function for length in S ~ ~ n is ∑ ∑ g ∈ ∈ S ~ ~ n q ℓ ℓ ( g ) = 1 − − q n ( 1 − − q ) n .