Untitled

tobiasc.dk

Untitled

x ≥ 0 y ≥ 0 |x| + |y| = x + y = |x + y|

x ≥ 0 y < 0 |x| + |y| = x + (−y) > x + y = |x + y| y

−y > y

x < 0 y ≥ 0

|x| + |y| = (−x) + y > x + y = |x + y|

x < 0 y < 0 |x| + |y| = (−x) + (−y) = −(x + y) = |x + y|


f(x) = an·x n +an−1·x n−1 +...+a1·x+a0 a0, a1, ..., an−1, an

f(x) O(x n ) O(x n )

f

k = 1 x > 1


|f(x)| = |anx n + an−1x n−1 + ... + a1x + a0|

≤ |an|x n + |an−1|x n−1 + ... + |a1|x + |a0|

= x n


|an| + |an−1|

x

|a1|x |a0|

+ ... + +

xn−1 xn



≤ x n (|an| + |an−1| + ... + |a1| + |a0|)

= Cx n


x

x x

x n



k = 1

C = |an| + |an−1| + ... + |a1|n + |a0|

f(x) = 2 · x 7 − 5 · x 5 + 3 · x 4 − 3 · x + 5

f(x) O(x 7 ) f(x)



f1(x) O(g1(x)) f2(x) O(g2(x)) (f1+f2)(x) O(max(|g1(x)|, |g2(x)|))

f1(x) O(g1(x)) f2(x) O(g2(x)) (f1 · f2)(x) O(g1(x) · g2(x))



Similar magazines