On Tue, May 15, 2012 at 08:33:23AM -0700, tvn wrote:
>I am wondering if Sage has some functions to generate the below
>given N,K (both are non-neg ints), return a set of tuples (n1...nk)
>such that ni >= 0 and sum(ni)= N.
>
>So if N=5,k=2, then there are 6 tuples (5,0) (4,1)
On Tue, May 15, 2012 at 8:33 AM, tvn wrote:
> I am wondering if Sage has some functions to generate the below
>
> given N,K (both are non-neg ints), return a set of tuples (n1...nk) such
> that ni >= 0 and sum(ni)= N.
One way to do this is the following:
sage: IntegerListsLex(5, length=2).lis
I am wondering if Sage has some functions to generate the below
given N,K (both are non-neg ints), return a set of tuples (n1...nk) such
that ni >= 0 and sum(ni)= N.
So if N=5,k=2, then there are 6 tuples (5,0) (4,1) ... (0,5) .
Is there a name for this problem ? what is the # of tu