CycleCount
The number of cycles in the disjoint-cycle decomposition of
CycleCount(p)the cycle count of a one-line permutation Details
- Permutations of
with cycles are counted by the unsigned Stirling number of the first kind (see StirlingS1) - The identity is all fixed points, so it splits into
singleton cycles; an -cycle is a single cycle
Examples
Implementation
primitive · kernela kernel — an algorithm over mutable state that would not be readable as a tree
nativeengine
typescriptpackages/collections/src/stats.ts:cycleCountOrbit traversal with a visited set — the one statistic here that does not reduce to an expression.
See also: FixedPoints, StirlingS1, SymmetricGroup