Skip to content

AlternatingSignMatrices ​

The n×nn \times n alternating sign matrices — entries in {−1,0,1}\{-1, 0, 1\}, every row and column summing to 1 with alternating nonzero signs — as a lazy indexed family.

AlternatingSignMatrices(size)the ASMs of size size × size.
Typed signatures
TypePackageApplies
(integer<0..>) -> indexed_collection<list<list<integer>>>combinatoricsalways

Domain: Collections

Details
  • A lazy indexed collection; the count is the ASM number A(n)=∏j=0n−1(3j+1)!(n+j)!A(n) = \prod_{j=0}^{n-1} \frac{(3j+1)!}{(n+j)!} (the Robbins numbers, OEIS A005130) — A(4)=42A(4) = 42.
  • Each element is the matrix's rows; every row and column sums to 1, and every partial sum reading a row or column from its start lies in {0,1}\{0, 1\} — the alternating-sign condition.
  • The permutation matrices are exactly the ASMs with no −1-1 entry; A(n)≥n!A(n) \ge n! for every nn, with equality only at n≤2n \le 2.

Enumeration

Examples

1 more kept as data, checked against the oracles
Basic #

Count(AlternatingSignMatrices(4))=42Count(AlternatingSignMatrices(4)) = 42, the ASM numbers A005130

live ↗
InCount(AlternatingSignMatrices(4))\mathrm{Count}(\mathrm{AlternatingSignMatrices}(4))Out4242
About
Examples2
CrosswalkWikipediaMathWorldWikidataOEISSageMath

See also: Count, At