0
$\begingroup$

I have a small logarithm related question that I do not seem to understand how to solve.

If a program takes $\log n$ microseconds to run a program of size $n$, what is the maximum size of a program that can run in $1$ second? Here, the base of the logarithm is $2$.

I end up with an equation - $(n 10^6)/ \log n =$ maximum size of the program that can run in $1$ second. However, I'm unsure on how to solve this further.

The answer I found for this question is $2^{(10^6)}$. However, the steps to obtain this answer were not shown. May I please know how to solve this question?

$\endgroup$
0
$\begingroup$

I believe the problem is in your equation. You should have

$$\log n=10^6$$

or the time it takes to run a program of size $n$ is one million microseconds. Now just solve for $n$.

| cite | improve this answer | |
$\endgroup$
  • $\begingroup$ I figured that. But I'm unsure of how to obtain that equation you mentioned from the problem statement. Could you please edit your answer to include that? $\endgroup$ – sosale151 Jan 7 '15 at 10:51
  • $\begingroup$ @user3705895 I think I more or less said it in English. "The time it takes to run a program of size $n$", which according to your problem is $\log n$, "is (equals) one million microseconds." $\endgroup$ – Mike Jan 7 '15 at 11:16
  • $\begingroup$ Got it. Thanks. $\endgroup$ – sosale151 Jan 7 '15 at 11:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.