Path: news.mathworks.com!not-for-mail
From: "Steven Lord" <slord@mathworks.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Combinatorics question
Date: Thu, 29 Nov 2007 15:53:01 -0500
Organization: The MathWorks, Inc.
Lines: 40
Message-ID: <fin8rd$8r0$1@fred.mathworks.com>
References: <fimps8$7in$1@fred.mathworks.com> <fimubj$76o$1@fred.mathworks.com> <fin0sf$g6s$1@fred.mathworks.com>
Reply-To: "Steven Lord" <slord@mathworks.com>
NNTP-Posting-Host: lords.dhcp.mathworks.com
X-Trace: fred.mathworks.com 1196369581 9056 144.212.105.187 (29 Nov 2007 20:53:01 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Thu, 29 Nov 2007 20:53:01 +0000 (UTC)
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3138
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3198
Xref: news.mathworks.com comp.soft-sys.matlab:440094



"Bruno Luong" <b.luong@fogale.fr> wrote in message 
news:fin0sf$g6s$1@fred.mathworks.com...
> "John D'Errico" <woodchips@rochester.rr.com> wrote in
>> parts(10,4)
>> ans =
>>      7     1     1     1
>>      6     2     1     1
>>      5     3     1     1
>>      5     2     2     1
>>      4     4     1     1
>>      4     3     2     1
>>      4     2     2     2
>>      3     3     3     1
>>      3     3     2     2
>
> Is it all combination? I find 84 possible solutions:
>
> 1 1 1 7
> 1 1 2 6
> 1 1 3 5
> 1 1 4 4
> 1 1 5 3
> 1 1 6 2
> 1 1 7 1
> 1 2 1 6

*snip*

Note that some of the elements of John's list appear multiple times in your 
list, just with the elements permuted.  For instance, [1 1 1 7] and [1 1 7 
1] are each permutations of [7 1 1 1] in John's list.  The OP's question 
didn't specify whether the order of the elements in the vector was important 
for his application.

-- 
Steve Lord
slord@mathworks.com