How Large Can N Be for F(n) = Log N to Run in 1 Second?

  • Context: Undergrad 
  • Thread starter Thread starter nuttynibbles
  • Start date Start date
  • Tags Tags
    Log Seconds
Click For Summary

Discussion Overview

The discussion revolves around determining the largest size of a problem, denoted as n, that can be solved in a given time t, specifically when the algorithm's time complexity is expressed as f(n) = log n. Participants explore the implications of using different logarithmic bases and the calculations involved in deriving n from f(n) within a time constraint of 1 second.

Discussion Character

  • Technical explanation
  • Mathematical reasoning
  • Debate/contested

Main Points Raised

  • One participant initially assumes log is base 10 and calculates n as 10^1,000,000 based on f(n) = 1,000,000 microseconds.
  • Another participant points out that log n should be interpreted as base 2, prompting a recalculation of n as 2^1,000,000.
  • There is confusion regarding the relationship between 2^(10^6) and 10^x, with participants discussing how to derive x from the equation.
  • Participants explore the logarithmic identity that allows them to express y in terms of log_10(2) and 10^6, leading to further calculations about the value of x.
  • One participant expresses uncertainty about the necessity of converting logarithmic bases in their final answer, which is clarified by another participant.

Areas of Agreement / Disagreement

Participants generally agree on the logarithmic properties being discussed, but there is some disagreement and confusion regarding the calculations and interpretations of the results, particularly concerning the conversion between logarithmic bases and the final form of the answer.

Contextual Notes

Participants mention specific logarithmic rules and properties, but there are unresolved questions about the calculations and the implications of using different bases for logarithms. The discussion reflects varying levels of understanding and interpretation of the mathematical principles involved.

Who May Find This Useful

This discussion may be useful for individuals interested in algorithm analysis, logarithmic functions, and mathematical reasoning related to computational complexity.

nuttynibbles
Messages
7
Reaction score
0
Hi,

I'm doing this algorithm questions and i need to find the largest size n of a problem that can be solved in time t, assuming that the algorithm to solve the problem takes f(n) microseconds.

For example:

f(n) = log n
t = 1 seconds

how do i get the largest size of n in t time??

what i did is assume log is base 10, then:

lg x = y
x= 10^y
since:
f(n) = 1,000,000 microseconds
n = 10^1,000,000

am i right??

you can refer to the Q here: http://problems.datastructures.net/database/problems/compare-running-times/compare-running-times.pdf
 
Mathematics news on Phys.org


nuttynibbles said:
Hi,

I'm doing this algorithm questions and i need to find the largest size n of a problem that can be solved in time t, assuming that the algorithm to solve the problem takes f(n) microseconds.

For example:

f(n) = log n
t = 1 seconds

how do i get the largest size of n in t time??

what i did is assume log is base 10, then:

lg x = y
x= 10^y
since:
f(n) = 1,000,000 microseconds
n = 10^1,000,000

am i right??

you can refer to the Q here: http://problems.datastructures.net/database/problems/compare-running-times/compare-running-times.pdf

Well, first things first, you need to read the question a bit more carefully. The opening states clearly:

Note that log n means the logarithm in base 2 of n.

Other than that, you should be on the right track.
 


oh my.. tks

if it's base 2, then:

lg2 x = y
x= 2^y
since:
f(n) = 1,000,000 microseconds
n = 2^1,000,000

but why is the ans 10^3000000??
 


nuttynibbles said:
oh my.. tks

if it's base 2, then:

lg2 x = y
x= 2^y
since:
f(n) = 1,000,000 microseconds
n = 2^1,000,000

but why is the ans 10^3000000??

Do you mean 10300,000 as opposed to 103,000,000? If

2^{10^6}=10^x

find x.
 


sorry i meant 300,000

since:
2^(10^6) = 10^x
That means:
since x = 10^6, therefore 10^x = 10^(10^6). but how do i get the value 10^300000??
 
Last edited:


nuttynibbles said:
sorry i meant 300,000

since:
2^(10^6) = 10^x
That means:
10^(2^(10^6)) correct. but how do i calculate the value 10^300000?? i'll get error on my calculator

Not... quite. You have to take the log base 10 to isolate x, and then you get 10^6 log_10(2), or about 1000000 * log_10(2). That's the x you're looking for, and it's easy to prove that it's about 300000. Then you get that 2^(10^6) is about equal to 10^(300000).
 


hi char.limit, may i know which log rule define this??
 


nuttynibbles said:
hi char.limit, may i know which log rule define this??

If

a^b=c

then

b=\log_ac

So can you apply this to your example?
 


sorry but I am actually still confuse.. i don't really understand when char.limit said i can isolate x by taking log_10 of x and i get 106 . log_10 (2).

i change x->y to avoid confusion. since the rule says:
y = log_10 x, then x=10y

if we continue from
2106 =10y
then
y = log_10(2(106)) ?
but how did char.limit get log_10(2).106??
 
Last edited:
  • #10


Hi,

i finally understood. the rule that i was looking for is
loga(Xy) = y.loga(X)

therefore,
2106 =10y
y = 106 . log10(2)

However, i got another Q. if the Q was asked to use log2, must we give the final ans in log10??
 
  • #11


nuttynibbles said:
Hi,

i finally understood. the rule that i was looking for is
loga(Xy) = y.loga(X)

therefore,
2106 =10y
y = 106 . log10(2)
Yes, that's right :smile:

nuttynibbles said:
However, i got another Q. if the Q was asked to use log2, must we give the final ans in log10??

No, it's not necessary. I'd usually leave the answer as it is unless I was specifically asked to convert it into that form.
 
  • #12


hmm okay tks a lot peeps
 

Similar threads

  • · Replies 1 ·
Replies
1
Views
1K
  • · Replies 2 ·
Replies
2
Views
1K
Replies
7
Views
2K
  • · Replies 6 ·
Replies
6
Views
3K
  • · Replies 11 ·
Replies
11
Views
5K
  • · Replies 0 ·
Replies
0
Views
3K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 21 ·
Replies
21
Views
2K
  • · Replies 8 ·
Replies
8
Views
5K