Skip to content

Crossings ​

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

✓ checked against that system · ! checked, with disagreements (hover a chip)FindStatSt000042via PerfectMatching✓St000039via Permutation✓St000232via SetPartition✓
Crossings(p)SetPartition: pairs of arcs a < b < c < d with a~c and b~d. Permutation: pairs i, j with i < j <= p(i) < p(j) or p(i) < p(j) < 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.
  • Read off the standard arc representation: within each block, consecutive elements are linked, and a crossing is two arcs whose spans interleave rather than nest or sit apart.
  • 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.
  • Crossings of the arcs of the permutation diagram (Corteel).

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(i < j && j <=
                                                                          _x[i] && _x[i] <
                                                                              _x[j] ||
                                                                 _x[i] < _x[j] &&
                                                                 _x[j] < 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])][1], 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 ↗
InCrossings(SetPartition⁡([[1,3],[2]]))\mathrm{Crossings}({\operatorname{SetPartition}}([[1, 3], [2]]))Out00

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

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

the one-line word 312312

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

the one-line word 24132413

live ↗
InCrossings(Permutation⁡([2,4,1,3]))\mathrm{Crossings}({\operatorname{Permutation}}([2, 4, 1, 3]))Out11
Properties #

FindStat's value for {{1}}

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

Known value · FindStat St000232

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

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

Known value · FindStat St000232

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

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

Known value · FindStat St000232

FindStat's value for [1]

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

Known value · FindStat St000039

FindStat's value for [1,2]

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

Known value · FindStat St000039

FindStat's value for [2,1]

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

Known value · FindStat St000039

About
Examples10
Checked againstSageMath 5 agree
CrosswalkFindStat ×3