Re: NextComposition - the bug?
- To: mathgroup at smc.vnet.net
 - Subject: [mg33413] Re: [mg33365] NextComposition - the bug?
 - From: Rob Pratt <rpratt at email.unc.edu>
 - Date: Wed, 20 Mar 2002 01:53:28 -0500 (EST)
 - Sender: owner-wri-mathgroup at wolfram.com
 
On Sun, 17 Mar 2002, Nikolay Andreev wrote:
> Dear Mathgroup!
> 
> In the Help 
> standart packages -> discrete math -> combinatorica
> one can see 
> Compositions
> NextComposition
> RandomComposition
> 
> If you use Compositions[3,3] or RandomComposition[3,3] all is ok. 
> But if you use NextComposition[3,3] the Mathematica doing nothing. 
> It seems that there are now function with such name.
> Or I'm doing something rong?
> I'm using Mathematica 4.1 under Linux.
> 
> I tried to calculate Compositions[13,13] (only  5200300 variants) but
> Mathematica said There are now memory The kernel shut down. And this is
> on the mashine with 1GB DDR and 1GB swap-file!!! Only 5200300x13 small
> integer numbers.
> 
> Any ideas about NextComposition?
> Thank you,
> Nikolay
According to the usage statement,
NextComposition[l] gives the integer composition which follows l in a
   canonical order.
NextComposition takes a single list as its argument.  For example,
NextComposition[{2,0,1}] returns {1,1,1}.
Rob Pratt
Department of Operations Research
The University of North Carolina at Chapel Hill
rpratt at email.unc.edu
http://www.unc.edu/~rpratt/