On Sat, Aug 2, 2008 at 7:49 AM, R.E. Boss <[EMAIL PROTECTED]> wrote:
> There are  n %&! n-k  ways of choosing k items out of n .
> Example for n=5 and k=2 , the 20 choices transposed:
>   0 0 0 0 1 1 1 1 2 2 2 2 3 3 3 3 4 4 4 4
>   1 2 3 4 0 2 3 4 0 1 3 4 0 1 2 4 0 1 2 3
>
> The question is how to generate the choices in lexicographical order.

There's some code on

    
http://www.jsoftware.com/jwiki/Phrases/Sets#head-54e1dbcf8724a38a30a758e5d67a074fe33a70be

that does this I believe.

Ambrus
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to