6

Let $M_{n}$ be the set of $n \times n$ upper triangular (0,1) matrices with at least one $1$ in every column. $M_{n}$ includes the following matrices

$$ \left\{ \begin{bmatrix}1&1&1\\0&1&1\\0&0&1\end{bmatrix}, \quad \begin{bmatrix}1&0&1\\0&1&0\\0&0&0\end{bmatrix} \right\}$$

but does not include the following matrices

$$ \left\{ \begin{bmatrix}1&1&0\\0&1&0\\0&0&0\end{bmatrix}, \quad \begin{bmatrix}1&1&1\\0&1&1\\1&0&1\end{bmatrix}, \quad \begin{bmatrix}1&1&1\\0&1&1\\0&2&1\end{bmatrix} \right\}$$

Each column has i cells which can either be 0 or 1, which gives $2^i$ permutations for the $i$th column, but one of those is all 0s so there are $2^i-1$ valid permutations for the $i$th column. The total permutations is the product of the permutations for each column. Thus, this function counts the matrices in $M_{n}$

\begin{equation*} |M_{n}| = \prod_{i=1}^{n} \left( 2^{i} - 1 \right) \end{equation*}

Let $G_{n}$ be a subset $M_{n}$ which excludes matrices if they are equivalent to already included matrices under a permutation of rows. $G_{n}$ only includes one of the following matrices because they produce each other when rows 2 and 3 are swapped.

$$\left\{ \begin{bmatrix}1&1&1\\0&0&1\\0&0&0\end{bmatrix}, \quad \begin{bmatrix}1&1&1\\0&0&0\\0&0&1\end{bmatrix} \right\}$$

How many elements are in $G_{n}$? I think this can be calculated with burnsides lemma, but I can’t figure out how to do that.


Motivation

I'm working on an algorithm for randomly generating abstract strategy games and it depends on a count of fully-connected directed acyclic graphs with a single source and $n$ nodes. They correspond with the matrices in $M_{n}$ if one ignores isomorphisms, but I only want to count isomorphic subsets of $M_{n}$ once, so I need to pair $M_{n}$ down to $G_{n}$.

The matrices in $M_{n}$ are adjacency matrices without the left column and bottom row. The adjacency matrices have $0$ diagonals, which I thought was an unnecessary complication, so I removed them for the question.

scarf
  • 63
  • 4
  • 1
    Thanks for adding the motivation! I guessed there was a directed graph hiding somewhere. My quick try at reverse-engineering it to a graph question didn’t give me any insight, unfortunately. – Steve Kass Feb 17 '25 at 00:28

1 Answers1

1

[Edited: I misread your question in the first version of this answer and thought each row of the matrix had to be distinct.]

First, let's represent your matrices as tuples of integers, by reading the rows from bottom to top as integers base 2. In other words,

$\begin{bmatrix}1&0&1\\0&0&1\\0&0&0\end{bmatrix} \to (0,1,5)$,$\quad$ $\begin{bmatrix}1&1&1\\0&0&1\\0&0&0\end{bmatrix}$ $ \to (0,1,7)$, $\quad$ and $\quad$ $\begin{bmatrix}1&1&1\\0&0&0\\0&0&1\end{bmatrix}\to (1,0,7)$.

An $n$-tuple $t$ represents an upper-triangular matrix if its $i$-th component is less than $2^i$ for $i\le n$, and it represents a matrix of $M_n$ if there is no $j<n$ for which the $j$-th base two digit (counting from the right and starting at zero) of every component of $t$ is zero.

Finally, two matrices in the same equivalence classes of $M_n$ under row exchange are represented by tuples that are permutations of each other, so the equivalence classes can be identified by a canonical $t\in G_n$ with non-decreasing components.

I enumerated these tuples with Mathematica (code below) for $n=1\dots5$, and the sequence $|G_n|$ began $1,3,19,237,5709,\dots$. This sequence doesn't appear in OEIS.

Using less brute force generating tuples for $M_n$, and I was able to find one more term: $|G_6|=265655$

I hope this helps.

Inefficient code:

mSubsets[n_, m_] :=
  Sort[Join @@ (Sort /@ IntegerPartitions[#, {m}, Range[n]] & /@ Range[m, n m])]

fQ[t_, 1] := t[[1]] < 2 fQ[t_, n_ : Integer] := t[[n]] < 2^n && fQ[t, n - 1] Table[Length[ Select[mSubsets[2^n,n] - 1, fQ[#, n] && Min[Plus @@ IntegerDigits[#, 2, n]] > 0 &]], {n, 1, 5}]

More efficient code:

nis[1] := {{0}, {1}}
nmax = 6;
For[k = 2, k <= nmax, k++, 
 nis[k] = 
  Join @@ Map[
    MapThread[
      Join, {ConstantArray[#, 2^k - #[[-1]]], 
       Table[{i}, {i, #[[-1]], 2^k - 1}]}] &, nis[k - 1]]]
Table[Length[Select[nis[k], BitOr @@ # == 2^k - 1  &]], {k, 1, nmax}]

Output: {1, 3, 19, 237, 5709, 265655}

Steve Kass
  • 15,314
  • 1
    I think you made a mistake. counting them by hand, the sequence should start 1,3,19. also, I'm confused why you assert the components of t must be distinct. the tuple (1,1,7) represents a matrix within M_3 despite not have distinct components. – scarf Feb 16 '25 at 19:55
  • You're right. For some reason I thought you said the matrix couldn't have any duplicate rows. I'll fix that and rerun the code. – Steve Kass Feb 17 '25 at 00:09
  • I've edited my answer with the correction. The sequence now begins 1, 3, 19, 237, 5709, which is still not in OEIS. – Steve Kass Feb 17 '25 at 00:22
  • thankyou Steve Kass – scarf Feb 17 '25 at 00:33
  • I got one more term. That looks to be all my Rasberry Pi 500 is going to get. – Steve Kass Feb 17 '25 at 02:53