Bill Allombert on Sat, 25 Jun 2016 14:07:33 +0200


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: Need permutation help for n!/(n-r)!


On Sat, Jun 25, 2016 at 09:21:37AM +0530, chandra sekaran wrote:
> numtoperm(n,k) will give  k-th permutation for n!.
> 
> Any function for n!/(n-r)! available?
> 
> 
> For n!/(n-r)!, Let n = 50 and r = 3.
> If we define r as subset say [2,3,5] i want
> calculate the number where [2,3,5] occur and reverse also.
> 
> Any direct function available and if not how to calculate.

You can use forvec(...,2)

forvec(v=vector(3,i,[1,50]),print(v),2)

Cheers,
Bill