The existence of a Hadamard matrix of size NxN

You are given an integer N with N <= 100. Is there a Hadamard matrix of size NxN such that:

  • Each matrix element is 1 or -1.
  • The sum of the products of the corresponding elements of any two rows is zero, i.e. for any a <= N and b <= NM [a] [1] * M [b] [1] + M [a] [2] * M [b] [2] ... M [a] [n ] * M [b] [n] = 0 (taking into account indexing based on 1).

What I've done:

I tried brute force solution. Each item can be 1 or -1. Thus, there can be at most 2 (n 2 ) matrices. I tried to check all these matrices, but the algorithm is too slow. O (n 2 * (2 (n 2 ) ). My computer did not show the output for n = 5, and I had to end the program.

Can anyone suggest a better way to solve this problem?

Edit: You need to not only answer Yes or No, but also list one such matrix. Obviously, when N is odd, the answer is impossible. N = 1 - a trivial case with the answer as 1 or -1.

+4
source share
1 answer

, . Wikipedia :

1, 2 4.

[...]

, 4k k

[...]

2008 13 4 2000, . [8] : 668, 716, 892, 1004, 1132, 1244, 1388, 1436, 1676, 1772, 1916, 1948 1964 .

N ≤ 100, , , , : N==1 || N==2 || (N%4)==0.

, , ​​. Read more Wikipedia , N = 2 k Payley N = q + 1, q = p k p q ≡ 3 (mod 4) (, N 4).

N ≤ 100 N, , N = 92. , Williamson hard-code .

, , , , . , , . N = 92, .

+1

Source: https://habr.com/ru/post/1606873/


All Articles