证明N! =为O(n ^ N)

编程入门 行业动态 更新时间:2024-10-19 08:45:17
本文介绍了证明N! =为O(n ^ N)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

更新:对不起,我忘了把ñ^ N将O内()

Update: Sorry I forgot to put n^n inside the O()

我的尝试是解决这个递推关系:

My attempt was to solve this recurrence relation:

T(n) = nT(n-1) +1 T(0) = 1;

使用我得到了迭代法第n的n次方,但林不知道这是否是要证明它的方式。

Using the iteration method I got the n^n but Im not sure if this is the way to prove it.

推荐答案

我假设你想证明函数 N!是集合的一个元素为O(n ^ N)。这可以很容易地被证明:

I assume that you want to prove that the function n! is an element of the set O(n^n). This can be proven quite easily:

定义:函数 F(N)是一组元素 O(G(N))如果存在一个 C> 0 这样存在一个 M ,使得对所有的 K>米我们有一个 F(K)< = C *克(K)

Definition: A function f(n) is element of the set O(g(n)) if there exists a c>0 such that there exists a m such that for all k>m we have that f(k)<=c*g(k).

所以,我们要比较 N!对ñ^ N 。让我们把它们写之一的另一个问题:

So, we have to compare n! against n^n. Let's write them one under another:

n! = n * (n-1) * (n-2) * (n-3) * ... * 3 * 2 * 1 n^n = n * n * n * n * ... * n * n * n

正如你可以看到,第一行( N!)和第二行(ñ^ N )有右侧两个完全 N 项目。如果我们比较这些产品,我们看到,每一个项目是至多一样大,因为它是在第二行相应的项目。因此, N! &LT; = N ^ N (至少对N> 5)。

As you can see, the first line (n!) and the second line (n^n) have both exactly n items on the right side. If we compare these items, we see that every item is at most as large as it's corresponding item in the second line. Thus n! <= n^n (at least for n>5).

因此​​,我们可以 - 看一下定义 - 也就是说,这存在 C = 1 等,存在着 M = 5 ,使得对所有的 K&GT; 5 我们有一个 K! &LT; K ^氏/ code>,这证明了 N!确实的元素为O(n ^ N)。

So, we can - look at the definition - say, that there exists c=1 such that there exists m=5 such that for all k>5 we have that k! < k^k, which proves that n! is indeed an element of O(n^n).

更多推荐

证明N! =为O(n ^ N)

本文发布于:2023-11-30 09:34:56,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1649516.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!