Existence of the vector that decomposes the trace of diagonal and symmetric matrix

Question: Suppose that $\Lambda$ is an $N × N$ real-valued diagonal matrix and $Q$ is real symmetric. Suppose that $tr\ \Lambda \neq 0$ and $tr\ Q \neq 0$. Prove there is a vector $v \in \mathbb{R}^N$ such that $$v^T\Lambda v = tr\ \Lambda, v^TQv = tr\ Q$$

My thought:

Decompose the $\Lambda$ as $\Lambda = U^T\Lambda U, \ \forall\ U^TU = I$ and $Q = U^T\Lambda_1 U$.

So $$v^T\Lambda v = (Uv)^T\Lambda (Uv)= tr\ \Lambda$$ and $$v^TQ v = (Uv)^T\Lambda_1 (Uv) = tr \ Q = tr\ \Lambda_1$$ Intutively,the structure is same so they could preserve the same property. But how could I prove the $v$ in two formulas is the same one?

Could anyone help me out? Thank in advance!

• From $Q = U_q^T\Lambda_1 U_q$, (fix such $U_q$), and use it on $(U_qv)^T\Lambda (U_qv) = tr \Lambda$. – induction601 Dec 10 '17 at 0:58
• @induction601 Thanks for your comment! But I could not get your point. How do you know that the $v$ in two formulas is the same one? – stander Qiu Dec 10 '17 at 1:10
• I guess $U^TU = I$ not necessarily implies $\Lambda = U^T\Lambda U$. – Alex Ravsky Dec 12 '17 at 2:45
• @AlexRavsky Yep, you are right. Then the problem becomes exist $U_q$ such that $U_q^T\Lambda U_q = \Lambda$ and $Q= U_q^T\Lambda_1U_q$. Well, it seems more complexed. – stander Qiu Dec 12 '17 at 3:27
• I thing this is a wrong problem. I guess it is about a simultaneous diagonalization of two (symmetric) matrices and I recall that it (maybe ?) is possible iff these matrices commute. Whereas I expect that to answer the original question we need some simple calculations. – Alex Ravsky Dec 12 '17 at 3:53

The assumption that $\Lambda$ is diagonal is a premature simplification. We can just assume that $\Lambda$ is real symmetric. Also, by scaling $\Lambda$ and $Q$ if necessary, we may assume that both matrices have traces $1$. Thus we want to solve $v^T\Lambda v=v^TQv=1$ when $\Lambda$ and $Q$ are real symmetric matrices of traces $1$.
Let $D=\Lambda-Q$. By a change in orthonormal basis, we may assume that $D$ is a traceless diagonal matrix. Let $S\subset\mathbb R^N$ be the set of all vectors whose entries belong to $\{-1,1\}$. Then $\frac1{2^N}\sum_{v\in S}v^TQv=\operatorname{tr}Q>0$ and hence $v^TQv>0$ for some $v\in S$. Since $D$ is a traceless diagonal matrix, we also have $v^TDv=\operatorname{tr}D=0$.
Therefore $v^T\Lambda v=v^T(Q+D)v=v^TQv>0$. Now we can scale $v$ to make $v^T\Lambda v=v^TQv=1$.
• Thanks for your answer. How do you know that $\frac1{2^N}\sum_{v\in S}v^TQv=\operatorname{tr}Q$ ? – stander Qiu Dec 13 '17 at 0:55
• @standerQiu This is true in general for every square matrix $Q$, not only the symmetric ones. Just count the sums. Off-diagonal sums are zero because contributions from each pair of $v$s that differ by exactly one entry will cancel out each other. – user1551 Dec 13 '17 at 7:07