<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/254924</link>
    <title>MATLAB Central Newsreader - I want to know the number of permutations.</title>
    <description>Feed for thread: I want to know the number of permutations.</description>
    <language>en-us</language>
    <copyright>&amp;copy;1994-2012 by MathWorks, Inc.</copyright>
    <webmaster>webmaster@mathworks.com</webmaster>
    <generator>MATLAB Central Newsreader</generator>
    <docs>http://blogs.law.harvard.edu/tech/rss</docs>
    <ttl>60</ttl>
    <image>
      <title>MathWorks</title>
      <url>http://www.mathworks.com/images/membrane_icon.gif</url>
    </image>
    <item>
      <pubDate>Mon, 29 Jun 2009 15:16:02 -0400</pubDate>
      <title>I want to know the number of permutations.</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/254924#661277</link>
      <author>Husam Aldahiyat</author>
      <description>Hello,&lt;br&gt;
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.&lt;br&gt;
&lt;br&gt;
Please help!&lt;br&gt;
&lt;br&gt;
Specifically, I want the following:&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;length(unique(perms([ones(1,20),zeros(1,20)])))&lt;br&gt;
&lt;br&gt;
or&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;length(perms([ones(1,20),zeros(1,20)]))/400&lt;br&gt;
&lt;br&gt;
(I think they give the same result)&lt;br&gt;
&lt;br&gt;
end</description>
    </item>
    <item>
      <pubDate>Mon, 29 Jun 2009 15:36:01 -0400</pubDate>
      <title>Re: I want to know the number of permutations.</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/254924#661282</link>
      <author>Bruno Luong</author>
      <description>&quot;Husam Aldahiyat&quot; &amp;lt;numandina@gmail.com&amp;gt; wrote in message &amp;lt;h2alri$2o3$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; Hello,&lt;br&gt;
&amp;gt; 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.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Please help!&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Specifically, I want the following:&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt;                           length(unique(perms([ones(1,20),zeros(1,20)])))&lt;br&gt;
&lt;br&gt;
% I guess you miss 'rows'&lt;br&gt;
m = 2;&lt;br&gt;
n = 6;&lt;br&gt;
p=unique(perms([ones(1,m),zeros(1,n)]),'rows');&lt;br&gt;
&lt;br&gt;
size(p,1) == nchoosek(m+n,n)&lt;br&gt;
&lt;br&gt;
% Bruno</description>
    </item>
    <item>
      <pubDate>Mon, 29 Jun 2009 15:44:02 -0400</pubDate>
      <title>Re: I want to know the number of permutations.</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/254924#661284</link>
      <author>Alan B</author>
      <description>&quot;Husam Aldahiyat&quot; &amp;lt;numandina@gmail.com&amp;gt; wrote in message &amp;lt;h2alri$2o3$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; Hello,&lt;br&gt;
&amp;gt; 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.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Please help!&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Specifically, I want the following:&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt;                           length(unique(perms([ones(1,20),zeros(1,20)])))&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; or&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt;                           length(perms([ones(1,20),zeros(1,20)]))/400&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; (I think they give the same result)&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; end&lt;br&gt;
&lt;br&gt;
If you're just interested in examples similar to the one you give, look at this: &lt;a href=&quot;http://www.research.att.com/~njas/sequences/index.html?q=2+6+20+70+252&amp;language=english&amp;go=Search&quot;&gt;http://www.research.att.com/~njas/sequences/index.html?q=2+6+20+70+252&amp;language=english&amp;go=Search&lt;/a&gt; .</description>
    </item>
    <item>
      <pubDate>Mon, 29 Jun 2009 15:45:03 -0400</pubDate>
      <title>Re: I want to know the number of permutations.</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/254924#661285</link>
      <author>Husam Aldahiyat</author>
      <description>&quot;Bruno Luong&quot; &amp;lt;b.luong@fogale.findmycountry&amp;gt; wrote in message &amp;lt;h2an11$k7n$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &quot;Husam Aldahiyat&quot; &amp;lt;numandina@gmail.com&amp;gt; wrote in message &amp;lt;h2alri$2o3$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &amp;gt; Hello,&lt;br&gt;
&amp;gt; &amp;gt; 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.&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; Please help!&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; Specifically, I want the following:&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt;                           length(unique(perms([ones(1,20),zeros(1,20)])))&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; % I guess you miss 'rows'&lt;br&gt;
&amp;gt; m = 2;&lt;br&gt;
&amp;gt; n = 6;&lt;br&gt;
&amp;gt; p=unique(perms([ones(1,m),zeros(1,n)]),'rows');&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; size(p,1) == nchoosek(m+n,n)&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; % Bruno&lt;br&gt;
&lt;br&gt;
Actually I used rows in my code I just forgot to put it in the message.&lt;br&gt;
&lt;br&gt;
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 :(</description>
    </item>
    <item>
      <pubDate>Mon, 29 Jun 2009 15:52:01 -0400</pubDate>
      <title>Re: I want to know the number of permutations.</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/254924#661287</link>
      <author>Husam Aldahiyat</author>
      <description>Wow it was nchoosek(40,20) all along!!! Why didn't I see that!&lt;br&gt;
&lt;br&gt;
Thanks for the help, and the link is very helpful, thanks a lot Alan B.</description>
    </item>
    <item>
      <pubDate>Mon, 29 Jun 2009 16:02:01 -0400</pubDate>
      <title>Re: I want to know the number of permutations.</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/254924#661289</link>
      <author>Husam Aldahiyat</author>
      <description>&quot;Husam Aldahiyat&quot; &amp;lt;numandina@gmail.com&amp;gt; wrote in message &amp;lt;h2anv1$m0g$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; Wow it was nchoosek(40,20) all along!!! Why didn't I see that!&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Thanks for the help, and the link is very helpful, thanks a lot Alan B.&lt;br&gt;
&lt;br&gt;
I think Alan B's link givers the fastest method for this case.&lt;br&gt;
&lt;br&gt;
factorial(40)/(factorial(20))^2&lt;br&gt;
&lt;br&gt;
By the way this is the answer to the following question:&lt;br&gt;
&lt;br&gt;
In a 20 by 20 square grid, how many ways can one travel from one corner to the opposite without backtracking.</description>
    </item>
    <item>
      <pubDate>Mon, 29 Jun 2009 16:11:02 -0400</pubDate>
      <title>Re: I want to know the number of permutations.</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/254924#661292</link>
      <author>Bruno Luong</author>
      <description>&quot;Husam Aldahiyat&quot; &amp;lt;numandina@gmail.com&amp;gt; wrote in message &amp;lt;h2aohp$1mm$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; In a 20 by 20 square grid, how many ways can one travel from one corner to the opposite without backtracking.&lt;br&gt;
&lt;br&gt;
The general case is showed here, if you haven't pay attention&lt;br&gt;
&lt;a href=&quot;http://www.mathworks.com/matlabcentral/newsreader/view_thread/253745#658145&quot;&gt;http://www.mathworks.com/matlabcentral/newsreader/view_thread/253745#658145&lt;/a&gt;&lt;br&gt;
&lt;br&gt;
Bruno</description>
    </item>
  </channel>
</rss>

