当 f(n) = n^.1 且 g(n) = log(n)^10 时,f(n) = Ω(g) 吗?

发布于 2024-12-03 11:58:27 字数 133 浏览 0 评论 0原文

有人告诉我“任何指数都胜过任何对数”。

但是当指数在0到1之间时,对数的执行时间不是增长得快很多吗?因此,按照这种逻辑,f = O(g)

我很难选择是遵循我的直觉还是遵循我被告知的内容,但我被告知的内容可能并不完全准确。

I was told that "any exponential trumps any logarithm".

But when the exponential is between zero and one, doesn't the execution time of the logarithm grow much faster? So by that logic it would be f = O(g)

I'm having trouble choosing whether to follow my intuition or what I've been told, but what I've been told may have been not totally accurate.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

似狗非友 2024-12-10 11:58:27

让我们在这里尝试一些数学。一个重要的事实是对数函数是单调递增的,这意味着如果

log f(x) ≤ log g(x)

那么

f(x) ≤ g(x)

现在,让我们看看它在这里做什么。我们有两个函数,x0.1 和 log10 x。如果我们获取他们的日志,我们会得到

log (x0.1) = 0.1 log x

并且

log (log10 x) = 10 log log x

由于 log log x 的增长速度比 log x 慢得多,直观上我们可以看到函数 x0.1 最终会超过 log10 x。

现在,让我们将其形式化。我们想要找到 x 的某个值,使得

x0.1> log10 x

为了使数学更容易,我们假设这些是以 10 为底的对数。如果我们假设对于某些 k,x​​ = 10k,我们会得到

(10k)0.1 ≥ log10 10k

100.1k> log10 10k

100.1k> k

现在,取 k = 100。现在我们有

100.1 * 100> 100

1010> 100

这显然是正确的。由于两个函数都是单调递增的,这意味着对于 x ≥ 10100,确实有

x0.1> log10 x

这意味着 x0.1 = O(log10 k) 成立。

希望这有帮助!

Let's try out some math here. One important fact is that the logarithm function is monotonically increasing, which means that if

log f(x) ≤ log g(x)

then

f(x) ≤ g(x)

Now, let's see what that does here. We have two functions, x0.1 and log10 x. If we take their logs, we get

log (x0.1) = 0.1 log x

and

log (log10 x) = 10 log log x

Since log log x grows much more slowly than log x, intuitively we can see that the function x0.1 is going to eventually overtake log10 x.

Now, let's formalize this. We want to find some value of x such that

x0.1 > log10 x

Let's suppose that these are base-10 logarithms just to make the math easier. If we assume that x = 10k for some k, we get that

(10k)0.1 ≥ log10 10k

100.1 k > log10 10k

100.1 k > k

Now, take k = 100. Now we have that

100.1 * 100 > 100

1010 > 100

which is clearly true. Since both functions are monotonically increasing, this means that for x ≥ 10100, it is true that

x0.1 > log10 x

Which means that it is not true that x0.1 = O(log10 k).

Hope this helps!

放飞的风筝 2024-12-10 11:58:27

渐近分析真正关注的是长期关系(由于 n 假设较大的值,函数的值如何比较)?它还忽略常量,这就是为什么您有时会看到奇怪的情况,例如 f(x) = 10000000*x = O(x^2)。

对于较大的n值,f(n) > g(n) 这才是真正重要的。

The asymptotic analysis is really focused on the long run relationship (as n assumes larger values, how do the values of the functions compare)? It also disregards constants, which is why you sometimes see strange situations like f(x) = 10000000*x = O(x^2).

For large values of n, f(n) > g(n) which is all that really matters.

‖放下 2024-12-10 11:58:27

使用限制规则验证 n^0.1 = big omega(log^10(n)) 的另一种方法?

限制规则为:

限制为n->无穷大f(n)/g(g)。

<块引用>

如果极限为正无穷大,则 f(n) != O(g(n)) & g(n) = O(f(n)) 或 f(n) = 大欧米伽(g(n))

如果极限为 0,则 f(n) = O(g(n)) & g(n) != O(f(n))

如果极限是正实数,则 f(n) = O(g(n)) & g(n) = O(f(n)) 或 f(n) = 大 t​​heta(g(n))

对于此问题:

设 f(n) = O(n^0.1) 并设 g(n) = log^10(n)

这给了我们极限:

限制为 n->无穷大 ​​(n^0.1)/(log^10(n))

使用 L'Hospital 的极限规则 10 次,我们得到:

限制为 n->无穷大 ​​((0.1)^10 * ln^10(b) * n^0.1)/(10!) 其中 b 是对数的底数

由于 n 项仅在分子中,因此极限接近无穷大。

按极限规则

log^10(n) = O(n^0.1) & n^0.1 != O(log^10(n) 或 n^0.1 = 大欧米伽(log^10(n))。

Another way to verify that n^0.1 = big omega(log^10(n)) by using the limit rule?

The limit rule is:

limit as n->infinity f(n)/g(g).

if the limit is positive infinity, f(n) != O(g(n)) & g(n) = O(f(n)) or f(n) = big omega(g(n))

if the limit is 0, f(n) = O(g(n)) & g(n) != O(f(n))

if the limit is a positive real number, f(n) = O(g(n)) & g(n) = O(f(n)) or f(n) = big theta(g(n))

For this problem:

let f(n) = O(n^0.1) and let g(n) = log^10(n)

That gives us the limit:

limit as n->infinity (n^0.1)/(log^10(n))

Using L'Hospital's rule on the limit 10 times we get:

limit as n->infinity ((0.1)^10 * ln^10(b) * n^0.1)/(10!) where b is the base of the log

Since the n term is only in the numerator, the limit approaches infinity.

By the limit rule

log^10(n) = O(n^0.1) & n^0.1 != O(log^10(n) or n^0.1 = big omega(log^10(n)).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文