       Re: Re: simplification

• To: mathgroup at smc.vnet.net
• Subject: [mg121965] Re: Re: simplification
• From: Andrzej Kozlowski <akoz at mimuw.edu.pl>
• Date: Fri, 7 Oct 2011 04:49:24 -0400 (EDT)
• Delivered-to: l-mathgroup@mail-archive0.wolfram.com
• References: <j6e693\$kef\$1@smc.vnet.net> <201110050801.EAA07025@smc.vnet.net> <360851F3-7690-47A6-BC84-E9521100E6F4@mimuw.edu.pl>

```On 6 Oct 2011, at 16:57, Andrzej Kozlowski wrote:

>
> On 5 Oct 2011, at 10:01, Peter Pein wrote:
>
>> Am 04.10.2011 07:40, schrieb dimitris:
>>> Hello.
>>>
>>> Let
>>>
>>> o1 = 1 + Sqrt[15 + 2*Sqrt + 2*Sqrt[6*(6 + Sqrt)]];
>>> o2 = 1 + Sqrt + Sqrt + Sqrt;
>>>
>>> o1 is equal to o2.
>>>
>>> o1 == o2 // FullSimplify
>>> True
>>>
>>> The question is how to make Mathematica to simplify o1 to o2.
>>>
>>> Thanks
>>> Dimitris
>>>
>>
>> With a lot of luck:
>>
>> In:= o1 = 1 + Sqrt[15 + 2*Sqrt + 2*Sqrt[6*(6 + =
Sqrt)]];
>> ext = Block[{x, poly = RootReduce[o1][]},
>>  Sqrt[Cases[Union @@ Divisors[Abs[CoefficientList[poly[x], x]]],
>>    1 | _?PrimeQ, 1]]]
>> o2 = ((Rest[#1] / First[#1]) . ext & )[
>>       FindIntegerNullVector[Prepend[ext, -o1]]]
>>
>> Out= {1, Sqrt, Sqrt, Sqrt, Sqrt, Sqrt, Sqrt}
>>
>> Out= 1 + Sqrt + Sqrt + Sqrt
>>
>> :-)
>>
>
> Neat, but from the Mathematical point of view the question was posed
"the wrong way round" in that o1 is mathematically "simpler" than 1 +
Sqrt + Sqrt + Sqrt, since it is already expressed in terms of
its minimal polynomial. Hence this is the "natural" or "easy" way to go:
>
> ToRadicals[RootReduce[1 + Sqrt + Sqrt + Sqrt]]
>
> 1 + Sqrt[15 + 2*Sqrt + 2*Sqrt[6*(6 + Sqrt)]]
>
> in other words, the algebraic "simplification" in this case is exactly
the opposite of, what might be called, the visual one.
>
>
> There is no natural or unique way to "decompose" algebraic numbers
that are already reduced into sums etc, of "simpler" summands or factors
etc. Of course, if we already know an integer basis for an algebraic
number field containing an algebraic number, than there are ways of
expressing it in terms of this basis - and this method is an example.
>
> Andrzej Kozlowski
>
>
>
>

Let me correct myself here since I noticed that I did not write what I
really meant ;-)

What I mean was that the following is the simplest (algebraically) form
of this algebraic number:

In:= RootReduce[1 + Sqrt + Sqrt + Sqrt]

Out= Root[
1024 + 3584 #1 + 640 #1^2 - 1984 #1^3 - 48 #1^4 + 304 #1^5 -
32 #1^6 - 8 #1^7 + #1^8 &, 8]

(the same as above, but, of course, without the ToRadicals).
Mathematically equivalent statement is:

MinimalPolynomial[RootReduce[1+Sqrt+Sqrt+Sqrt],x]
1024+3584 x+640 x^2-1984 x^3-48 x^4+304 x^5-32 x^6-8 x^7+x^8

The only simplification one can really make algorithmically with
algebraic numbers is what RootReduce does - essentially finding the
minimal polynomial. Mathematica also has an algorithm for converting
some root objects to radicals but this is usually does not give the
visually simplest form. There is no algorithm that will discover the
simples such form in general (indeed, most algebraic numbers can't be
expressed in radicals at all). On the other hand, one can find the
minimal polynomial of any algebraic number: e.g.

In:= MinimalPolynomial[1 + Sqrt + Sqrt + Sqrt, x]
Out= 1024 + 3584*x + 640*x^2 - 1984*x^3 - 48*x^4 + 304*x^5 -
32*x^6 - 8*x^7 + x^8

In:=
MinimalPolynomial[1+Sqrt[15+2*Sqrt+2*Sqrt[6*(6+Sqrt)]],x]
Out= 1024+3584 x+640 x^2-1984 x^3-48 x^4+304 x^5-32 x^6-8 x^7+x^8

You get the same answer which is how Mathematica knowns that these
numbers are really equal - it does not attempt to transform one into the
other. When I wrote that
1+Sqrt[15+2*Sqrt+2*Sqrt[6*(6+Sqrt)] was "algebraically simpler"
than 1+Sqrt+Sqrt+Sqrt] I meant only that the former is
Mathematica's radical representation of Root[1024 + 3584 #1 + 640 #1^2 -
1984 #1^3 - 48 #1^4 + 304 #1^5 - 32 #1^6 - 8 #1^7 + #1^8 &, 8] - which
is indeed the simplest way (algebraically) to express this algebraic
number, which, of course, has infinitely many other representations in
terms of radicals (which Mathematica will not be able, in general, to
convert into one another but will always be able to find their minimal
polynomial).

This is not a limitation of Mathematica - it is a limitation of the
radical representation of algebraic numbers.

Andrzej Kozlowski

```

• Prev by Date: Re: Compilation: Avoiding inlining
• Next by Date: Stylesheets and CDFs
• Previous by thread: Re: Re: simplification
• Next by thread: Re: find two numbers a,b, such that a+b=5432 & LCM[a,b]=223020