Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: integer solutions for x_1+x_2+...+x_n = k
Date: Thu, 6 Nov 2008 15:19:02 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 17
Message-ID: <gev1t5$8vd$1@fred.mathworks.com>
References: <geku21$eku$1@fred.mathworks.com> <gel0b6$3li$1@fred.mathworks.com> <geqe85$chp$1@fred.mathworks.com> <geqeuo$m4e$1@fred.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-02-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1225984742 9197 172.30.248.37 (6 Nov 2008 15:19:02 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Thu, 6 Nov 2008 15:19:02 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1582760
Xref: news.mathworks.com comp.soft-sys.matlab:499317


"John D'Errico" <woodchips@rochester.rr.com> wrote in message <geqeuo$m4e$1@fred.mathworks.com>...
> You can look at my partitions function on the
> file exchange. It is certainly less elegant than
> Bruno's code as I recall, although it is still
> recursive.
> 
> The idea behind these recursive methods to find
> the partitions of the number k is to pick a value
> for x1. Once you have done that, you are now
> looking for all the partitions of k-x1. Repeat
> recursively until done.
> 
> John

Thank you John, now I know that the process is called integer partition. I was wondering before what it is called, have never studied Number theory.. hehe..  I understand  also what exactly is a recursive algorithm now..thank you for your explaination.