简体   繁体   English

主定理 f(n) = cn^k

[英]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.我想知道当 f(n) = xn k和 n^(log b a) = n k时出现的主定理的特定情况,其中 x 是大于 1 的 integer。对于这种情况,f(n) 是大于 n^(log b a) 但它不是多项式大于它,因此不会出现情况 3。

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.对于这样的案例,我假设您使用案例 2,因为它们的大 O 是相同的,但这似乎不符合我能找到的等式。 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.似乎我在将 f(n) 直接从原始递归关系中取出而不是大 O 时犯了一个错误,因为这对我来说似乎很有意义,但我找不到任何关于这个或任何例子的澄清其中方程中 f(n) 的空间还不是它自己的大 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)) .因为我有它,我正在谈论的案例 2 的主定理看起来像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 .我认为重要的一点是,是否从以 + xn k结尾的等式中提取 f(n) = xn k或 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.我认为真正重要的是,我是否从以 + xnk 结尾的等式中提取 f(n) = xnk 或 f(n) = nk。

Normally you should take f(n) = x * n k .通常你应该采取 f(n) = x * n k Because master theorem defines T(n) to be in the form aT(n/b) + f(n) .因为主定理将 T(n) 定义为 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.如果 x 是一个正常数,f(n) 和 x * f(n) 的增长是相同的。 In the case of f(n) = xn k , They are both Θ(n k ).在 f(n) = xn k的情况下,它们都是 Θ(n k )。 (Or you could say they are both Θ(x * n k ). This is the same set as Θ(n k ).) (或者你可以说它们都是 Θ(x * n k )。这与 Θ(n k ) 的集合相同。)

Since f(n) = Θ(n log b a ), case 2 of master theorem should be used here.由于 f(n) = Θ(n log b a ),这里应该使用主定理的情况 2。 The theorem says T(n) = Θ(n log b a * lgn) in this case.在这种情况下,定理说 T(n) = Θ(n log b a * lgn)。

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) .同样,如果你写Θ(n log b a * lgn)Θ(5 * n log b a * lgn)Θ(x * n log b a * lgn)在这里也没关系。 Multiplying a function with a positive constant doesn't change its asymptotic bounds.将 function 与正常数相乘不会改变其渐近界。 Master theorem gives you just the asymptotical bounds of the function, not its exact value.主定理只给你 function 的渐近界限,而不是它的确切值。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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