1

I know that a solving a specific problem can have different runtimes on different models of computation. But can a specific algorithm have different runtimes on different models of computation?

Also, would an algorithm be considered the high level description or the implementation level description of the procedure you need to do?

Armon Safai
  • 143
  • 7

1 Answers1

1

Yes it can. When you take RAM model and your algorithm has a lot of multiplications (dominant operation), your multiplications take unit time. Even if the numbers are $2048$ bit numbers. But if you take multitape Turing Machine as your model, the cost of multiplication matters and will be included in complexity.

Algorithm is high level description, implementation will vary. Getting back to multiplication, algorithm describes that in one step you have to multiply two numbers, but if numbers are bigger than computer words instead of writting "*" you have to implement it.

Evil
  • 9,455
  • 11
  • 31
  • 52
  • Why does it take constant time to do multiplications on RAM model but not in turing machine model? – Armon Safai Jun 06 '16 at 02:44
  • 1
    It is the matter of assumptions made in one model that you are going to use. Well, simply because RAM model assumes that.It is popular unit cost model. Please read this qustion. Or about the RAM model. On Turing Machine you have to actually perform the computation on tapes. There are more models, the assumptions apply to any algorithm you like. – Evil Jun 06 '16 at 03:36
  • but the algorithm for how to do the multiplication in the two models would be different right? – Armon Safai Jun 06 '16 at 05:19
  • 1
    In the RAM model, multiplication is a primitive operation, no algorithm needed. – adrianN Jun 06 '16 at 07:40
  • As adrianN said, in the RAM model we assume that multiplication takes just one unit, on other models we choose the algorithm and the complexities differ among them. Here are complexities given. – Evil Jun 06 '16 at 08:23
  • @ArmonSafai See also here. – Raphael Jun 06 '16 at 08:57
  • @Raphael I see, then why do we give runtimes for algorithms if their runtime would be different on different models of computation? Also, does that mean that quantum algorithms can still be run on standard computers right now? And my last question is, so a procedure that takes advantage of the hardware of a certain model of computation wouldnt be part of the overall algorithm? – Armon Safai Jun 06 '16 at 20:24
  • 1
    Because we say on which model we measure. You should really search for the very same topics, also format of this site works better with one question per post, not in comments. – Evil Jun 06 '16 at 21:49
  • This has really nothing to do with quantum computers, but yes, those algorithms can be computed on the normal computers. No, hardware is not considered in algorithms, so using RAM model for numbers that fit into registers is very good. Also please remember that we use asymptotic complexity... – Evil Jun 06 '16 at 21:58