简体   繁体   English

朗道符号/大 O 符号

[英]Landau Notation/Big O notation

In our class the following exercise/example was given:在我们的 class 中,给出了以下练习/示例:

Compute n_0 and c from the formal definition of each Landau symbol to show that:根据每个朗道符号的正式定义计算 n_0 和 c 以表明:

2^100n belongs O(n^2). 2^100n 属于 O(n^2)。

Then in the Solution the following was done:然后在解决方案中完成了以下操作:

n_0=2^100 and c=1. n_0=2^100 和 c=1。

Show for each n>n_0: 2^100*n=<n^2.为每个 n>n_0 显示:2^100*n=<n^2。

It is true that: n_0^2=2^100 n_0 and for all n>2^100: n^2-2^100n>n^2 -n n=n^2 - n^2=0.确实:n_0^2=2^100 n_0 并且对于所有 n>2^100:n^2-2^100n>n^2 -n n=n^2 - n^2=0。

I have some questions:我有一些问题:

  1. We are looking for n_0 and c, but somehow we give values to them?我们正在寻找 n_0 和 c,但是我们以某种方式给它们赋值? And why those values in particular?为什么特别是这些价值观? Why can't n_0=2?为什么不能 n_0=2? and c=34? c=34? Is there a logic behind all of this?这一切背后有逻辑吗?

  2. In the last part, I don't see how that expression proves anything, it looks redundant在最后一部分,我看不出这个表达式是如何证明什么的,它看起来是多余的

If you read the definition of big-O notation, it is precisely so that if you can find one such n 0 and c that the inequality holds for all numbers greater than n 0 , then the big-O relation holds.如果您阅读大 O 表示法的定义,正是因此,如果您能找到一个这样的n 0c不等式适用于所有大于n 0的数字,那么大 O 关系成立。

Of course you can choose another n 0 , for example a bigger one.当然,您可以选择另一个n 0 ,例如更大的一个。 As long as you find one, you have proven the relation.只要你找到一个,你就证明了这种关系。

Although for better help with such questions, I recommend Math.stachexchange or CS.stakhexchange .尽管为了更好地解决此类问题,我推荐Math.stachexchangeCS.stakhexchange

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

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