Solving for n: power and log rules refresh

Click For Summary

Homework Help Overview

The discussion revolves around determining the number of inputs a computer can process in an hour based on various algorithmic complexities, given a specific operational capacity of 10^10 ops/s. The complexities under consideration include polynomial, logarithmic, and exponential functions.

Discussion Character

  • Mixed

Approaches and Questions Raised

  • Participants explore setting different algorithmic complexities equal to a calculated capacity, C, derived from the computer's operational speed. There is uncertainty expressed regarding the manipulation of logarithmic expressions, particularly for n log n and 2^n.

Discussion Status

Some participants have provided insights into approximations and the use of the Lambert W-function for solving n log n. Others have shared their attempts at calculations and expressed confusion about the application of logarithmic rules. Clarifications regarding the base of logarithms and the operational capacity calculation have also been discussed.

Contextual Notes

Participants note the complexity of the Lambert W-function and question whether the problems are intended to be solved with simpler methods. There is mention of potential discrepancies in numerical values due to formatting issues in software. The discussion also highlights the need for approximations in certain cases.

nrobidoux
Messages
24
Reaction score
0

Homework Statement



A computer can perform 1010 ops/s. Assume 1 op per 1 input. Given the following algorithmic complexities how many inputs can be performed in an hour.

  • n2
  • n3
  • 100n2
  • n log n
  • 2n
  • 22n

Homework Equations

The Attempt at a Solution


[/B]
C = 1·1010 ops/s · 3.6·102 s/hr
C = 3.6·1012 ops/hr

Set each complexity equal to C.

I know this is almost basic algebra but I haven't done this in decades. I think I'm good in the first 3... it's the last 3 I'm a bit confused on. Mostly n log n. Did some googling of the rules but I'm still confused there, and I've never seen a log of a log...

----------------------------------------------
n2 = C
n
(2 · 1/2) = C 1/2
n = C 1/2

----------------------------------------------
The next is basically the same except it's cubic: n = C 1/3

----------------------------------------------
100n2 = C
n
2 = C/100
n(2 · 1/2) = (C/100)1/2
n = (C/100)1/2

----------------------------------------------
n logb( n ) = C

... (more Googling)...


I have no clue... I found another rule. On the surface I think I applied them correctly but I don't know how to get n by itself. I got: bC = nn and bC/n = n... of course if I really looked at those two...

----------------------------------------------
2n = C
n
= log2 ( C )

----------------------------------------------
22n = C
2n = log2 ( C )
n = log2 ( log2 ( C ))
 
Physics news on Phys.org
nrobidoux said:
3.6·102 s/hr
Check that.
nrobidoux said:
n logb( n ) = C
No base was given.
You only need a solution that is asymptotically correct. Given y log y = x, make a guess as to what y is, approximately, as a function of x.
 
nrobidoux said:

Homework Statement



A computer can perform 1010 ops/s. Assume 1 op per 1 input. Given the following algorithmic complexities how many inputs can be performed in an hour.

  • n2
  • n3
  • 100n2
  • n log n
  • 2n
  • 22n

Homework Equations

The Attempt at a Solution


[/B]
C = 1·1010 ops/s · 3.6·102 s/hr
C = 3.6·1012 ops/hr

Set each complexity equal to C.----------------------------------------------
n logb( n ) = C

... (more Googling)...


I have no clue... I found another rule. On the surface I think I applied them correctly but I don't know how to get n by itself. I got: bC = nn and bC/n = n... of course if I really looked at those two...

The solution to ##n \log_2(n) = C## involves the so-called Lambert W-function, which is non-elementary (not a simple power, root, trig, exponential, etc.) Maple gets the solution
$$n = \frac{C \ln(2)}{W(C \ln(2))}, $$
where ##W(w)## is the Lambert-W function of ##w##.
 
I used https://www.desmos.com/calculator to get an answer. I'll ask the professor for some clarification.

n = 1.13 ·1011
for n log10 ( n ) = C

The Lambert-W function as part of the solution sounds a bit too complicated for a day 1 homework problem. I think all these were intended to be solved with a pen and paper. Was the application of log rules applied correctly to the last problem? The 22n?

As for the 3.6·102 s/hr ... easy peasy with simple tricks. 60 sec/min x 60 min/hr.. units cancel to sec/hr 6X6 = 36. Add 2 zeroes. 3.6·102 Honestly thought it was 36·102 but Google docs is converting 3.6E2 to ... err well yesterday it was confusing me. So changing the power to 13 from 12 in C. I get 2.9 ·1012 above.
 
nrobidoux said:
The Lambert-W function as part of the solution sounds a bit too complicated for a day 1 homework problem
As I posted, you only need an approximation. Go on, make a guess as to how y depends on x, roughly, if y log y = x.
 
nrobidoux said:
I used https://www.desmos.com/calculator to get an answer. I'll ask the professor for some clarification.

n = 1.13 ·1011
for n log10 ( n ) = C

The Lambert-W function as part of the solution sounds a bit too complicated for a day 1 homework problem. I think all these were intended to be solved with a pen and paper. Was the application of log rules applied correctly to the last problem? The 22n?

As for the 3.6·102 s/hr ... easy peasy with simple tricks. 60 sec/min x 60 min/hr.. units cancel to sec/hr 6X6 = 36. Add 2 zeroes. 3.6·102 Honestly thought it was 36·102 but Google docs is converting 3.6E2 to ... err well yesterday it was confusing me. So changing the power to 13 from 12 in C. I get 2.9 ·1012 above.

Obviously we are talking about two different problems! I gave you a formula for solution that involved the symbolic C, just as you had done for problems A-C and E-F. I was pointing out to you that a symbolic answer involves a new function that you probably have never heard of before (but which is, in fact, used a lot in combinatorics and computer science). Of course if somebody gives you a numerical value of C you have a completely different situation, where some good guesses and a few trial values will get you a usable solution quickly. But, you need a numerical value for C in order to do that.

If your computer is loaded with a spreadsheet such as EXCEL, you can solve such equations by calling on the "Solver" tool, so you don't need to go to some on-line package if you would rather not.
 
I'll see if my version has that. It's an old version of Excel. I can be a bit slow when it comes to math... I have the answer but just want to be able to understand the process to get there in case it pops up on a test. It happens to be proctored online somehow. I asked for some clarification on the base... see what happens. I got quite a few days before this is due.

C = 3600 * 10^10

I appreciate the help. Forum is awesome. :D
 
haruspex said:
As I posted, you only need an approximation. Go on, make a guess as to how y depends on x, roughly, if y log y = x.
I'll add a hint. To a first approximation, x and y would be of similar magnitude. Use that to substitute for one of the occurrences of y.
 

Similar threads

Replies
2
Views
3K
Replies
5
Views
3K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 2 ·
Replies
2
Views
2K
Replies
5
Views
2K
Replies
39
Views
6K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 16 ·
Replies
16
Views
3K