- #1
nrobidoux
- 25
- 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
n2 = 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 ))