102k views
3 votes
an algorithm for solving a problem runs in exponential time o ( 2 n ) . suppose that your computer, running an implementation of this algorithm, can process an input of size 10 in one day. what is the maximum input size that can be processed in one day by a computer that is 1000 times faster if it uses the same implementation? justify your answer.

User Mark Worth
by
9.5k points

1 Answer

4 votes

Final answer:

For an implementation of an algorithm running in exponential time O(2^n), a computer that is 1000 times faster than one that processes an input of size 10 in one day could handle an input size of approximately 20 in the same timeframe. This is determined by the property of exponential growth and using logarithms to solve O(2^m) = 1000 * O(2^10).

Step-by-step explanation:

An algorithm that runs in exponential time O(2n) takes exponentially longer with each increase in the input size n. In the case where a computer can process an input of size 10 in one day, if another computer is 1000 times faster, determining the maximum input size it can handle in one day requires understanding exponential growth.

Let's denote the input size for the slower computer as n and for the faster computer as m. Since the faster computer can process 1000 times more operations in the same time, we can set up the equation O(2m) = 1000 * O(2n). Given that n is 10, we want to find m such that 2m = 1000 * 210. We solve for m by using logarithms, resulting in m being approximately 10 + log2(1000), which is about 10 + 9.97, giving us an m about equal to 20.

The faster computer can therefore process an input size of up to 20 in one day using the same exponential time algorithm implementation, due to its ability to handle 1000 times more operations than the original computer.

User Raman Zhylich
by
8.3k points