Compute the rank of an orthgonal projection efficiently

107 Views Asked by At

Question. Someone hands you an $n\times n$ matrix and tells you that it is an orthogonal projection. Describe how to compute the rank of this matrix using at most $n$ operations of addition, multiplication, and division of scalars.

This question looks tricky, as elementary row/column operations are not welcomed here.

I found one solution that uses $n-1$ additions: Let $P\in M_n(\mathbb{C})$ be an orthogonal projection. Suppose that $\operatorname{rank}(P)=r$. Then the characteristic polynomial of $P$ is \begin{align*} \chi_p(t)=t^{n-r}(t-1)^r&=t^{n-r}\sum_{i=0}^{r}{\binom{r}{i}(-1)^it^{r-i}} \\ &=\sum_{i=0}^{r}{(-1)^i\binom{r}{i}t^{n-i}} \\ &=t^n-rt^{n-1}+\binom{r}{2}t^{n-2}+\cdots. \end{align*} Therefore, $\operatorname{tr}(P)=r$. Just compute the trace of $P$ and we are done. This also answers one question in this post with a stronger result.

As I did not found similar questions (maybe I am not good at using Approach Zero), I just want to share the Q & A here seeking for corrections and more alternative smart solutions.

Update. @Kabenyuk has provided an extremely simple argument in the comment. I also came up with a different one: Let $X$ be an $n\times r$ matrix whose columns form an orthonormal basis of the column space of $P$. Then we have $$P=XX^*.$$ Thus $$\operatorname{tr}(P)= \operatorname{tr} (XX^*)= \operatorname{tr} (X^*X)= \operatorname{tr} (I_r)=r.$$ So far we have three different proofs for this result!!! Nevertheless, regarding the original question, I still want to hear from your smart brains