2
$\begingroup$

Let $w$ denote an $mn$-bit word (i.e. a binary word of length $mn$). Assuming that $b_{i,j}$ denote individual bits, we can represent $w$ in the “rectangular” form as follows:

$$\begin{array}{l} b_{1.1}b_{1.2} \ldots b_{1.(m-1)}b_{1.m}\\ b_{2.1}b_{2.2} \ldots b_{2.(m-1)}b_{2.m}\\ \ldots\\ b_{(n-1).1}b_{(n-1).2} \ldots b_{(n-1).(m-1)}b_{(n-1).m}\\ b_{n.1}b_{n.2} \ldots b_{n.(m-1)}b_{n.m}. \end{array}$$

Then $$H_{i,m}(w) = b_{i.1}b_{i.2} \ldots b_{i.(m-1)}b_{i.m}$$ are $m$-bit horizontal subwords of $w$ (for $1 \leq i \leq n$) and $$V_{n,i}(w) = b_{1.i}b_{2.i} \ldots b_{(n-1).i}b_{n.i}.$$ are $n$-bit vertical subwords of $w$ (for $1 \leq i \leq m$).

Given a pair of arbitrary (see note 1 below) integers $(m, n),$ I am interested in an efficient algorithm that allows to construct an example of an $mn$-bit word $W$ that satisfies all of the following five properties:

  1. All $m$-bit horizontal subwords of $W$ are different from each other;
  2. All $n$-bit vertical subwords of $W$ are different from each other;
  3. Any $m$-bit horizontal subword of $W$ is different from any $n$-bit vertical subword of $W$, i.e. there does not exist an $m$-bit horizontal subword of $W$ that is equal to some $n$-bit vertical subword of $W$ (this property is automatically satisfied if $m \neq n$);
  4. The number of non-zero bits in any $m$-bit horizontal subword of $W$ is equal to $m/2$;
  5. The number of non-zero bits in any $n$-bit vertical subword of $W$ is equal to $n/2$.

Is it possible to solve this problem?

Note 1.
Obviously, both $m$ and $n$ must be even and such that $m \leq \binom{n}{n/2}, n \leq \binom{m}{m/2}.$ Maybe there are some other requirements for $(m, n).$ For example, if $m=8, n=8,$ does there exist a $64$-bit word $W_{64}$ satisfying the above conditions?

$\endgroup$
4
  • $\begingroup$ en.wikipedia.org/wiki/Block_design $\endgroup$ Commented Feb 9, 2023 at 5:05
  • 1
    $\begingroup$ You won't prove the non-existence of $W_{64}$. Constructed by hand: 1111000001011100001100111100100100001111001101011100011010101010 $\endgroup$ Commented Feb 9, 2023 at 8:27
  • $\begingroup$ @PeterTaylor: thank you. I wonder whether it is possible to estimate the number of such words in the set of all $k$-bit words... $\endgroup$ Commented Feb 9, 2023 at 8:53
  • $\begingroup$ @PeterTaylor: yes, if $m=8, n=8$, we have $\binom{8}{4}=70$ (the number of possible options for a horizontal/vertical $8$-bit subword), which is significantly greater than $m + n = 16$ (the number of all subwords, horizontal and vertical), so it would be reasonable to assume that $W_{64}$ exists. $\endgroup$ Commented Feb 11, 2023 at 6:28

1 Answer 1

2
$\begingroup$

This construction works for $n=m$ both powers of 2. Take an enumeration of the truth tables of the linear functions $$\{[\langle a,x\rangle: x \in GF(2)^k],a \in GF(2)^k\}.$$ This will have the weight property except for the fact that the first row and column will be all zeroes, for example, for $k=3,$ we get

enter image description here.

Call this matrix $A,$ and let $J$ be the all one matrix with the same dimensions. The blockmatrix $$ \left( \begin{array}{c|c} A+J & A \\ A & A+J \end{array} \right) $$ almost has the desired property with size $n=m=2^{k+1}.$ In this case we get

enter image description here

I have taken an $8\times 8$ seed matrix but one can take smaller ones or larger ones as needed.

The problem is the rows and columns match. To remove this, I have rotated the rows of the matrix to the right by one. Note that the original rows of matrix $A$ were the linear multivariate boolean functions, and shifting them by one yields nonlinear functions, so they are now distinct from the columns. The final outcome is below:

enter image description here

I used the magma calculator online available here. The code is below (without the cyclic rotation):

V:=VectorSpace(GF(2),3); L:=[v: v in V];

A:=Matrix([[InnerProduct(L[i+1],L[j]): j in [1..8]]: i in [0..7]]);A;

J:=Matrix([[1: i in [1..8]]: j in [1..8]]); C:=BlockMatrix(2,2,[A+J,A,A,A+J]); C;

function GetRowW(A,j,n) return Weight(VectorSpace(GF(2),n)![A[j,k]: k in [1..n]]); end function;

function GetColW(A,j,n) return Weight(VectorSpace(GF(2),n)![A[k,j]: k in [1..n]]); end function;

"row weights",{* GetRowW(C,j,16): j in [1..16] *};

"number of rows"; #{ [C[j,k]: k in [1..16]]: j in [1..16] };

"column weights",{* GetColW(C,j,16): j in [1..16] *};

"number of cols"; #{ [C[j,k]: j in [1..16]]: k in [1..16] };

$\endgroup$
2
  • $\begingroup$ In the given $16 \times 16$ matrix the $i$-th row (horizontal subword) is equal to the $i$-th column (vertical subword), which contradicts Property #3. $\endgroup$ Commented Feb 11, 2023 at 6:38
  • $\begingroup$ see my edit please $\endgroup$
    – kodlu
    Commented Feb 11, 2023 at 9:53

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .