The Ranking Problem of a Gray Code for Compositions

A.J.van Zanten1
1Delft. University of Technology Faculty of Technical Matheniatics P.O. Box 5031, 2600 GA Delft. The Netherlands

Abstract

The ranking and unranking problem of a Gray code \(C(n,k)\) for compositions of \(n\) into \(k\) parts is solved. This means that rules have been derived by which one can calculate in a non-recursive way the index of a given codeword, and vice versa, determine the codeword with a given index. A number system in terms of binomial coefficients is presented to formulate these rules.