Returns a row of the alternating sign matrix triangle.

You're viewing an older version of this page (#5347). View the current version.

View versions (2)

Interface

#include <codecogs/maths/combinatorics/sequences/asm_triangle_row.h>

using namespace Maths::Combinatorics::Sequences;

For a given n, the value of $A(j)$ represents entry $A(i, j)$ of the triangular matrix, and gives the number of alternating sign matrices of order n in which the (unique) 1 in row i occurs in column j.

For example, of alternating sign matrices of order 3, there are 2 with a leading 1 in column 1:

$$\left( \begin{array}{ccc} 1 & 0 & 0 \cr 0 & 1 & 0 \cr 0 & 0 & 1 \end{array} \right) \qquad \left( \begin{array}{ccc} 1 & 0 & 0 \cr 0 & 0 & 1 \cr 0 & 1 & 0 \end{array} \right)$$
(1)

3 with a leading 1 in column 2:

$$\left( \begin{array}{ccc} 0 & 1 & 0 \cr 1 & 0 & 0 \cr 0 & 0 & 1 \end{array} \right) \qquad \left( \begin{array}{ccc} 0 & 1 & 0 \cr 0 & 0 & 1 \cr 1 & 0 & 0 \end{array} \right) \qquad \left( \begin{array}{ccc} 0 & 1 & 0 \cr 1 & -1 & 1 \cr 0 & 1 & 0 \end{array} \right)$$
(2)

and 2 with a leading 1 in column 3:

$$\left( \begin{array}{ccc} 0 & 0 & 1 \cr 1 & 0 & 0 \cr 0 & 1 & 0 \end{array} \right) \qquad \left( \begin{array}{ccc} 0 & 0 & 1 \cr 0 & 1 & 0 \cr 1 & 0 & 0 \end{array} \right)$$
(3)

References

SUBSET, a C++ library of combinatorial routines, http://www.csit.fsu.edu/~burkardt/cpp_src/subset/subset.html

Example 1

#include <codecogs/maths/combinatorics/sequences/asm_triangle_row.h>
#include <iostream>
int main()
{
  std::vector<int> result = Maths::Combinatorics::Sequences::asm_triangle_row(4);
  std::cout << "Size of row: " << result.size() << std::endl;
  for (int j = 0; j < result.size(); j++)
    std::cout << result[j] << "  ";
  std::cout << std::endl;

  return 0;
}

Output:

Size of row: 5
42  105  135  105  42

Parameters

n
the order of the alternating sign matrices

Returns

the entries of the row
GPL Licence — free for non commercial use. See Licence details.