ShortestDistinctWindowLength
The least k such that no two windows of k consecutive entries are order isomorphic.
✓ checked against that system · ! checked, with disagreements (hover a chip)FindStat
St000923via Permutation✓ShortestDistinctWindowLength(p)The least k such that no two windows of k consecutive entries are order isomorphic.Typed signatures
| Type | Package | Applies |
|---|---|---|
(list<integer> | permutation) -> number | combinatorics | always |
Details
- Defined over
Permutationas an expression in_x, evaluated by compute-engine — the definition IS the implementation. - Takes a
Permutation, and also a bare list of integers: this reading compares entries with each other rather than with their positions, so it stands on any sequence. - The whole word is one window, so the least exists.
Definition
Epsil, as the implementation runs it.
on Permutation, over _x
0 if Length(_x) < 1 else Min(Filter(
Range(1, Length(_x)),
Function(Sum(Map(
Function(Count(Filter(
Filter(
Range(1, Length(_x)),
Function(t > s &&
t +
(k - 1) <=
Length(_x), t),
),
Function(Sum(Map(
Function(Count(Filter(
Filter(
Range(1, Length(_x)),
Function(b > a &&
b <= k, b),
),
Function((1 if _x[s +
(a - 1)] <
_x[s +
(b - 1)] else 0) !=
(1 if _x[t +
(a - 1)] <
_x[t +
(b - 1)] else 0), b),
)), a),
Filter(
Range(1, Length(_x)),
Function(a < k, a),
),
)) ==
0, t),
)), s),
Filter(
Range(
1,
Length(_x),
),
Function(s + (k -
1) <=
Length(_x), s),
),
)) == 0, k),
))Examples
Basic #
Properties #
About
| Examples | 6 |
|---|---|
| Crosswalk | FindStat |