InversionsOfCyclicEmbedding
The inversions of the cycle (p(1), ..., p(n), n + 1), as a permutation of n + 1.
✓ checked against that system · ! checked, with disagreements (hover a chip)FindStat
St001074via Permutation✓InversionsOfCyclicEmbedding(p)The inversions of the cycle (p(1), ..., p(n), n + 1), as a permutation of n + 1.Typed signatures
| Type | Package | Applies |
|---|---|---|
(permutation) -> number | combinatorics | always |
Details
- Defined over
Permutationas an expression in_x, evaluated by compute-engine — the definition IS the implementation. - Takes a
Permutationand nothing else — it reads values against their positions, or walks the orbits, so it needs the bijection. Applying it to a bare list is a type error, not a wrong answer.
Definition
Epsil, as the implementation runs it.
on Permutation, over _x
0 if Length(_x) < 1 else Apply(
(q: list<integer>) => Sum(Map(
Function(Count(Filter(
Range(i + 1, Length(_x) + 1),
Function(q[i] > q[j], j),
)), i),
Range(
1,
Length(_x),
),
)),
Map(Function(
_x[1] if v == Length(_x) + 1 else Sum(Map(Function(
(Length(_x) + 1 if m == Length(_x) else _x[m + 1]) if _x[m] == v else 0,
m,
), Range(1, Length(_x)))),
v,
), Range(1, Length(_x) + 1)),
)Examples
Properties #
About
| Examples | 5 |
|---|---|
| Crosswalk | FindStat |