Re: Computing nCr how?
- To: mathgroup at smc.vnet.net
- Subject: [mg94892] Re: [mg94820] Computing nCr how?
- From: Bob Hanlon <hanlonr at cox.net>
- Date: Mon, 29 Dec 2008 06:43:12 -0500 (EST)
- Reply-to: hanlonr at cox.net
expr = Binomial[n, r] // FunctionExpand Gamma[n + 1]/(Gamma[r + 1]* Gamma[n - r + 1]) expr /. Gamma[x_] :> (x - 1)! n!/(r!*(n - r)!) % == %% // FullSimplify True Table[Binomial[n, r], {n, 0, 5}, {r, 0, n}] {{1},{1,1},{1,2,1},{1,3,3,1},{1,4,6,4,1},{1,5,10,10,5,1}} Bob Hanlon On Sat, Dec 27, 2008 at 9:47 AM , Affan wrote: > Hi, > I know this sounds simple but I cant find the function in mathematica > to compute nCr (i.e. number of combination for n obj chosen in groups > of r). Can anyone help? > > Thanks