Path: news.mathworks.com!not-for-mail
From: "Daniel " <danielDOTrDOTlittle@gmail.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Number of unique combinations from sets
Date: Wed, 7 May 2008 05:36:03 +0000 (UTC)
Organization: University of Western Australia
Lines: 32
Message-ID: <fvrf43$n9i$1@fred.mathworks.com>
References: <fvr755$inh$1@fred.mathworks.com> <fvr8v7$h82$1@fred.mathworks.com> <fvrc2j$rtm$1@fred.mathworks.com> <fvrda1$s4d$1@fred.mathworks.com>
Reply-To: "Daniel " <danielDOTrDOTlittle@gmail.com>
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 1210138563 23858 172.30.248.37 (7 May 2008 05:36:03 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Wed, 7 May 2008 05:36:03 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 740978
Xref: news.mathworks.com comp.soft-sys.matlab:467087


> In this example, it looks like you have two sets(1:3 and 
> 1:4), selecting 1 item from each set.  Why is [2 1] not a 
> valid combination then?  

Ok, this problem came about because I was trying to find a
way to determine how many cuboids of size a x b x c will fit
into a larger cuboid of size m x n x p. For this problem, a
x b x c is equivalent to a x c x b or b x a x c, etc. So
rotation of the cuboid shape doesn't matter. 

So, if I want to find all potentially valid combinations of
a x b x c that will fit into a larger shape m x n x p, then
I have to consider all combinations of the sets [1:m], [1:n]
and [1:p], but since rotation doesn't matter I need to
eliminate any combinations where a x b x c can be created by
permuting the elements in c x b x a or a x c x b or b x a x
c, etc. 

Hence, I need allcomb but with the non-unique permutations
removed. So, [1 2] is valid but [2 1] is not valid because
the reversing the elements of [2 1] equals [1 2]. Does that
help at all?  


> I could come up with some code that will do this, but I 
> don't think this is really what you want to do.  Maybe you 
> can explain further.

The script listed in my original post is correct and will do
what I need, but it's incredibly slow for large set sizes. 

Hope that clarifies the issue a little.