Web - Amazon

We provide Linux to the World


We support WINRAR [What is this] - [Download .exe file(s) for Windows]

CLASSICISTRANIERI HOME PAGE - YOUTUBE CHANNEL
SITEMAP
Audiobooks by Valerio Di Stefano: Single Download - Complete Download [TAR] [WIM] [ZIP] [RAR] - Alphabetical Download  [TAR] [WIM] [ZIP] [RAR] - Download Instructions

Make a donation: IBAN: IT36M0708677020000000008016 - BIC/SWIFT:  ICRAITRRU60 - VALERIO DI STEFANO or
Privacy Policy Cookie Policy Terms and Conditions
大O符号 - Wikipedia

大O符号

维基百科,自由的百科全书

注:“order”在全文中被译为“阶”,也可以另译为“数量级”。

大O符号(Big O notation)是用于描述函数渐进行为的数学符号。更确切地说,它是用另一个(通常更简单的)函数来描述一个函数数量级渐近上界。在数学中,它一般用来刻画被截断的无穷级数尤其是渐近级数的剩余项;在计算机科学中,它在分析算法复杂性的方面非常有用。

大O符号是由德国数论学家保罗·巴赫曼(Paul Bachmann)在其1892年的著作《解析数论》(Analytische Zahlentheorie)首先引入的。而这个记号则是在另一位德国数论学家艾德蒙·朗道(Edmund Landau)的著作中才推广的,因此它有时又称为朗道符号(Landau symbol)。代表“order of ...”(……阶)的大O,最初是一个大写的希腊字母'Ο'(Omicron),现今用的是英文大写字母'O',但从来不是阿拉伯数字'0'。

目录

[编辑] 使用

这个符号有两种形式上很接近但迥然不同的使用方法:无穷大渐进与无穷小渐进。然而这个区别只是在运用中的而不是原则上的——除了对函数自变量的一些不同的限定,“大O”的形式定义在两种情况下都是相同的。

[编辑] 无穷大渐进

大O符号在分析算法效率的时候非常有用。举个例子,解决一个规模为 n 的问题所花费的时间(或者所需步骤的数目)可以被求得:T(n) = 4n² - 2n + 2。

n 增大时,n² 项将开始占主导地位,而其他各项可以被忽略——举例说明:当 n = 500,4n² 项是 2n 项的1000倍大,因此在大多数场合下,省略后者对表达式的值的影响将是可以忽略不计的。

进一步看,如果我们与任一其他级的表达式比较,n² 项的系数也是无关紧要的。例如一个包含 n³ 或 2n 项的表达式,即使 T(n) = 1,000,000n²,假定 U(n) = n³,一旦 n 增长到大于1,000,000,后者就会一直超越前者(T(1,000,000) = 1,000,000³ = U(1,000,000))。

这样,大O符号就记下剩余的部分,写作:

T(n)\in O(n^2)

并且我们就说该算法具有 n2(平方阶)的时间复杂度。

[编辑] 无穷小渐进

大O也可以用来描述数学函数估计中的误差项。例如:

e^x=1+x+x^2/2+\hbox{O}(x^3)\qquad\ x\to 0

这表示,如果 x 足够接近于0,那么误差(ex − (1 + x + x2 / 2)的差)的绝对值小于 x3 的某一常数倍。

[编辑] 形式化定义

[编辑] 常用的函数阶

下面是在分析算法的时候常见的函数分类列表。所有这些函数都处于“n”趋近于无穷大的情况下,增长得慢的函数列在上面。“c”是一个任意常数。

符号 名称
O(1) 常数(阶,下同)
O(log * n) 迭代对数
O(logn) 对数
O([logn]c) 多对数
o(n) 次线性
O(n) 线性
O(nlogn) 线性对数,或对数线性、拟线性、超线性
O(n2) 平方
O(nc), c > 1 多项式,有时叫作“代数”(阶)
O(cn) 指数,有时叫作“几何”(阶)
O(n!) 阶乘,有时叫做“组合”(阶)

[编辑] 一些相关的渐进符号

大O是最经常使用的比较函数的渐进符号。

符号 定义
f(n) = O(g(n)) 渐进上限
f(n) = o(g(n)) asymptotically negligible (M = 0)
f(n) = Ω(g(n)) 渐进下限 (当且仅当 g(n) = O(f(n)))
f(n) = ω(g(n)) asymptotically dominant (当且仅当 g(n) = o(f(n)))
f(n) = Θ(g(n)) asymptotically tight bound (当且仅当 both f(n) = O(g(n)) and g(n) = O(f(n)))

[编辑] 参看

[编辑] 参考资料

  • 严蔚敏,吴伟民。数据结构:C语言版。北京清华大学出版社,1996。ISBN 7-302-02368-9。1.4节 算法和算法分析,14-17页。
Our "Network":

Project Gutenberg
https://gutenberg.classicistranieri.com

Encyclopaedia Britannica 1911
https://encyclopaediabritannica.classicistranieri.com

Librivox Audiobooks
https://librivox.classicistranieri.com

Linux Distributions
https://old.classicistranieri.com

Magnatune (MP3 Music)
https://magnatune.classicistranieri.com

Static Wikipedia (June 2008)
https://wikipedia.classicistranieri.com

Static Wikipedia (March 2008)
https://wikipedia2007.classicistranieri.com/mar2008/

Static Wikipedia (2007)
https://wikipedia2007.classicistranieri.com

Static Wikipedia (2006)
https://wikipedia2006.classicistranieri.com

Liber Liber
https://liberliber.classicistranieri.com

ZIM Files for Kiwix
https://zim.classicistranieri.com


Other Websites:

Bach - Goldberg Variations
https://www.goldbergvariations.org

Lazarillo de Tormes
https://www.lazarillodetormes.org

Madame Bovary
https://www.madamebovary.org

Il Fu Mattia Pascal
https://www.mattiapascal.it

The Voice in the Desert
https://www.thevoiceinthedesert.org

Confessione d'un amore fascista
https://www.amorefascista.it

Malinverno
https://www.malinverno.org

Debito formativo
https://www.debitoformativo.it

Adina Spire
https://www.adinaspire.com