RE: Magic number 23
- To: mathgroup at smc.vnet.net
- Subject: [mg41464] RE: [mg41445] Magic number 23
- From: "Ingolf Dahl" <ingolf.dahl at telia.com>
- Date: Wed, 21 May 2003 08:00:36 -0400 (EDT)
- Sender: owner-wri-mathgroup at wolfram.com
I did not specify exactly what I meant by "exact value", and of course one could consider Sin[Pi/23] to be an "exact value" by itself. But what I meant was an expression involving integers and radicals. If we allow Root expressions, the question about the number of exact values becomes almost trivial. Maybe the operation ToRadicals should be redefined to also convert expressions of this type. I find it a bit surprising that Mathematica does not give radical expressions for Sin[Pi/8] and Cos[Pi/8]. These were given in my school math tables. One (recreational) use of these expressions are to find different ways to express Pi. If we know an exact expression of Tan[Pi/12], for instance, we might use this value as x, and use the power expansion of ArcTan[x] to obtain a series with the sum Pi/12. And if we use Tan[Pi/2^20] in the same way, we should obtain a commplicated expression, but a very rapid convergence. But, still, what is so special with Sin[Pi/23]? What is FullSimplify trying to do with it? And why do some other primes take so long to evaluate? FullSimplify does not succeed to do anything with these expressions, it just is wasting time. On a second run of the evaluations with the same Kernel, FullSimplify has learnt the lesson, and the evaluations are immediate. Ingolf Dahl Sweden >-----Original Message----- >From: Andrzej Kozlowski [mailto:akoz at mimuw.edu.pl] To: mathgroup at smc.vnet.net >Sent: Tuesday, May 20, 2003 12:54 >To: Ingolf Dahl >Cc: mathgroup at smc.vnet.net >Subject: [mg41464] Re: [mg41445] Magic number 23 > > >Actually, I was to impatient and in fact the second RootReduce did >arrive at an answer: > > >Root[1 - 12*#1 - 60*#1^2 + 280*#1^3 + 560*#1^4 - 1792*#1^5 - > 1792*#1^6 + 4608*#1^7 + 2304*#1^8 - 5120*#1^9 - > 1024*#1^10 + 2048*#1^11 & , 11] > >which, I think, is a pretty satisfactory exact expression for >Cos[Pi/23] even if it is not in radicals. > >Note that if you apply ToRadicals to the above Mathematica will return >you the input instantly, which suggests it does not even attempt to >radical expressions for root objects of such high degree. > > >On Tuesday, May 20, 2003, at 07:37 pm, Andrzej Kozlowski wrote: > >> The meaning of "exact values" is not entirely clear. For example, the >> following can be considered an "exact value": >> >> >> TrigToExp[Cos[Pi/23]] >> >> >> 1/2/E^((I*Pi)/23) + (1/2)*E^((I*Pi)/23) >> >> and so can: >> >> >> FullSimplify /@ TrigToExp[Cos[Pi/23]] >> >> >> (1/2)*(-1)^(1/23) - (1/2)*(-1)^(22/23) >> >> and >> >> (RootReduce[FullSimplify[#1]] & ) /@ TrigToExp[Cos[Pi/23]] >> >> Root[1 - 2*#1 + 4*#1^2 - 8*#1^3 + 16*#1^4 - 32*#1^5 + >> 64*#1^6 - 128*#1^7 + 256*#1^8 - 512*#1^9 + 1024*#1^10 - >> 2048*#1^11 + 4096*#1^12 - 8192*#1^13 + 16384*#1^14 - >> 32768*#1^15 + 65536*#1^16 - 131072*#1^17 + >> 262144*#1^18 - 524288*#1^19 + 1048576*#1^20 - >> 2097152*#1^21 + 4194304*#1^22 & , 21] + >> Root[1 - 2*#1 + 4*#1^2 - 8*#1^3 + 16*#1^4 - 32*#1^5 + >> 64*#1^6 - 128*#1^7 + 256*#1^8 - 512*#1^9 + 1024*#1^10 - >> 2048*#1^11 + 4096*#1^12 - 8192*#1^13 + 16384*#1^14 - >> 32768*#1^15 + 65536*#1^16 - 131072*#1^17 + >> 262144*#1^18 - 524288*#1^19 + 1048576*#1^20 - >> 2097152*#1^21 + 4194304*#1^22 & , 22] >> >> Attempting to RootReduce this last expression seems indeed to take for >> ever (but I have little patience and a fairly slow computer) >> >> But presumably what you are are talking about is a "radical >> expression". Since the Galois group of cyclotomic extension over the >> rationals is solvable, we know that that all Cos[2Pi/n] and Sin[2Pi/n] >> can be expressed in terms of radicals, but I doubt that there is a >> practical algorithm for writing it out. In any case even if it exists >> implementing it in Mathematica would be of no practical value. >> >> Andrzej Kozlowski >> Yokohama, Japan >> http://www.mimuw.edu.pl/~akoz/ >> http://platon.c.u-tokyo.ac.jp/andrzej/ >> >> >> On Tuesday, May 20, 2003, at 04:24 pm, Ingolf Dahl wrote: >> >>> Hello Mathgroup! >>> Mathematica knows the exact values of the trigonometric functions for >>> some >>> special angles. I was curious how many such values there are. In >>> principle, >>> there should be an infinite number of such angles available, if I >>> have got >>> it correctly: at least all angles which can be written as Pi times an >>> integer fraction, where the denominator can be written as a product of >>> powers of two and three. Also at least one factor five can be >>> included in >>> the denominator. I have not investigated further. The trigonometric >>> expressions might get very complicated, of course. Mathematica knows >>> about >>> the denominators 2, 3, 4, 5, 6, 10 and 12. >>> In the attempt to investigate further, I asked Mathematica to perform >>> the >>> following operation: >>> >>> Table[Timing[FullSimplify[{i, Cos[Pi/i], Sin[Pi/i]}]], {i, 1, 22}] >>> >>> The first run of this command gives very varying times, from 0. >>> Second for >>> i=2 to 2.3 Second for i=19. If we change the limits of table, >>> Mathematica >>> get completely stuck at i=23 (?!?!). For i=29, it takes 119.73 >>> Seconds, >>> while i=36 requires 0.06 Second. >>> >>> What is the magic of i=23? >>> >>> I think that this might be an interesting feature, not a bug, so >>> therefore I >>> send it to Mathgroup. To handle the case that this really is a bug, I >>> also >>> send it to the Wolfram support. >>> >>> I use Mathematica 4.2.0.0 on a fast Windows Me machine. >>> >>> Ingolf Dahl >>> Sweden >>> >>> >>> >>> >> >> >Andrzej Kozlowski >Yokohama, Japan >http://www.mimuw.edu.pl/~akoz/ >http://platon.c.u-tokyo.ac.jp/andrzej/ >