number of **distinct** real roots of $f(x)=0$? Let $a$ be a non zero real number. Define 
$$f(x) = \begin{vmatrix}
        x & a & a & a\\
        a & x & a & a\\
        a & a & x & a\\
        a & a & a & x\\
        \end{vmatrix}$$ for $x \in \mathbb R$
Then, the number of distinct real roots of $f(x)=0$ is :
$(A)~~ 1~~  (B)~~  2 ~~ (C)~~  3 ~~ (D~~ ) 4$
Attempt:
The matrix $A = \begin{pmatrix}
        0 & a & a & a\\
        a & 0 & a & a\\
        a & a & 0 & a\\
        a & a & a & 0\\
        \end{pmatrix}$  is a real and symmetric matrix. Hence, it's diagonalisable and there exists $4$ real roots to equation $\det [A - x I]=0$.
Hence, $f(x) = \begin{vmatrix}
        x & a & a & a\\
        a & x & a & a\\
        a & a & x & a\\
        a & a & a & x\\
        \end{vmatrix}=0$ has $4$ real roots.
But, how do I find out the number of distinct real roots. Is there a method other than finding the determinant of this matrix and finding out the roots?
Thank you for your help.
 A: The eigenspace for $x = a$ has the dimension of the nullspace of the matrix consisting of all $a$s. Some example vectors in that space are $(1, -1, 0,  0)$, $(1, 0, -1, 0)$ and $(1, 0, 0, -1)$. So $a$ is an eigenvalue of multiplicity at least 3. Since $-3a$ is also an eigenvalue (eigenvector $(1,1,1,1)$), your answer is:


*

*Two roots if $a \ne 0$: a, a, a, 3a

*One root if $a = 0$: 0, 0, 0, 0. 
There might be a sign error in this analysis...I think that the matrix you wrote in $f(x) = 0$ exactly when $x$ is the negative of an eigenvalue of $A$, but that's OK.  
A: Consider the matrix 
$$A = \begin{pmatrix}
        0 & -a & -a & -a\\
        -a & 0 & -a & -a\\
        -a & -a & 0 & -a\\
        -a & -a & -a & 0\\
        \end{pmatrix}$$
Then $f(x)$ is exactly the characteristic polynomial of your matrix.
Now, $aI-A$ has rank $1$, which means that the dimension of the corresponding eigenspace (aka the geometric multiplicity) of the eigenvalue $\lambda=a$ is $3$. This implies that the (algebraic) multiplicity of $\lambda=a$ is at least $3$.
The fourth root/eigenvalue can be found from
$$a+a+a+\lambda_4=tr(A)=0$$
Since $a \neq 0$ there are 2 distinct values.
A: It's not necessary to compute $f(x)$ explicitly if you are familiar with random walks in a finite system.
The change of variables $x=au$ makes it clear that the answer is the same for any nonzero $a$.  In this case, it's convenient to let $a=1/3$.  Doing so allows us to interpret the matrix $A$ as a transition matrix among $4$ states, where at each step each state goes to any other state (except itself) with equal probability.
The dominant eigenstate, with eigenvalue $1$ (corresponding to $x=-1$), is the state of equal probability, $({1\over4},{1\over4},{1\over4},{1\over4})$ (written in row form, for convenience).  We can compute the three non-dominant eigenstates as well (and I'll do so in the next paragraph), but it's really not necessary:  Because the system is invariant under permutations of the states, these three eigenstates must permute amongst themselves, hence they must have the same eigenvalue.  So there are just $2$ distinct eigenvalues in all.
To flesh things out, the other eigenvalue must be $-1/3$, since the trace of the matrix $A$ is $0$, and the eigenstates are $(1,1,-1,-1)$, $(1,-1,1,-1)$, and $(1,-1,-1,1)$.
A: Either you work out the determinant, or you diagonalize $A$ to find the eigenvalues (read: roots of $\det(A-xI)=0$).
I would prefer to diagonalize.
