Re: Trinomial decics x^10+ax+b = 0; Help with Mathematica code

• To: mathgroup at smc.vnet.net
• Subject: [mg93323] Re: [mg93280] Trinomial decics x^10+ax+b = 0; Help with Mathematica code
• From: Andrzej Kozlowski <akoz at mimuw.edu.pl>
• Date: Tue, 4 Nov 2008 06:15:31 -0500 (EST)
• References: <200811020657.BAA02645@smc.vnet.net> <BB6FC818-9D69-4DA2-8F6A-0A5B680ECD2C@mimuw.edu.pl> <64fc87850811020944p49edb6a2u38aa53a29b539784@mail.gmail.com> <F85E373D-0B9C-4090-BA7B-AE95575625E1@mimuw.edu.pl> <EDB4570E-5100-49D6-8E8B-D8FC3CAD3C39@mimuw.edu.pl>

```One more mistake (spurious semicolon). The correct version is

Catch[NestWhile[({a, b} = RandomInteger[{-10^6, 10^6}, {2}];
If[ck[a] == ck[b] == 0 && (p[a, b] || p[b, a]), Throw[{a, b}],
ck[a] = ck[b] = 1]) &, 1, True &, 1, 10^6]] // Timing

Andrzej

On 3 Nov 2008, at 17:07, Andrzej Kozlowski wrote:

> Sorry, I forgot that one has to Catch whatever might be Thrown ;-)
>
> Unfortunately, its unlikely to make any difference :-(
>
> Anyway, the correct code is:
>
> Catch[NestWhile[({a, b} = RandomInteger[{-10^6, 10^6}, {2}];
>     If[ck[a] == ck[b] == 0 && (p[a, b] || p[b, a]), Throw[{a, b}],
>      ck[a] = ck[b] = 1]) &, 1, True &, 1, 10^6]];//Timing
>
> Andrzej Kozlowski
>
> 3 Nov 2008, at 16:08, Andrzej Kozlowski wrote:
>
>> I doubt that you will have much luck with this approach. I did:
>>
>> f = -a + m^9 - 8 m^7 n + 21 m^5 n^2 - 20 m^3 n^3 + 5 m n^4 ; g = -b
>> + m^8 n -
>> 7 m^6 n^2 + 15 m^4 n^3 - 10 m^2 n^4 + n^5;
>>
>> p[x_, y_] :=
>> MemberQ[Exponent[FactorList[h /. {a :> x, b :> y}][[All, 1]], m], 5
>> | 10]
>>
>> (mm = Outer[List, Range[10^3], Range[10^3]]); // Timing
>> {0.012557, Null}
>>
>> (vv = Apply[p, mm, {2}];) // Timing
>> {7077.94, Null}
>>
>> Position[vv, True]
>> {}
>>
>> There is not a single example among the first 10^6. You can try
>> this approach on larger numbers, though eventually you will find
>> yourself short of memory to story such large arrays. Or you could
>> try random searches, with very much larger numbers, e.g.
>>
>> ck[_] = 0;
>>
>> NestWhile[({a, b} = RandomInteger[{-10^6, 10^6}, {2}];
>>    If[ck[a] == ck[b] == 0 && (p[a, b] || p[b, a]), Throw[{a, b}],
>>     ck[a] = ck[b] = 1]) &, 1, True &, 1, 10^4]; // Timing
>>
>> {0.481902, Null}
>>
>> As you see, 10^4 random pairs between -10^6 and 10^6, and no
>> result. The "flag" ck, by the way, is used to mark the numbers we
>> have already tried, so when we run this again we do not apply p to
>> them again.
>>
>> Anyway, it looks to me much harder than the proverbial looking for
>> a needle in a haystack.
>>
>> Andrzej Kozlowski
>>
>>
>>
>> On 3 Nov 2008, at 02:44, Tito Piezas wrote:
>>
>>> Hello Andrzej,
>>>
>>> The simple trinomials x^6+3x+3 = 0 and x^8+9x+9 = 0 are solvable,
>>> both factoring over Sqrt[-3].
>>>
>>> However, there seem to be no known decic trinomials,
>>>
>>> x^10+ax+b = 0
>>>
>>> such that it factors over a square root (or quintic) extension.
>>>
>>> The 45-deg resultant, for some {a,b}, IF it has an irreducible 5th
>>> or 10th degree factor, will give the {a,b} of such a decic.
>>>
>>> To find one, what I did was to manually substitute one variable,
>>> like "a" (yes, poor me), use the Table[] function for "b" (as well
>>> as the Factor[] function), and inspect the 45-deg to see if it has
>>> the necessary 5th or 10th deg factors. Unfortunately, there are
>>> none for {a,|b|} < 30.
>>>
>>> So what I was thinking is to extend the range to {a,|b|} < 1000.
>>> But that's about 10^6 cases, far more than I could do by hand.
>>>
>>> I'm sure there is a code such that we only have to give the upper
>>> bound for {a,b}, let Mathematica run for a while, and it prints
>>> out ONLY the {a,b} such that the 45-deg has an irreducible 5th (or
>>> 10th) factor. I believe there might be a few {a,b} -- but doing it
>>> by hand is like looking for a needle in a haystack.
>>>
>>> But my skills with Mathematica coding is very limited. Please help.
>>>
>>> P.S. The 45-deg resultant should be in the variable "m", so pls
>>> eliminate the variable "n" (not m) between the two original
>>> equations.
>>>
>>> Sincerely,
>>>
>>> Tito
>>>
>>>
>>> On Sun, Nov 2, 2008 at 6:14 AM, Andrzej Kozlowski
>>> <akoz at mimuw.edu.pl> wrote:
>>>
>>> On 2 Nov 2008, at 15:57, tpiezas at gmail.com wrote:
>>>
>>> Hello guys,
>>>
>>> I need some help with Mathematica code.
>>>
>>> It is easy to eliminate "n" between the two eqn:
>>>
>>> -a + m^9 - 8m^7n + 21m^5n^2 - 20m^3n^3 + 5mn^4 = 0
>>> -b + m^8n - 7m^6n^2 + 15m^4n^3 - 10m^2n^4 + n^5 = 0
>>>
>>> using the Resultant[] command to find the rather simple 45-deg
>>> polynomial in "m", call it R(m).
>>>
>>> As Mathematica runs through integral values of {a,b}, if for some
>>> {a,b} the poly R(m) factors, we are interested in two cases:
>>>
>>> Case1: an irreducible decic factor
>>> Case2: an irreducible quintic factor
>>>
>>> What is the Mathematica code that tells us what {a,b} gives Case 1
>>> or
>>> Case 2?
>>>
>>>
>>> Thanks.  :-)
>>>
>>>
>>> Tito
>>>
>>>
>>>
>>>
>>> Let f = -a + m^9 - 8 m^7 n + 21 m^5 n^2 - 20 m^3 n^3 + 5 m n^4 ; g
>>> = -b + m^8 n -
>>> 7 m^6 n^2 + 15 m^4 n^3 - 10 m^2 n^4 + n^5;
>>>
>>> and
>>>
>>> h = Resultant[f, g, m];
>>> Exponent[h, n]
>>> 45
>>>
>>> so h is a polynomial of degree 45. Now, let
>>>
>>> p[x_, y_] := Exponent[FactorList[h /. {a :> x, b :> y}][[All, 1]],
>>> n]
>>>
>>> computing p[a,b]  gives you the exponents of the irreducible
>>> factor for the given values of a and b. In most cases you get
>>> {0,45} - the irreducible case. But, for example,
>>> p[a, 0]
>>> {0, 1, 9}
>>> and
>>> p[2, 1]
>>> {0, 9, 36}
>>>
>>> So now you can search for the cases you wanted.  You did not
>>> seriously expect Mathematica would do it by itself, I hope?
>>>
>>> Andrzej Kozlowski
>>>
>>
>

```

• Prev by Date: Re: Re: Mathematica 6.0: How to collect data with Manipulate?
• Next by Date: strange effect: program works only when board clicked
• Previous by thread: Re: Trinomial decics x^10+ax+b = 0; Help with Mathematica code
• Next by thread: Re: Trinomial decics x^10+ax+b = 0; Help with Mathematica code