Suppose that a mathematician is developing a program to multiply extremely large (prime) numbers. Further suppose that the mathematical decides to perform such multiplications in base-2. Briefly explain why this is a bad idea.
It is a bad idea due to the following reasons:
(i) The base-2 representation of any number is the most complicated ones. For large prime numbers the representation will be complicated.
(ii) The base-2 representation of any number will require a specific number of bits for the representation. But the numbers are prime and extremely large. So, storing the result will require a greater number of bits than what is used for the representation. In many cases, it will cause overflow.
(iii) There will be a lot of steps involved in the process. So, the program will have a very high time complexity.
(iv) The space complexity of the program will be very high.
(v) There will be requirement for additional memory spaces.
Please comment in case of any doubt.
Please upvote if this helps.
Get Answers For Free
Most questions answered within 1 hours.