Find symmetric matrix containing no 0's, given eigenvalues

I'm preparing for a final by going through the sample exam, and have been stuck on this:

$$Produce\ symmetric\ matrix\ A ∈ R^{3×3},\ containing\ no\ zeros.\ \\ A\ has\ eigenvalues\ λ_1 = 1,\ λ_2 = 2,\ λ_3 = 3$$

I know $A = S^{-1}DS$, where A is similar to the diagonal matrix D, and S is orthogonal.
The diagonal entries of D are the eigenvalues of A.

I also know that A & D will have the same determinant, eigenvalues, characteristic polynomial, trace, rank, nullity, etc. I am not sure where to go from here though. How cna A be found with only the two pieces of information? It seems like too little information is given...

• It isn't claimed that A be unique. I suppose any A that satisfies the given conditions will do. – Stefan Böttner Jul 5 '18 at 13:47
• Thanks for the answers everyone! I guess I was overthinking a little and should've just tried a few to see what happened. I appreciate all the guidance :) – Reccho Jul 5 '18 at 14:31

You are correct in observing that "too little" information is given in the sense that there are infinitely many such matrices. But you need to produce just one. So start with the diagonal matrix $D = \operatorname{diag}(1,2,3)$ and conjugate it by a simple (but not too simple) orthogonal matrix $S$. You don't want $S$ to be a block matrix because then $S^{-1} D S$ will also be a block matrix and so will have zeroes. For example, we can take

$$S = \begin{pmatrix} \frac{1}{\sqrt{3}} & \frac{1}{\sqrt{3}} & \frac{1}{\sqrt{3}} \\ \frac{1}{\sqrt{6}} & \frac{1}{\sqrt{6}} & -\frac{2}{\sqrt{6}} \\ -\frac{1}{\sqrt{2}} & \frac{1}{\sqrt{2}} & 0 \end{pmatrix}, S^{-1} = S^T = \begin{pmatrix} \frac{1}{\sqrt{3}} & \frac{1}{\sqrt{6}} & -\frac{1}{\sqrt{2}} \\ \frac{1}{\sqrt{3}} & \frac{1}{\sqrt{6}} & \frac{1}{\sqrt{2}} \\ \frac{1}{\sqrt{3}} & -\frac{2}{\sqrt{6}} & 0\end{pmatrix}$$

and define

$$A = S^{-1} D S = \begin{pmatrix} \frac{1}{\sqrt{3}} & \frac{1}{\sqrt{6}} & -\frac{1}{\sqrt{2}} \\ \frac{1}{\sqrt{3}} & \frac{1}{\sqrt{6}} & \frac{1}{\sqrt{2}} \\ \frac{1}{\sqrt{3}} & -\frac{2}{\sqrt{6}} & 0\end{pmatrix} \begin{pmatrix} 1 & 0 & 0 \\ 0 & 2 & 0 \\ 0 & 0 & 3 \end{pmatrix} \begin{pmatrix} \frac{1}{\sqrt{3}} & \frac{1}{\sqrt{3}} & \frac{1}{\sqrt{3}} \\ \frac{1}{\sqrt{6}} & \frac{1}{\sqrt{6}} & -\frac{2}{\sqrt{6}} \\ -\frac{1}{\sqrt{2}} & \frac{1}{\sqrt{2}} & 0 \end{pmatrix} = \begin{pmatrix} \frac{1}{\sqrt{3}} & \frac{1}{\sqrt{6}} & -\frac{1}{\sqrt{2}} \\ \frac{1}{\sqrt{3}} & \frac{1}{\sqrt{6}} & \frac{1}{\sqrt{2}} \\ \frac{1}{\sqrt{3}} & -\frac{2}{\sqrt{6}} & 0\end{pmatrix} \begin{pmatrix} \frac{1}{\sqrt{3}} & \frac{1}{\sqrt{3}} & \frac{1}{\sqrt{3}} \\ \frac{2}{\sqrt{6}} & \frac{2}{\sqrt{6}} & -\frac{4}{\sqrt{6}} \\ -\frac{3}{\sqrt{2}} & \frac{3}{\sqrt{2}} & 0 \end{pmatrix} \\ = \begin{pmatrix} \frac{1}{3} + \frac{2}{6} + \frac{3}{2} & \frac{1}{3} + \frac{2}{6} - \frac{3}{2} & \frac{1}{3} - \frac{4}{6} \\ \frac{1}{3} + \frac{2}{6} - \frac{3}{2} & \frac{1}{3} + \frac{2}{6} + \frac{3}{2} & \frac{1}{3} - \frac{4}{6} \\ \frac{1}{3} - \frac{4}{6} & \frac{1}{3} - \frac{4}{6} & \frac{1}{3} + \frac{8}{6} \end{pmatrix} = \begin{pmatrix} \frac{13}{6} & -\frac{5}{6} & -\frac{1}{3} \\ -\frac{5}{6} & \frac{13}{6} & -\frac{1}{3} \\ -\frac{1}{3} & -\frac{1}{3} & \frac{5}{3} \end{pmatrix}.$$

Then $A$ is symmetric and has eigenvalues $1,2,3$ (because it is similar to $D$).

• Thank you for this! – Reccho Jul 5 '18 at 16:20

Indeed too litle information is given and such a matrix is not unique. I tried two run of the mill Orthogonal matrix, and it gave acceptable results.

The test didn't required you to find the unique matrix A satisfying these conditions.

Have a nice day :-)

• May I ask what a "run of the mill" orthogonal matrix looks like? – Reccho Jul 5 '18 at 15:51
• Like a Gram-Schmidt orthonormalisation of three random vectors ;-) The forbidden set is of (lebesgue) mesure 0, so it should not give you any trouble. If you are as lazy as I am, take only two vectors, orthonormalize them and use the vectorial product. It gives you an element of SO(3,R). – Benoit Gaudeul Jul 6 '18 at 12:24

Spectral theorem states that if $A\in\mathbb{R}^{3\times 3}$ and is symmetric then $$A=QDQ^T$$ where $D=\text{diag}(\lambda_1,\dots,\lambda_n)$ and the columns of $Q$ are the corresponding (normalized) eigenvectors.

You're going backwards and what you need is $Q$. Given an orthonormal base of $\mathbb{R}^3$, i.e. $(\mathbf{u_1},\mathbf{u_2},\mathbf{u_3})$, then $$Q=[\mathbf{u_1}\quad\mathbf{u_2}\quad\mathbf{u_3}]$$

Now you just need to find one such that $A$ contains no zeros.