6

Background

While studying two-level full factorial designs and Hadamard matrices, I've noticed several commonalities between these mathematical structures. In particular, both involve matrices with elements of $\pm 1$ and share properties related to column orthogonality.

I've also found extensive research on this topic, including a comprehensive doctoral thesis investigating two-level factorial design experiments. In this thesis, the word Hadamard is repeated 43 times. Furthermore, the Matlab function ff2n for two-level full factorial designs also linked to Hadamard matrix at the bottom.

Question

What is the precise mathematical relationship between two-level full factorial designs and Hadamard matrices? Specifically:

  1. Can we construct one from another ?

  2. How does the orthogonality property manifest differently in each context?

Any insights or references to relevant literature would be greatly appreciated.

1 Answers1

1

Disclaimer: this below may be wrong as I know nothing about design matrices, but is mainly an explanation of how I interpret the first linked website and the Matlab page on full factorial designs. Edit: fixed small mistake noticed by Will Orrick

First, a Hadamard matrix is defined as any square matrix $M\in \{-1,1\}^{n\times n}$ in which every two columns are pairwise orthogonal (meaning $a\cdot b=0$ for any two distinct columns $a,b$). These matrices have many interesting properties, in particular their determinant is as large as it can be (the inequality from Hadamard's inequality holds with equality). Existence of Hadamard matrices for arbitrary $n$ is an interesting and well-studied problem, but for now we only need to know that there are particularly nice constructions of Hadamard matrices if $n$ is a power of 2.

There seem to be two similar definitions of two-level full factorial design matrix. The easiest way to define it is probably just as a $2^k\times k$ matrix of $0$'s and $1$'s which just lists the numbers from $0$ to $2^k-1$ in binary: $$ M=\begin{bmatrix}0 & 0 & 0\\ 0 & 0 & 1\\ 0 & 1 & 0\\ 0 & 1 & 1\\ 1 & 0 & 0\\ 1 & 0 & 1\\ 1 & 1 & 0\\ 1 & 1 & 1\\ \end{bmatrix} $$ Note: this is what Matlab does. I am not sure if the order of columns and rows matters for naming or the application, but it does not matter for this post.

Another way of writing a two-level full factorial design matrix is to use $1$ and $-1$ instead of $1$ and $0$: $M'=2M-J$ where $J$ is the all ones matrix.

Name the columns of $M'$ as $m_1,m_2,\ldots, m_k$. Every column of the model matrix/analysis matrix then consists of the elementwise product of some subset of $\{m_1,m_2,\ldots, m_k\}$ (I am not sure if it necessarily contains all subsets). For the empty subset we just write a column of ones.

Since there are $2^k$ possible subsets of $\{m_1,m_2,\ldots, m_k\}$, the result is a $2^k\times 2^k$ matrix of $-1$'s and $1$'s. An example for $k=2$: $$ D=\begin{bmatrix} \emptyset & m_1 & m_2 & m_1*m_2\\\hline 1 & -1 & -1 & 1\\ 1 & -1 & 1 & -1\\ 1 & 1 & -1 & -1\\ 1 & 1 & 1 & 1 \end{bmatrix} $$ We can prove that the matrix $D$ is always a Hadamard matrix. Take any two columns of $D$ corresponding to distinct subsets $S,T\subseteq \{m_1,m_2,\ldots, m_k\}$. Call these columns $m_S$ and $m_T$. We have $$m_S\cdot m_T=\sum_{i=1}^{2^k}(m_S)_i(m_T)_i=\sum_{i=1}^{2^k}(m_{S\Delta T})_i=0$$ Here $S\Delta T$ is the symmetric difference. The symmetric difference is nonempty, and $(m_{S\Delta T})_i=1\Leftrightarrow (m_{S\Delta T})_{i+2^{k-u}}=-1$ for any $m_{u}\in S\Delta T$ and $i\leq 2^k-2^{k-u}$. It follows from this that exactly half of the elements of $m_{S\Delta T}$ are equal to $1$ (as we can make a bijection between $1$'s and $-1$'s), and therefore $\sum_{i=1}^{2^k}(m_{S\Delta T})_i=0$.

I hope this helps, and I would also recommend looking at original sources about design matrices (I could not get much wiser from the thesis that was linked, as it does not properly introduce the subjects it discusses).

  • @WillOrrick Yes that was a typo, well spotted – Matthew Spam Mar 17 '25 at 14:22
  • I think the "particularly nice" Hadamard matrix construction you refer to when $n$ is a power of $2$ is called "Sylvester's construction". Your matrix $D$ is not the matrix given by Sylvester's construction, but I believe is equivalent to it under row and column permutations. For powers of $2$ less than or equal to $2^3$, this is the only Hadamard matrix, up to equivalence, but for larger powers of $2$ there are many, may Hadamard matrices, most of which don't have any particularly regular structure. – Will Orrick Mar 17 '25 at 14:36
  • You mention this, but it is worth emphasizing that there are Hadamard matrices for many multiples of $4$ that are not powers of $2$. (It is an unsolved problem whether there is such a construction for every multiple of $4$.) The constructions when $n$ is an odd multiple of $4$ tend to be quite different from Sylvester's construction, and I don't see any obvious connection in this case with two-level full factorial designs. (Again, you imply this, but it bears repeating.) – Will Orrick Mar 17 '25 at 14:41
  • Thank you I have already upvote your answer, I think this problem does not receive much attention in the mathematical community because design matrix belong to design of experiment - a field related to manufacture and not mathematical. The bounty is running out so I have to award to the only answer. I hope that other can still contribute to this post so that we can all learn more. Thank you everyone – Tuong Nguyen Minh Mar 18 '25 at 12:08
  • @MatthewSpam can you explain a bit about the symmetric difference part. As an engineer I never heard of this term before ! – Tuong Nguyen Minh Mar 18 '25 at 12:16
  • 1
    With two tweaks, the construction of $D$ can be made to match the result of Sylvester's construction: (1) instead of sending $0$ to $-1$ and $1$ to $1$, send $0$ to $1$ and $1$ to $-1$; (2) associate each subset of ${1,2,\ldots,k}$ with a $k$-digit binary string so that the $j$th digit being $1$/$0$ indicates presence/absence of $j$ in the subset; order the columns according to the value of this string, interpreted as a binary number. This is equivalent to the "Alternative construction" in the Wikipedia article on Hadamard matrices. – Will Orrick Mar 18 '25 at 17:26
  • 1
    The symmetric difference is an operation on sets. The difference of two sets, $A\setminus B$, is the set of elements in $A$ but not in $B$. The symmetric difference $A\Delta B$ is $(A\setminus B)\cup(B\setminus A)$. In other words, it's the set of elements in exactly one of $A$ and $B$. If the universe consists of $k$ elements, we can represent sets by $k$ bit binary numbers in which a $0$ in the $j$th bit means $j$ is not in the set and a $1$ in that bit means $j$ is in the set. The symmetric difference then corresponds to the exclusive or of the associated words. – Will Orrick Mar 19 '25 at 02:32
  • Oh so what does Mathew wants when he said the symmetric difference is non empty – Tuong Nguyen Minh Mar 20 '25 at 11:03
  • 1
    Since he has taken the subsets to be distinct there is at least one element that is one of them but not the other. – Will Orrick Mar 20 '25 at 12:46
  • 1
    One thing I should have said earlier is that the claim "$(m_{U})i=1\Leftrightarrow (m{U}){2^k+1-i}=-1$ for any nonempty $U$" is only true of sets $U$ that have an odd number of elements. The conclusion "$\sum{i=1}^{2^k}(m_{S\Delta T})_i=0$" is still true, but needs to be supported by a different argument. One way to show it is to observe that, with the first tweak I suggested earlier, and with rows and columns labeled by vectors of 0s and 1s, the matrix element with row label $r$ and column label $c$ is $(-1)^{r\cdot c}$. It is then not hard to see why columns sum to 0 for $c$ not all 0s. – Will Orrick Mar 22 '25 at 12:18
  • @WillOrrick Thanks for noticing, I fixed it – Matthew Spam Mar 24 '25 at 11:25
  • Thank you so much this is so deep, I dont even know why people go this far for this ! – Tuong Nguyen Minh Mar 24 '25 at 13:31