Skip to content

Nestings ​

SetPartition: pairs of arcs a < b < c < d with a~d and b~c. Permutation: pairs i, j with j < i < p(i) < p(j) or p(j) < p(i) <= i < j.

✓ checked against that system · ! checked, with disagreements (hover a chip)FindStatSt000041via PerfectMatching✓St000223via Permutation✓St000233via SetPartition✓
Nestings(p)SetPartition: pairs of arcs a < b < c < d with a~d and b~c. Permutation: pairs i, j with j < i < p(i) < p(j) or p(j) < p(i) <= i < j.
Typed signatures
TypePackageApplies
(permutation | set_partition) -> numbercombinatoricsalways

Domain: Set partition statistics

Details
  • Defined over SetPartition as an expression in _x, evaluated by compute-engine — the definition IS the implementation.
  • Takes a SetPartition and 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.
  • The complementary case to Crossings: one arc's span strictly contains the other's. Equidistributed with Crossings over set partitions of [n] (Kasraoui–Zeng), and the noncrossing and nonnesting partitions are each counted by the Catalan numbers.
  • Defined over Permutation as an expression in _x, evaluated by compute-engine — the definition IS the implementation.
  • Takes a Permutation and 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.
  • Nestings of the arcs of the permutation diagram.

Definition

Epsil, as the implementation runs it.

on Permutation, over _x

0 if Length(_x) < 1 else Sum(Map(Function(
                                           Count(Filter(
                                                         Range(1, Length(_x)),
                                                         Function(
                                                                   j < i && i <
                                                                            _x[i] &&
                                                                   _x[i] < _x[j] || _x[j] <
                                                                       _x[i] && _x[i] <=
                                                                           i && i <
                                                                               j,
                                                                   j,
                                                                 ),
                                                       )),
                                           i,
                                         ), Range(1, Length(_x))))

on SetPartition, over _x

0 if Length(Flatten(Map(Function(Most(b), b), _x))) < 2 else Sum(Map(
                                                                      Function(Count(Filter(
                                                                                             Range(
                                                                                                    i + 1,
                                                                                                    Length(Flatten(Map(Function(Most(b), b), _x))),
                                                                                                    1,
                                                                                                  ),
                                                                                             Function([Max(
                                                                                                            Flatten(Map(Function(Most(b), b), _x))[i],
                                                                                                            Flatten(Map(Function(Most(b), b), _x))[j],
                                                                                                          ) <
                                                                                                       (Flatten(Map(Function(Rest(b), b), _x))[i] if Flatten(Map(Function(Most(b), b), _x))[i] <
                                                                                                                                                     Flatten(Map(Function(Most(b), b), _x))[j] else Flatten(Map(Function(Rest(b), b), _x))[j]) &&
                                                                                                       (Flatten(Map(Function(Rest(b), b), _x))[i] if Flatten(Map(Function(Most(b), b), _x))[i] <
                                                                                                                                                     Flatten(Map(Function(Most(b), b), _x))[j] else Flatten(Map(Function(Rest(b), b), _x))[j]) <
                                                                                                       (Flatten(Map(Function(Rest(b), b), _x))[j] if Flatten(Map(Function(Most(b), b), _x))[i] <
                                                                                                                                                     Flatten(Map(Function(Most(b), b), _x))[j] else Flatten(Map(Function(Rest(b), b), _x))[i]), Max(
                                                                                                              Flatten(Map(Function(Most(b), b), _x))[i],
                                                                                                              Flatten(Map(Function(Most(b), b), _x))[j],
                                                                                                            ) <
                                                                                                         (Flatten(Map(Function(Rest(b), b), _x))[i] if Flatten(Map(Function(Most(b), b), _x))[i] <
                                                                                                                                                       Flatten(Map(Function(Most(b), b), _x))[j] else Flatten(Map(Function(Rest(b), b), _x))[j]) &&
                                                                                                         (Flatten(Map(Function(Rest(b), b), _x))[j] if Flatten(Map(Function(Most(b), b), _x))[i] <
                                                                                                                                                       Flatten(Map(Function(Most(b), b), _x))[j] else Flatten(Map(Function(Rest(b), b), _x))[i]) <
                                                                                                         (Flatten(Map(Function(Rest(b), b), _x))[i] if Flatten(Map(Function(Most(b), b), _x))[i] <
                                                                                                                                                       Flatten(Map(Function(Most(b), b), _x))[j] else Flatten(Map(Function(Rest(b), b), _x))[j])][2], j),
                                                                                           )), i),
                                                                      Range(
                                                                             1,
                                                                             Length(Flatten(Map(Function(Most(b), b), _x))),
                                                                             1,
                                                                           ),
                                                                    ))

Examples

Basic #

the partition {1,3}∣{2}\{1,3\} \mid \{2\}

live ↗
InNestings(SetPartition⁡([[1,3],[2]]))\mathrm{Nestings}({\operatorname{SetPartition}}([[1, 3], [2]]))Out00

the partition {1}∣{2,4}∣{3}\{1\} \mid \{2,4\} \mid \{3\}

live ↗
InNestings(SetPartition⁡([[1],[2,4],[3]]))\mathrm{Nestings}({\operatorname{SetPartition}}([[1], [2, 4], [3]]))Out00

the one-line word 312312

live ↗
InNestings(Permutation⁡([3,1,2]))\mathrm{Nestings}({\operatorname{Permutation}}([3, 1, 2]))Out00

the one-line word 24132413

live ↗
InNestings(Permutation⁡([2,4,1,3]))\mathrm{Nestings}({\operatorname{Permutation}}([2, 4, 1, 3]))Out00
Properties #

FindStat's value for {{1}}

live ↗
InCombinatorialStat(SetPartition⁡([[1]]),Nestings)\mathrm{CombinatorialStat}({\operatorname{SetPartition}}([[1]]), \text{Nestings})Out00

Known value · FindStat St000233

FindStat's value for {{1,2}}

live ↗
InCombinatorialStat(SetPartition⁡([[1,2]]),Nestings)\mathrm{CombinatorialStat}({\operatorname{SetPartition}}([[1, 2]]), \text{Nestings})Out00

Known value · FindStat St000233

FindStat's value for {{1,2,3}}

live ↗
InCombinatorialStat(SetPartition⁡([[1,2,3]]),Nestings)\mathrm{CombinatorialStat}({\operatorname{SetPartition}}([[1, 2, 3]]), \text{Nestings})Out00

Known value · FindStat St000233

FindStat's value for [1]

live ↗
InCombinatorialStat(Permutation⁡([1]),Nestings)\mathrm{CombinatorialStat}({\operatorname{Permutation}}([1]), \text{Nestings})Out00

Known value · FindStat St000223

FindStat's value for [1,2]

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

Known value · FindStat St000223

FindStat's value for [2,1]

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

Known value · FindStat St000223

About
Examples10
Checked againstSageMath 5 agree
CrosswalkFindStat ×3