Talk:Addition-chain exponentiation: Difference between revisions

 
(7 intermediate revisions by 2 users not shown)
Line 130:
==Associativity==
Exponentiation is the obvious application for addition chains, but shouldn't they work for any associative binary operation? I expect exponentiation will make the best application for a task requirement, but we might mention associativity in the description. —[[User:Sonia|Sonia]] 23:08, 13 February 2012 (UTC)
:Actually, except for low exponent, I doubt any software would use optimal solution, since it's really a pain to find the solutions. Also, there is a more general solution allowing inverse operations. It is interesting for multiplication (if addition and subtraction have roughly the same cost), but probably not for exponentiation, where multiplication/division are usually not expected to have the same cost. Hence for really optimal use, one would have to analyze carefully the costs of each variant. However, the task is still theoreyicallytheoretically interesting, and fidningfinding a good algorithm for large exponents is not so easy. A backtracking program I wrote some time ago in Fortran 77 took almost 24 hours to compute optimal solutions for all exponents up to 2048, I don't think it's fast enough, by far. And usually heuristics only give suboptimal solutions. [[User:Arbautjc|Arbautjc]] ([[User talk:Arbautjc|talk]]) 09:30, 30 April 2015 (UTC)
 
==Optimal solution, A003313, and κῦδος==
Line 195:
 
::Then you could probably turn around the task and get more examples I think. --[[User:Paddy3118|Paddy3118]] ([[User talk:Paddy3118|talk]]) 09:22, 21 July 2015 (UTC)
:::Okay, I'll have a look at this then. I'll come back to you in a few days to check if it's ok - and to check the english, as that's not my native language :)
:::[[User:Arbautjc|Arbautjc]] ([[User talk:Arbautjc|talk]]) 09:49, 21 July 2015 (UTC)
:Should this task be deleted? As it is, I would say yes. It has many problems. It's current advocate, Arbautjc, feels optimal solutions should be required yet there no implementations of optimal chain algorithms (#include is not an implemenation) and people have cited reasons why optimal chain algorithms are not likely to be a good fit for RC. —[[User:Sonia|Sonia]] ([[User talk:Sonia|talk]]) 02:09, 10 August 2015 (UTC)
::The task as it is right now is too complex for RC. However, addition chains are IMO perfectly fit to RC. Choose lower bounds and it's easily feasible. However, if you choose lower bounds, it is known that star chains are optimal (but it is known by comparison to an optimal algorithm, not by an independant proof, AFAIK). The lowest N for which they fail to be optimal is greater than 10000, far above what is reasonably feasible with a simple backtracking algorithm. Therefore, if lower bounds are chosen, you may as well give the possibility to use star chains. So far, I have not had much time to write a new task for this (I have never written a task on RC yet, by the way).
::[[User:Arbautjc|Arbautjc]] ([[User talk:Arbautjc|talk]]) 15:20, 17 August 2015 (UTC)
 
As is, this page should be deleted. It is an exercise of the mind until shown that it has significance in daily computing.
 
In general, one should be able to find existing open source code as a working example that passes a test, such as from Perl's cpan for example. If this page is to be kept, the esoteric math symbols and terms should be translated.
[[User:tekbasse] ([[User talk:tekbasse|talk]]) 5:46, 1 March 2017 (UTC)
:Ridiculous. Is there a rule requiring that Rosetta Code tasks be useful in daily computing? Of course not. Esoteric math symbols? Maybe you think computer science has nothing to do with math. But this is also blatantly wrong. This problem has been the subject of several research articles, and good algorithms exist, period. That you may be unable to implement them is nobody's concern. There are other more or less difficult algorithms on RC, and I have no problem with that. RC is not limited to "Hello World" and "How do I write a for loop?", thankfully. [[User:Eoraptor|Eoraptor]] ([[User talk:Eoraptor|talk]]) 21:27, 16 December 2017 (UTC)
 
== Fast algorithm ==
There is indeed a fast algorithm, much faster than the straightforward backtracking algorithm I used. See the following article:
 
Neill Michael Clift,
''"Calculating optimal addition chains"'',
'''Computing''', March 2011, Volume 91, Issue 3, pp 265–284,
[https://doi.org/10.1007/s00607-010-0118-8 DOI:10.1007/s00607-010-0118-8]
 
:::[[User:Arbautjc|Arbautjc]] ([[User talk:Arbautjc|talk]]) 0911:4945, 2129 JulyAugust 20152016 (UTC)
1,336

edits