简体   繁体   中英

Master theorem where f(n) = cn^k

I'm wondering about a specific case for the master theorem that arises when f(n) = xn k and n^(log b a) = n k where x is an integer greater than 1. For this case f(n) is larger than n^(log b a) however it is not polynomially larger than it so case 3 can not arise.

For a case like this I would assume you use case 2 as the big-O of them both are the same but that doesn't seem to fit with the equation that I can find. It seems possible that I'm making a mistake in taking f(n) directly out of the original recursive relation rather than it's big-O as that seems to make sense to me yet I can't find any clarification on this or any examples where the space of f(n) in the equation is not already it's own big-O.

Edit: When I say "the equation that I can find" what I mean is that assumption doesn't fit with the master theorem as I can work it out. As I have it the master theorem for case 2 which I am talking about looks like f(n) = Θ(n^(log b a)) . I think the important bit really is whether out of an equation ending in + xn k I pull out f(n) = xn k or f(n) = n k . Apologies for the poor wording.

I think the important bit really is whether out of an equation ending in + xnk I pull out f(n) = xnk or f(n) = nk.

Normally you should take f(n) = x * n k . Because master theorem defines T(n) to be in the form aT(n/b) + f(n) . But in your example, it doesn't really matter.

Growth of f(n) and x * f(n) are the same, if x is a positive constant. In the case of f(n) = xn k , They are both Θ(n k ). (Or you could say they are both Θ(x * n k ). This is the same set as Θ(n k ).)

Since f(n) = Θ(n log b a ), case 2 of master theorem should be used here. The theorem says T(n) = Θ(n log b a * lgn) in this case.

Again, it doesn't matter here if you write Θ(n log b a * lgn) or Θ(5 * n log b a * lgn) or Θ(x * n log b a * lgn) . Multiplying a function with a positive constant doesn't change its asymptotic bounds. Master theorem gives you just the asymptotical bounds of the function, not its exact value.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM