For a non-integer rational base b, where b $\in$ (1,2), and the allowed expansion coefficients/symbols are $d_k$ $\in$ {-1,0,1}, it is known that b cannot be a root of the polynomial $\sum_{k=0}^n d_k x^k$. My question relates to how one can determine how "close" b can possibly come in terms of it being a solution to the equation $\sum_{k=0}^n d_k x^k = \epsilon$.
Given a finite terminating expansion in n terms, with known n, and known rational non-integer base b $\in$ (1,2), how can one "efficiently" find the coefficients $d_k$ that minimize the absolute value of $\epsilon$?
Furthermore, if b is not fixed, how can one efficiently find a non-integer rational b, assuming one exists in (1,2), that maximizes the value of this "minimum $d_k$" $\epsilon$ for a fixed n?
This may have practical importance in applications where finite terminating representations of numbers in base b are known to be unique in the purely mathematical sense, but should be chosen carefully in computer applications given practical limitations on machine precision.
Let $P(z) = \sum_{k=0}^n d_k z^k$ be of degree $n$ (so $d_n = \pm 1$). If $b = x/y$ (in lowest terms), we must have $|P(b)| \ge y^{-n}$. This is because $$ y^n P(b) = \sum_{k=0}^n d_k x^k y^{n-k} \equiv d_n x^n \not\equiv 0 \mod y$$ It is possible to have equality, e.g. for $b = 3/2$ with $P(z) = z^5 - z^4 - z - 1$ or $P(z) = {z}^{7}-{z}^{6}-{z}^{4}-{z}^{3}+{z}^{2}+z-1$.