Talk:Multiplicative order: Difference between revisions

No edit summary
Line 3:
There's more than one way to determine the multiplicative order. While my J is next to non-existant, I can tell you're not using one of the naive ones :-) As the point of Rosetta is to compare equal algorithms in different languages (and not different algorithms in different languages), please state in the task which algorithm you'd like to be used.
Also, IMHO the tasks should be chosen to allow a meaningful comparison of languages, and I am not sure if this is a good task for this purpose, because it's more centered on the algorithm than on the possible different ways different languages work. [[User:Dirkt|Dirkt]] 03:57, 8 December 2007 (MST)
: The J solution implements the algorithm described in Bach & Shallit, <i>Algorithmic Number Theory I</i>, exercise 5.8, page 118115.
:: If you implement a specific algorithm, it would be nice to describe the algorithm for those who don't happen to have this book lying around.
: Judging by the other programming tasks, the submissions in the various languages don't always implement the same algorithm, but use algorithms that are "natural" to the language. That too is a meaningful comparison. [[User:Roger Hui|Roger Hui]] 08:28, 8 December 2007 (MST)
Line 9:
:: And J has enough interesting features that require a different "natural" approach than in other languages that it would be really worthwhile to pick tasks which highlight this. And if you'd add a bit of explanation to really point this out in the implementation, for those not familiar with J, all the better.
:: One thing this Wiki is really good for is to try to get up to speed in an unfamiliar language, by comparing the approaches with those in a familiar language. This doesn't work if all similarity is suppressed, because the algorithms are essentially incomparable.[[User:Dirkt|Dirkt]] 13:46, 8 December 2007 (MST)
 
I'll see what I can do about an algorithm description. I'd prefer to upload a jpeg image of the pages
in question as my LaTex skills are probably not up to reproducing the formulae.
Implementation of the Bach-Shallit algorithm is facilitated by having
<ul>
<li>primes and factoring</li>
<li>extended precision arithmetic</li>
<li><tt>a^b modulo c</tt></li>
<li>vector operations</li>
</ul>
It would be interesting to see how the algorithm would be implemented in a language
that lacks one or more of these features.
[[User:Roger Hui|Roger Hui]] 18:06, 8 December 2007 (MST)
 
=== Java solution ===
Anonymous user