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
| Type | Package | Applies |
|---|---|---|
(any, any) -> any | structures | always |
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 #
About
| Examples | 6 |
|---|---|
| Checked against | SageMath 2 agree |
See also: CombinatorialMap, Count