0

I got the home assessment which I didn't understand. what to do and how to achieve it.

The question:

Write a program to compute the running time for addition operation for an input of size n. The computational complexity is n, n^2,n^3, n! and 2^n? How does this compare with the multiplication operation?

Every little bits help.

Mitul
  • 59
  • 5
  • 2
    Computational complexity has nothing to do with specific operation of a computer, please elaborate on what are you trying to measure and what the program meant to do. If you looking for a program that can compute the complexity of another program that's impossible as mention here -> https://stackoverflow.com/questions/8812776/can-a-program-calculate-the-complexity-of-an-algorithm#:~:text=Generally%20you%20can't%2C%20but,halting%20is%20of%20extreme%20importance. – JackRaBeat Apr 25 '22 at 10:53
  • as the question states, "compute running time for addition operation". You are right that it's impossible to calculate – Mitul Apr 25 '22 at 11:00
  • 2
    Without more details, it's impossible to answer. I guess the question is referring to some specific addition and multiplication operation (perhaps those operations in Python)? And then asking you to plot the graphs of running times and try to read off the complexities from them, but if the task is unclear you should consult with whoever asked the question, or whatever help you get from your learning establishment. – Paul Hankin Apr 25 '22 at 11:19
  • what is `n` ? number of digits/bits/words? or value? of result/bigger operand or number of operands? `n^3` and higher makes no sense for addition? `n^2` only if `n` is number of operands and number of digits/bits/words at the same time which also makes no sense... unless you are not adding scalars or numbers ... – Spektre Apr 26 '22 at 07:31

0 Answers0