Matrix formation

241 Views Asked by At

Suppose we have to form a matrix as follows:

$4 \times 4$ matrix formed using only $1$ and $-1$ as elements such that sum of all elements in any row and column is $0$.

I wanted to know how many such matrices are possible?

As sum of all elements of each column and row is $0$ each row and column must contain exactly to two $1$'s and two $-1$'s. There are $6$ different ways to permute two $1$'s and two $-1$'s in a line. Thus if we start with the 1st row there are six ways to fill it. In the $6$ ways to fill $3$ start with $1$ and other $3$ with $-1$. Now if we want to fill the first column the first element is already decided due to the filling of 1st row. So there are $3$ ways to fill the first column.

I cannot go beyond this please give me some suggestions as to how I should proceed further.

1

There are 1 best solutions below

6
On

The first two rows are independent, so there are 36 ways to fill them. Similarly the last two rows. So the question is how many of the $36^2$ combinations of top half and bottom half are valid. If you cluster pairs of rows by the number of ones in each column they fall into 19 equivalence classes. Each equivalence class for the top half is compatible with one equivalence class for the bottom half.

We can further cluster the equivalence classes:

  • Permutations of $(0, 0, 2, 2)$: there are $\binom{4}{2}$ equivalence classes, each containing one pair, and they match up with another permutation of $(0, 0, 2, 2)$.
  • Permutations of $(0, 1, 1, 2)$: there are 12 equivalence classes, each containing two pairs (the 2 forces a +1 from both rows, but the 1s can be either way), and they match up with another $(0, 1, 1, 2)$.
  • $(1, 1, 1, 1)$: just the one equivalence class, containing $\binom{4}{2}$ pairs, and they match up with the same equivalence class.