For the following recurrence, provide an asymptotic characterization. f(n) = f(n/3) + 1
There is no base case
Unfortunately, we aren't given a base case. It does say, however, that we need not prove them, if that makes a difference.
I'd say that it's like a Big-O characterization of a linear function, but I'm not sure if I'm even doing this part correctly.
\[ f(n) = f(n/3)+1 = f(n/3^2)+2=f(n/3^3)+3 = f(n/3^{\log_3n})+\log_3 n = f_0+\log_3n \]
Or make that \(f_1\). I'm assuming it stops at \(1\), otherwise it would go on forever.
Alright, would you care to elaborate on how you got that equation?
...you don't see the pattern?
\(3^{\log_3 n }=n\)
Sorry, it's really hard to read those exponents.
Ok, zoomed in 150% now, and I can read the exponents.
\[ f(n) = f(n/3)+1 = (f((n/3)/3) + 1) + 1 = f(n/3^2)+2 =f(n/3^k)+k \]
Ok, I think I'm getting this.
So, if I were to throw a constant, like 2 or 4 in front of the f(n/3), would that change anything? Or would I just throw it in front of the answer we got?
try for yourself
\[ f(n) = af(n/b) + c \]
Ok, I'll give this a go in the morning. Thank you a ton!
Join our real-time social learning platform and learn together with your friends!