|
[Date Index]
[Thread Index]
[Author Index]
Re: FindInstance what inspite ?
Artur wrote:
> Who have idea what function uses inspite FindInstance in procedure?
> \!\(FindInstance[Chop[N[Root[\(-1\) - 2\ #1 - 2\ #1\^2 - #1\^3 + #1\^5
> &, 2] \
> + Root[\(-1\) - 2\ #1 - 2\ #1\^2 - #1\^3 + #1\^5 &, 3], 500]] == a + b\
> Root[\(-1\) - 2\ #1 - 2\ #1\^2 - #1\^3 + #1\^5 &,
> 1] + c\ Root[\(-1\) - 2\ #1 - 2\ #1\^2 - #1\^3 +
> #1\^5 \
> &, 1]^2 + d\
> Root[\(-1\) - 2\ #1 - 2\ #1\^2 - #1\^3 + #1\^5 &, 1]^3 + e\
> Root[\(-1\) - 2\ #1 - 2\ #1\^2 - #1\^3 + #1\^5 &,
> 1]^4 && a != 0, {a, b, c, d, e}, Integers]\)
> And anser is empty set {}
> Good answer is {a,b,c,d,e}={-2,-3,-2,-1,2}
> Who know how I can realize that procedure in Mathematica ?
>
> Best wishes
> Artur
One can attempt such problems directly using lattice reduction. The idea
is to form a vector consisting of your target value and "basis" values
(the zeroeth through fourth powers of a certain algebraic number, in
your example). Multiply by a power of 10 raised to the precision you
have in mind, and round off to get integers. Augment on the right with
an identity matrix. Reduce this lattice, look for a small vector with
element in the column corresponding to the input value equal to +-1 (so
we know we obtained the value itself, and not a nontrivial multiple
thereof). This last can be relaxed if you are willing to allow rationals
(with small denominators, say) as coefficients.
So here is code to do all this.
minimalPolynomialInRoot[val_Real, alg_Root, deg_Integer] := Module[
{vec, prec=Floor[Precision[val]], lat, redlat, mults},
vec = Round[10^prec*Append[alg^Range[0,deg],-val]];
lat = Transpose[Prepend[IdentityMatrix[deg+2],vec]];
redlat = LatticeReduce[lat];
mults = First[redlat];
If [Abs[Last[mults]]==1,
Take[mults,{2,-2}] / Last[mults],
$Failed]
]
Your example:
val = Re[N[Root[-1 - 2*#1 - 2*#1^2 - #1^3 + #1^5 & , 2, 0] +
Root[-1 - 2*#1 - 2*#1^2 - #1^3 + #1^5 & , 3, 0], 500]];
alg = Root[-1 - 2*#1 - 2*#1^2 - #1^3 + #1^5 & , 1];
In[65]:= multipliers = minimalPolynomialInRoot[val, alg, 4]
Out[65]= {2, 2, 2, 1, -2}
Check:
In[66]:= multipliers.alg^Range[0,deg] - val
-500
Out[66]= 0. 10
Daniel Lichtblau
WOlfram Research
Prev by Date:
Re: plotting vectors
Next by Date:
Re: FindInstance what inspite ?
Previous by thread:
Re: FindInstance what inspite ?
Next by thread:
Re: FindInstance what inspite ?
|