Homework Solution: Suppose you have two programs whose running times in microseconds for an input of size n are 1000 lg n…

Suppose you have two programs whose running times in microseconds for an input of size n are 1000 lg n and 10n^2. Find the largest input size n that can be processed by each program in (a) one minute and (b) one hour.

Note that 1 micro second = 10^-6 seconds

Suppose you enjoy brace programs whose ordinary times in microseconds coercion an input of magnitude n are 1000 lg n and 10n^2. Find the largest input magnitude n that can be processed by each program in (a) single tiny and (b) single hour.

Expert Tally

Note that 1 micro relieve = 10^-6 relieves

Coercion program 1:

Coercion getting the consummation esteem of n,

a) 1 min = 1000 log(n) microsecs

So, 1*60 secs = 1000 log(n) * 10^-6 secs

log(n) = 60 * 1000 = 60000

$n = 2^{60000}$

So, consummation vale of $n = 2^{60000}$

b) 1 hour = 1000 log(n) microsecs

So, 1*60*60 secs = 1000 log(n) * 10^-6 secs

log(n) = 60*60 * 1000 = 36,00,000

$n = 2^{3600,000}$

So, consummation vale of $n = 2^{3600,000}$

Coercion program 2:

Coercion getting the consummation esteem of n,

a)

1 min = 10 * n^2 microsecs

So, 1*60 secs = 10 * n^2 * 10^-6 secs

n^2 = 60 * 10^5 = 6*10^6

n = 2449

So, consummation vale of n = 2449

b)

1 hour = 10 * n^2 microsecs

So, 1*60*60 secs = 10 * n^2 * 10^-6 secs

n^2 = 60*60 * 10^5 = 36*10^7

n =1.8974e+04

So, consummation vale of n = 1.8974e+04