For a function and time , calculate the largest size of the problem that can be solved in , assuming that for the algorithm to solve the problem it takes microseconds.
Details and assumptions :
) Do it
) Inspired from
This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try
refreshing the page, (b) enabling javascript if it is disabled on your browser and,
finally, (c)
loading the
non-javascript version of this page
. We're sorry about the hassle.
As already suggested, you were supposed to solve without WA.Here is one way,
n × l g ( n ) = 1 0 0 0 {solve for the equality to determine the largest n and then take its floor value}
n = 2 n 1 0 0 0
1 0 0 0 = n 1 0 0 0 × 2 n 1 0 0 0
Let n 1 0 0 0 = z ................ ( ∗ )
Let f ( z ) = z × 2 z − 1 0 0 0 , f ′ ( z ) = 2 z ( z l n ( 2 ) + 1 ) and we are required to find roots of f ( z )
Using Newton’s method ,
z n + 1 = z n − f ′ ( z n ) f ( z n )
We know that 7 × 2 7 < 1 0 0 0 < 8 × 2 8
∴ we can guess the initial root as ~ 7.25 {i.e. z 0 = 7 . 2 5 }and proceed as per Newton's method to obtain the approx. root z = 7 . 1 3 1 5 6 1 8 7 5 .
n = 7 . 1 3 1 5 6 1 8 7 5 1 0 0 0 ......................from ( ∗ )
⌊ n ⌋ = 1 4 0