[Math] Generate a matrix where entries are non-zero and determinant is non-zero

matricesnumerical linear algebranumerical methods

I'm thinking about this: generating a $n\times n$ square matrix, whose entries are all non-zero, and the determinant is significantly different from zero.

Suppose the matrix is $A$. I tried the following methods:

Let $A_{ij} = (i-1)n+j$. Well this is apparently wrong after $n$ is larger than 3. The determinants would become zero.

I then tried replacing $A_{ij}$ with $(A_{ij})^{1/2}$, but the determinant becomes a very small number.

As $n$ becomes very large, how can we still make sure the absolute value of determinant is not too small?

Best Answer

How about the matrix

$$A=\begin{bmatrix}2 & 1 & 1& \dots& 1 \\1& 2 & 1 &\dots& 1\\\vdots&\vdots&\vdots&\ddots&\vdots\\ 1&1&1&\dots&2\end{bmatrix}$$ i.e. $A=[1,\dots 1]\cdot[1\dots1]^T + I$?

The determinant of $A$ is, I think, $n+1$ (i.e., $1$ more than the size of $A$), so it actually becomes larger as $n$ increases.