Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: I want to know the number of permutations.
Date: Mon, 29 Jun 2009 15:45:03 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 23
Message-ID: <h2anhv$oop$1@fred.mathworks.com>
References: <h2alri$2o3$1@fred.mathworks.com> <h2an11$k7n$1@fred.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-03-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1246290303 25369 172.30.248.38 (29 Jun 2009 15:45:03 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Mon, 29 Jun 2009 15:45:03 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1477385
Xref: news.mathworks.com comp.soft-sys.matlab:551459


"Bruno Luong" <b.luong@fogale.findmycountry> wrote in message <h2an11$k7n$1@fred.mathworks.com>...
> "Husam Aldahiyat" <numandina@gmail.com> wrote in message <h2alri$2o3$1@fred.mathworks.com>...
> > Hello,
> > Just like we do with nchoosek, I want a way to obtain the number of rows of the output of perms, without obtaining what they are.
> > 
> > Please help!
> > 
> > Specifically, I want the following:
> > 
> >                           length(unique(perms([ones(1,20),zeros(1,20)])))
> 
> % I guess you miss 'rows'
> m = 2;
> n = 6;
> p=unique(perms([ones(1,m),zeros(1,n)]),'rows');
> 
> size(p,1) == nchoosek(m+n,n)
> 
> % Bruno

Actually I used rows in my code I just forgot to put it in the message.

About your code, I don't understand the final line. I have a headache please bear with me! And I want m and n to be 20 and 20. That's why I'm looking for a getaround, because the matrix for perms would be very big to do it normally :(