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 16:02:01 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 12
Message-ID: <h2aohp$1mm$1@fred.mathworks.com>
References: <h2alri$2o3$1@fred.mathworks.com> <h2an11$k7n$1@fred.mathworks.com> <h2anhv$oop$1@fred.mathworks.com> <h2anv1$m0g$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 1246291321 1750 172.30.248.37 (29 Jun 2009 16:02:01 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Mon, 29 Jun 2009 16:02:01 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1477385
Xref: news.mathworks.com comp.soft-sys.matlab:551463


"Husam Aldahiyat" <numandina@gmail.com> wrote in message <h2anv1$m0g$1@fred.mathworks.com>...
> Wow it was nchoosek(40,20) all along!!! Why didn't I see that!
> 
> Thanks for the help, and the link is very helpful, thanks a lot Alan B.

I think Alan B's link givers the fastest method for this case.

factorial(40)/(factorial(20))^2

By the way this is the answer to the following question:

In a 20 by 20 square grid, how many ways can one travel from one corner to the opposite without backtracking.