[R] Permutations

Torsten Hothorn Torsten.Hothorn at rzmail.uni-erlangen.de
Tue Sep 26 10:12:31 CEST 2000


Hi, 

this is maybe not a real R problem but I want to solve this in R ;-)

Consider the set of all permutations of 1:N (=: S, say) and a fixed
element a from S. I now need to compute the number of permutations s from
S which are elementwise less or equal to a: | { s \in S | s <= a } |

Of cource, backtracking using a tree structure is possible. Does anyone
know an efficient way?

Torsten

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list