Sie sind auf Seite 1von 1

Properties of O Notation

Let F denote the set of all fucntions from the natural numbers to the nonnegative reals. Then O(f ) = {g F | c R+ .b N.n N.(n b implies g (n) cf (n))} (f ) = {g F | c R+ .b N.n N.(n b implies g (n) cf (n))} (f ) = {g F | c1 R+ .c2 R+ .b N.n N.(n b implies c1 (n) g (n) c2 f (n))} = O(f ) (f ) Constant factors do not matter: If d R+ and f F , then df is in O(f ) and f (n) is in O(df ). Low order terms do not matter: h(n) If lim = 0, then g + h O(g ). n g (n) Transitivity: If f O(g ) and g O(h), then f O(h). Summation rule: If f1 O(g1 ) and f2 O(g2 ), then f1 + f2 O(g1 + g2 ). Product rule: If f1 O(g1 ) and f2 O(g2 ), then f1 f2 O(g1 g2 ). f + g O(max{f, g }). If f O(g ), then max{f, g } O(g ). Let a, b R. Then Exponents do matter: If a b, then na O(nb ). If a > b, then na is not in O(nb ). Bases of exponents do matter: If 1 < a b, then an O(bn ). If 1 < b < a, then an is not in O(bn ). Bases of logarithms do not matter: For all a, b > 1, loga (n) O(logb n). Exponential functions grow faster than polynomial functions: For all b > 1 and all a, na O(bn ), but bn is not in O(na ). Polynomial functions grow faster than polylogarithmic functions: For all a, b > 0, (log n)a O(nb ), but nb is not in O((log n)a ). Similar properties hold for and .

Das könnte Ihnen auch gefallen