Abstract
Let P(n,r) = {P n , r |P n , r = p 1 p 2…p r and p 1,p 2,…,p r ∊Z and p 1≠p j if i≠j}, where Z = {1,2,…,n}. An θ(r) algorithm for enumerating P(n,r) in the lexicographic order is presented. The mapping from P(n,r) to the set of their inversions and the inverse mapping are established by a pair of coding and decoding algorithms. Furthermore, ranking and unranking algorithms are also provided for establishing the mappings between P(n,r) and Z = {1,2,…,|P(n,r)|}. Indeed, the enumeration, ranking and unranking algorithms are more general than known algorithms.