Input lengths for algorithm with $10^9$ operations per second

278 Views Asked by At

There are different algorithms with the following time exposure (stated here we have the amount of operations for the unit length $n$):

Time exposure

The algorithms are executed in a computer, who can perform $10^9$ operations per second.

I have stumbled upon this in the internet:

expenditure classes

So 1 second is calculated by $sqrt(1000000000) = 31622.7766$

1 minute is calculated by $sqrt(1*10^9 * 60)$ = 244948 etc.

But how do I calculate the values for $2^n$ and n? Is n just $1*10^9$ for 1 second, and $1*10^9$ for 1 minute etc.? So for 1 second it would just be $log(1*10^9)$ for $2^n$?

1

There are 1 best solutions below

0
On BEST ANSWER

The exact question is this:

For an input of length $n$ and an algorithm that requires $n,n^2,2^n$ operations, what is the largest input length a computer that does $10^9$ operations per second can process using that algorithm in 1 second, 1 minute, etc.?

So we need to calculate how many operations the computer can do in one minute, one hour and one day separately. Then we need to pass those operation counts through the inverse of the complexity functions and round down to get the maximum input size.

For the linear-time ($n$) algorithm, the inverse is just itself, so the largest input lengths are $10^9$, $60×10^9$, $3600×10^9$ and $86400×10^9$ for the four given timescales. For the exponential ($2^n$) algorithm, we take the binary logarithm of the operation counts to get 29, 35, 41 and 46 respectively.