Does the inverse of a unimodular matrix with entries in $\{-1,0,1\}$ again have entries in $\{-1,0,1\}$

discrete mathematicsinteger programminglinear algebralinear programmingmatrices

A matrix $U \in \mathbb Z^{n \times n}$ with integer entries is called unimodular if its determinant is $+1$ or $-1$. The inverse of a unimodular matrix is again unimodular, since its entries as calculated by Cramer's rule are integers divided by $+1$ or $-1$.

Question: If $U\in \mathbb Z^{n \times n}$ is a unimodular matrix that has only entries in $\{-1,0,1\}$, will its inverse $U^{-1}$ again have entries in $\{-1,0,1\}$?

Best Answer

The answer is "yes" if $U$ is nonsingular and totally unimodular, but in general, the answer is "no", as shown by the random counterexample below: $$ \pmatrix{1&0&0\\ 1&1&0\\ -1&1&1}^{-1}=\pmatrix{1&0&0\\ -1&1&0\\ 2&-1&1}. $$