I love combinatorics problems, but this one is really driving me mad.
Suppose we are given a rectangular $m \times n$ matrix of the form
$$\begin{pmatrix} a_1^1 & a_1^2 & \cdots & a_1^n \\ a_2^1 & a_2^2 & \cdots & a_2^n \\ \vdots& \vdots & \ddots & \vdots \\ a_m^1 & a_m^2 & \cdots & a_m^n \end{pmatrix}$$
where its elements $a_j^i$ can take values in the range $0, 1, \dots, k-1$. This generates $k^{m \cdot n}$ different matrices. The goal is to count the number of different configurations, being a configuration the group of matrices that can be generated by swap of any row or column.
For example, for a $2$ by $2$ matrix which elements can take the values $0,1$ yields $7$ possible configurations
1 -- $\begin{pmatrix} 0 & 0 \\ 0 & 0 \end{pmatrix}$
2 -- $\begin{pmatrix} 1 & 0 \\ 1 & 0 \end{pmatrix}$ $\begin{pmatrix} 0 & 1 \\ 0 & 1 \end{pmatrix}$
3 -- $\begin{pmatrix} 1 & 1 \\ 1 & 1 \end{pmatrix}$
4 -- $\begin{pmatrix} 1 & 0 \\ 0 & 0 \end{pmatrix}$ $\begin{pmatrix} 0 & 1 \\ 0 & 0 \end{pmatrix}$ $\begin{pmatrix} 0 & 0 \\ 1 & 0 \end{pmatrix}$ $\begin{pmatrix} 0 & 0 \\ 0 & 1 \end{pmatrix}$
5 -- $\begin{pmatrix} 0 & 1 \\ 1 & 1 \end{pmatrix}$ $\begin{pmatrix} 1 & 0 \\ 1 & 1 \end{pmatrix}$ $\begin{pmatrix} 1 & 1 \\ 0 & 1 \end{pmatrix}$ $\begin{pmatrix} 1 & 1 \\ 1 & 0 \end{pmatrix}$
6 -- $\begin{pmatrix} 0 & 0 \\ 1 & 1 \end{pmatrix}$ $\begin{pmatrix} 1 & 1 \\ 0 & 0 \end{pmatrix}$
7 -- $\begin{pmatrix} 1 & 0 \\ 0 & 1 \end{pmatrix}$ $\begin{pmatrix} 0 & 1 \\ 1 & 0 \end{pmatrix}$
Since my background is in physics, I got inspired in some geometric concepts from crystallography and Coxeter groups to face the problem, what I did was to view each row as the coordinate of a vertex of a polytope, that way any permutation or rows resulted in the same set of vertices, and a column permutation was a reflection of the vertex, so the number of columns $n$ would be the dimensionality of the space, the number of rows $m$ the maximum number of vertices of the polytope, and $k$ the size of the dimensions (or the cardinality of the dimensions of the resulting grid), even if it turn impossible to visualize for higher values. The previous matrices (using the same numeration) would look something like this
So it seemed to me that all I had to do was now just count the number of possible points in one side of the reflection, the number of lines that can be made in one side of the reflection, plus the ones that cross it not starting in the edge, and the possible polytopes with 1 to half of its vertices on the other side of the reflection.
So my count is the sum over all polytopes in one side of the reflection, plus the ones that have vertices in both sides, minus the number of lines from the edge of the reflection to the other side
$$\text{number of configurations} = \sum_{i=1}^m { (n-1) (k?) \choose i} + \sum_{i=1}^{\lceil m/2 \rceil} { (n-1) (k?) \choose m - i} \cdot { (n-1)[(k-1)?] \choose i} - m \cdot [(k-1)?] $$
This results in the 7 configurations like in the example, nice, but for the second example where we have matrices of 2 columns, 3 rows, and 4 possible values for its elements the result is 433 rather than the correct 430, possibly is just a coincidence that I'm so close, but it just makes it more intriguing to me.
I would appreciate some thoughts on this problem, am I in the right direction? Or missing the mark completely?
