 Error, (in evalf/RootOf) there are ambiguous values encoded in RootOf(_Z^2-2, 0) - Maple Help

Home : Support : Online Help : Error, (in evalf/RootOf) there are ambiguous values encoded in RootOf(_Z^2-2, 0)

Error, (in evalf/RootOf) there are ambiguous values encoded in RootOf(...)

Error, (in convert/RootOf) there is ambiguity in RootOf(...) Description The error occurs when evalf or convert are passed expressions that have ambiguity in regards to specification of roots. Examples

Example 1

The numerical approximation of used as a root selector is not helpful in distinguishing between the two roots, since both roots are a distance of exactly from $\frac{1}{2}.$

 > $e≔\mathrm{RootOf}\left({x}^{2}-x-1,\frac{1}{2}\right)$
 ${e}{:=}{\mathrm{RootOf}}{}\left({{\mathrm{_Z}}}^{{2}}{-}{\mathrm{_Z}}{-}{1}{,}\frac{{1}}{{2}}\right)$ (2.1)
 > $\mathrm{evalf}\left(e\right)$

Solution

Use a different value as the root selector:

 >
 ${e}{≔}{\mathrm{RootOf}}{}\left({{\mathrm{_Z}}}^{{2}}{-}{\mathrm{_Z}}{-}{1}{,}\frac{{3}}{{2}}\right)$ (2.2)
 >
 ${1.618033989}$ (2.3)

Example 2

 > ${r}_{1}≔\mathrm{RootOf}\left({\mathrm{_Z}}^{2}-2,0\right)$
 ${{r}}_{{1}}{:=}{\mathrm{RootOf}}{}\left({{\mathrm{_Z}}}^{{2}}{-}{2}{,}{0}\right)$ (2.4)
 > ${r}_{2}≔\mathrm{RootOf}\left({\mathrm{_Z}}^{2}-2,\mathrm{index}=1\right)$
 ${{r}}_{{2}}{:=}{\mathrm{RootOf}}{}\left({{\mathrm{_Z}}}^{{2}}{-}{2}{,}{\mathrm{index}}{=}{1}\right)$ (2.5)

The numeric selector, $0$, is not sufficient to distinguish whether ${r}_{1}$ is the positive or negative root. Therefore, the following gcd computation is ambiguous: if ${r}_{1}$ represents the positive root, then the GCD is $x-\sqrt{2}$, but if ${r}_{1}$ represents the negative root, then the GCD is 1. Hence an error is raised:

 > $\mathrm{gcd}\left(x-r\left[1\right],x-r\left[2\right]\right);$

Solution

If you use a different selector that is not ambiguous, you can get an answer. Here, we use index=1 and index=2.

 >
 ${{r}}_{{1}}{≔}{\mathrm{RootOf}}{}\left({{\mathrm{_Z}}}^{{2}}{-}{2}{,}{\mathrm{index}}{=}{1}\right)$ (2.6)
 >
 ${{r}}_{{2}}{≔}{\mathrm{RootOf}}{}\left({{\mathrm{_Z}}}^{{2}}{-}{2}{,}{\mathrm{index}}{=}{2}\right)$ (2.7)
 >
 ${1}$ (2.8)

We've specified two distinct roots, and their gcd is  1.

Example 3

 > $\mathrm{convert}\left(\mathrm{RootOf}\left({x}^{2}-x-1,\frac{1}{2}\right),\mathrm{RootOf},\mathrm{form}=\mathrm{index}\right)$

Solution

This is the same root selector problem as in example 1.  As was done for that example, by choosing a different numeric selector for the RootOf, the specification is no longer ambiguous:

 >
 ${\mathrm{RootOf}}{}\left({{\mathrm{_Z}}}^{{2}}{-}{\mathrm{_Z}}{-}{1}{,}{\mathrm{index}}{=}{1}\right)$ (2.9)