Skip to content

CombinatorialStat ​

A combinatorial statistic of a value, by name or FindStat id, found through the value's carrier.

CombinatorialStat(x, name)the statistic name (or FindStat id, "St000018") of x, a value of a carrier such as Permutation; over a collection, the statistic of each element, lazily, and "Count" the collection's size.
Typed signatures
TypePackageApplies
(any, any) -> anystructuresalways

Domain: Structures

Details
  • A carrier's statistics are too many, and too generically named, for a head each: they live in the carrier's table, and this is the way in. Packages add to a table, a fast kernel from one and the defining expression from another; the same part twice is an error.
  • The carrier is found from the value's type, as a protocol member finds its implementation, so a type a user declares can have statistics too.
  • Over a collection it is the statistic's distribution: Tally(CombinatorialStat(SymmetricGroup(4), "Inversions")) is the Mahonian numbers.
  • Where FindStat has the statistic, its id is another name for it. Several of our names can be one FindStat statistic.

Examples

Basic #

the inversions of 312

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

the same statistic, by its FindStat id

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

a statistic whose bare name is compute-engine's Sign

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

the distinct parts of 311

live ↗
InCombinatorialStat(IntegerPartition⁡([3,1,1]),DistinctParts)\mathrm{CombinatorialStat}({\operatorname{IntegerPartition}}([3, 1, 1]), \text{DistinctParts})Out22

a statistic of the collection itself

live ↗
InCombinatorialStat(SymmetricGroup(4),Count)\mathrm{CombinatorialStat}(\mathrm{SymmetricGroup}(4), \text{Count})Out2424
Applications #

inversions over the permutations of 4

live ↗
InTally(CombinatorialStat(SymmetricGroup(4),Inversions))\mathrm{Tally}(\mathrm{CombinatorialStat}(\mathrm{SymmetricGroup}(4), \text{Inversions}))OutTuple⁡([0,1,2,3,4,5,6],[1,3,5,6,5,3,1])\operatorname{Tuple}(\bigl\lbrack0, 1, 2, 3, 4, 5, 6\bigr\rbrack,\bigl\lbrack1, 3, 5, 6, 5, 3, 1\bigr\rbrack)
About
Examples6
Checked againstSageMath 2 agree

See also: CombinatorialMap, Count