Skip to content

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)FindStatSt000923via Permutation✓
ShortestDistinctWindowLength(p)The least k such that no two windows of k consecutive entries are order isomorphic.
Typed signatures
TypePackageApplies
(list<integer> | permutation) -> numbercombinatoricsalways

Domain: Permutation statistics

Details
  • Defined over Permutation as 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 #

the one-line word 312312

live ↗
InShortestDistinctWindowLength(Permutation⁡([3,1,2]))\mathrm{ShortestDistinctWindowLength}({\operatorname{Permutation}}([3, 1, 2]))Out22

the one-line word 312312, as a plain list

live ↗
InShortestDistinctWindowLength([3,1,2])\mathrm{ShortestDistinctWindowLength}(\bigl\lbrack3, 1, 2\bigr\rbrack)Out22

the one-line word 24132413

live ↗
InShortestDistinctWindowLength(Permutation⁡([2,4,1,3]))\mathrm{ShortestDistinctWindowLength}({\operatorname{Permutation}}([2, 4, 1, 3]))Out33
Properties #

FindStat's value for [1,2]

live ↗
InCombinatorialStat(Permutation⁡([1,2]),ShortestDistinctWindowLength)\mathrm{CombinatorialStat}({\operatorname{Permutation}}([1, 2]), \text{ShortestDistinctWindowLength})Out22

Known value · FindStat St000923

FindStat's value for [2,1]

live ↗
InCombinatorialStat(Permutation⁡([2,1]),ShortestDistinctWindowLength)\mathrm{CombinatorialStat}({\operatorname{Permutation}}([2, 1]), \text{ShortestDistinctWindowLength})Out22

Known value · FindStat St000923

FindStat's value for [1,2,3]

live ↗
InCombinatorialStat(Permutation⁡([1,2,3]),ShortestDistinctWindowLength)\mathrm{CombinatorialStat}({\operatorname{Permutation}}([1, 2, 3]), \text{ShortestDistinctWindowLength})Out33

Known value · FindStat St000923

About
Examples6
CrosswalkFindStat