inversionv {Tex4exams} | R Documentation |
Generating a vector of inversions for a permutation
Description
inversionv() returns the vector of inversions for each entry in the permutation. For example, inversionv(1,2,0) = (1,1,0), inversionv(0,1,2) = (0,0,0).
Usage
inversionv(x)
Arguments
x |
a list of numbers, or a permutation. |
Value
inversionv returns a vector of inversions for each member of the permutation.
See Also
Examples
inversionv(c(3,1,2,4))
[Package Tex4exams version 0.1.2 Index]