The maximum number of distinct real roots of a polynomial whose coefficients are all $1$, $-1$ or $0$

polynomialsroots

What is the maximum number of distinct real roots of a polynomial whose coefficients are all $1$, $-1$ or $0$ ?

Experimentally, it seems the answer is $4$. (For example, $x^6-x^3-x^2+x$.)

I tried expressing the polynomial as $f(x)+g(x)$, where $f(x)$ has only even powers of $x$, and $g(x)$ has only odd powers of $x$, but I haven't been able to make this approach work.

Context: I've been exploring polynomials with integer coefficients, for example here and here.

Best Answer

Here is a slightly different way to show there is no maximum. We show that if $f(x)$ is a polynomial with coefficients $-1,0,1$ and $m>0$ distinct real roots $\alpha_i$ such that $|\alpha_i|\neq 0,1$, then $f(x^n)f(x)$ has the same properties for sufficiently large odd $n$, but it has at least one additional real root $|\alpha|\neq 0,1$. Repeating this process we can construct a polynomial of required properties with any number of distinct real roots.

First we show that $f(x^n)$ has at least one distinct real root from $f(x)$ (and so must their product). Note that if $\alpha$ is a root of $f(x)$, then $\alpha^{1/n}$ (it is real due to $n$ being odd) is a root of $f(x^n)$. If $f(x)$ has a real root $\alpha$ with $|\alpha|>1$, then pick the one with minimal absolute value, so $|\alpha^{1/n}|<|\alpha|$ and hence $\alpha^{1/n}$ cannot be root of $f$, yet it is a root of $f(x^n)$. Similarly if $f$ has only real roots with $0<|\alpha|<1$, pick one with maximal absolute value, then $|\alpha^{1/n}|>|\alpha|$ assures $\alpha^{1/n}$ is not a root of $f(x)$.

Next we show that for sufficiently large $n$, the $f(x^n)f(x)$ has indeed only $-1,0$ and $1$ coefficients. This follows from the fact that $f(x^n)$ has all the exponents spaced out arbitrarily apart for sufficiently large $n$, hence multiplying each term $a_ix^i$ of $f(x)$ we get a polynomial with $-1,0,1$ coefficients whose exponents are distinct for each of such product, hence sum of all these is a $-1,0,1$ polynomial, but this sum is just $f(x^n)f(x)$.

As an example consider $f(x)=x^2-x-1$ which has two real roots $\phi=\frac{1+\sqrt{5}}{2}, \psi=\frac{1-\sqrt{5}}{2}$. Notice that $$g(x)=f(x^3)f(x)=x^8-x^7-x^6-x^5+x^4+x^3-x^2+x+1.$$ By the above $g(x)$ must have at least three distinct real roots (in fact it has four). Now we could repeat the same process with $g(x)$, then for example $g(x^9)g(x)$ is a $-1,0,1$ coefficients polynomial with eight distinct real roots, and so on...

Note: The above process works the same way for polynomials with coefficients $0,1$, you can start for example with $f(x)=x^3+x+1$ and get $0,1$ polynomial with arbitrary many distinct real roots.

Note 2: As noticed in the follow up post, the above example with $f(x)=x^2-x-1$ in fact leads to polynomials with only $-1,1$ coefficients, so $0$ is not needed. However the above construction can start with $f(x)=x^3-x-1$ instead, then it would indeed produce $-1,0,1$ polynomials.