You are on page 1of 40

Growth of functions

Notation properties
Home Work

Growth of functions

Bruno P. dos Santos

Algorithms and Data Structures

bruno.ps@ufop.edu.br

Lectures are based courses from MIT, AEDS II UFMG, ED UFBA, ED Unicamp, PAA UESC,
and my knowledge about the subject.

1/19
Bruno P. dos Santos Growth of functions
Growth of functions
Notation properties
Home Work

Content

1 Growth of functions

2 Notation properties

3 Home Work

2/19
Bruno P. dos Santos Growth of functions
Growth of functions
Notation properties
Home Work

Content

1 Growth of functions

2 Notation properties

3 Home Work

2/19
Bruno P. dos Santos Growth of functions
Growth of functions
Notation properties
Home Work

Content

1 Growth of functions

2 Notation properties

3 Home Work

2/19
Bruno P. dos Santos Growth of functions
Asymptotic Notation
O-notation
Growth of functions
Ω-notation
Notation properties
Θ-notation
Home Work
o-notation
ω-notation

The running time depends on the size of input


• For large enough inputs, the multiplicative constants and lower-order
terms of an exact running time are dominated by the effects of the
input size itself
• Functions representing algorithm complexity are always positive
• The asymptotic comparison is always done disregarding lower terms
and leading constants.

3/19
Bruno P. dos Santos Growth of functions
Asymptotic Notation
O-notation
Growth of functions
Ω-notation
Notation properties
Θ-notation
Home Work
o-notation
ω-notation

Figure: Growth of functions from 1 to 10.

Function 102 103 105 107 1010


logn 2 3 5 7 10
n 102 103 105 107 1010
nlogn 2 · 102 3 · 103 5 · 105 7 · 107 1011
n2 104 106 1010 1014 1020
6
2n 1, 2 · 1030 10301 1030.103 103·10 ?
4/19
Bruno P. dos Santos Growth of functions
Asymptotic Notation
O-notation
Growth of functions
Ω-notation
Notation properties
Θ-notation
Home Work
o-notation
ω-notation

O-notation
O(g (n)) = {f (n) : there exist positive constants c and n0 such that
0 ≤ f (n) ≤ c · g (n) for all n ≥ n0 }

I.e., if f (n) ∈ O(g (n)) means that f (n) grows at most as fast as g (n).

• Asymptotic upper bound


• We use it to bound the
worst-case running time
• Pronounced “Oh of g of
n”

5/19
Bruno P. dos Santos Growth of functions
Asymptotic Notation
O-notation
Growth of functions
Ω-notation
Notation properties
Θ-notation
Home Work
o-notation
ω-notation

O-notation: example
n2 + 5n ∈ O(n2 ) or we can write n2 + 5n = O(n2 )

We want:
• 0 ≤ n2 + 5n ≤ cn2 for all n ≥ n0
• 5n ≥ (c − 1)n2 , then c > 1
if c = 2 for instance:
• 5n ≤ n2
• then, n0 = 5

• n2 + 5n ∈ O(n2 ), because 0 ≤ n2 + 5n ≤ 2n2 for all n ≥ 5.

6/19
Bruno P. dos Santos Growth of functions
Asymptotic Notation
O-notation
Growth of functions
Ω-notation
Notation properties
Θ-notation
Home Work
o-notation
ω-notation

O-notation: example
n2 + 5n ∈ O(n2 ) or we can write n2 + 5n = O(n2 )

We want:
• 0 ≤ n2 + 5n ≤ cn2 for all n ≥ n0
• 5n ≥ (c − 1)n2 , then c > 1
if c = 2 for instance:
• 5n ≤ n2
• then, n0 = 5

• n2 + 5n ∈ O(n2 ), because 0 ≤ n2 + 5n ≤ 2n2 for all n ≥ 5.

6/19
Bruno P. dos Santos Growth of functions
Asymptotic Notation
O-notation
Growth of functions
Ω-notation
Notation properties
Θ-notation
Home Work
o-notation
ω-notation

O-notation: example
n2 + 5n ∈ O(n2 ) or we can write n2 + 5n = O(n2 )

We want:
• 0 ≤ n2 + 5n ≤ cn2 for all n ≥ n0
• 5n ≥ (c − 1)n2 , then c > 1
if c = 2 for instance:
• 5n ≤ n2
• then, n0 = 5

• n2 + 5n ∈ O(n2 ), because 0 ≤ n2 + 5n ≤ 2n2 for all n ≥ 5.

6/19
Bruno P. dos Santos Growth of functions
Asymptotic Notation
O-notation
Growth of functions
Ω-notation
Notation properties
Θ-notation
Home Work
o-notation
ω-notation

O-notation: example
n2 + 5n ∈ O(n2 ) or we can write n2 + 5n = O(n2 )

We want:
• 0 ≤ n2 + 5n ≤ cn2 for all n ≥ n0
• 5n ≥ (c − 1)n2 , then c > 1
if c = 2 for instance:
• 5n ≤ n2
• then, n0 = 5

• n2 + 5n ∈ O(n2 ), because 0 ≤ n2 + 5n ≤ 2n2 for all n ≥ 5.

6/19
Bruno P. dos Santos Growth of functions
Asymptotic Notation
O-notation
Growth of functions
Ω-notation
Notation properties
Θ-notation
Home Work
o-notation
ω-notation

O-notation: example
n2 + 5n ∈ O(n2 ) or we can write n2 + 5n = O(n2 )

We want:
• 0 ≤ n2 + 5n ≤ cn2 for all n ≥ n0
• 5n ≥ (c − 1)n2 , then c > 1
if c = 2 for instance:
• 5n ≤ n2
• then, n0 = 5

• n2 + 5n ∈ O(n2 ), because 0 ≤ n2 + 5n ≤ 2n2 for all n ≥ 5.

6/19
Bruno P. dos Santos Growth of functions
Asymptotic Notation
O-notation
Growth of functions
Ω-notation
Notation properties
Θ-notation
Home Work
o-notation
ω-notation

Ω-notation
Ω(g (n)) = {f (n) : there exist positive constants c and n0 such that
0 ≤ c · g (n) ≤ f (n) for all n ≥ n0 }

I.e., if f (n) ∈ Ω(g (n)) means that f (n) grows at least as slowly as g (n)

• Asymptotic lower bound


• Pronounced “Omega of
g of n”

7/19
Bruno P. dos Santos Growth of functions
Asymptotic Notation
O-notation
Growth of functions
Ω-notation
Notation properties
Θ-notation
Home Work
o-notation
ω-notation

Ω-notation: example
n3 − n2 ∈ Ω(n3 )

We want:
• n3 − n2 ≥ cn3 ≥ 0 for all n ≥ n0
• n2 ≤ (1 − c)n3 , or simply: 1 ≤ (1 − c)n
1
if c = 2 for instance:
• 1 ≤ 12 n
• then, n0 = 2

• n3 − n2 ∈ Ω(n3 ), because n3 − n2 ≥ 21 n3 ≥ 0 for all n ≥ 2.

8/19
Bruno P. dos Santos Growth of functions
Asymptotic Notation
O-notation
Growth of functions
Ω-notation
Notation properties
Θ-notation
Home Work
o-notation
ω-notation

Ω-notation: example
n3 − n2 ∈ Ω(n3 )

We want:
• n3 − n2 ≥ cn3 ≥ 0 for all n ≥ n0
• n2 ≤ (1 − c)n3 , or simply: 1 ≤ (1 − c)n
1
if c = 2 for instance:
• 1 ≤ 12 n
• then, n0 = 2

• n3 − n2 ∈ Ω(n3 ), because n3 − n2 ≥ 21 n3 ≥ 0 for all n ≥ 2.

8/19
Bruno P. dos Santos Growth of functions
Asymptotic Notation
O-notation
Growth of functions
Ω-notation
Notation properties
Θ-notation
Home Work
o-notation
ω-notation

Ω-notation: example
n3 − n2 ∈ Ω(n3 )

We want:
• n3 − n2 ≥ cn3 ≥ 0 for all n ≥ n0
• n2 ≤ (1 − c)n3 , or simply: 1 ≤ (1 − c)n
1
if c = 2 for instance:
• 1 ≤ 12 n
• then, n0 = 2

• n3 − n2 ∈ Ω(n3 ), because n3 − n2 ≥ 21 n3 ≥ 0 for all n ≥ 2.

8/19
Bruno P. dos Santos Growth of functions
Asymptotic Notation
O-notation
Growth of functions
Ω-notation
Notation properties
Θ-notation
Home Work
o-notation
ω-notation

Ω-notation: example
n3 − n2 ∈ Ω(n3 )

We want:
• n3 − n2 ≥ cn3 ≥ 0 for all n ≥ n0
• n2 ≤ (1 − c)n3 , or simply: 1 ≤ (1 − c)n
1
if c = 2 for instance:
• 1 ≤ 12 n
• then, n0 = 2

• n3 − n2 ∈ Ω(n3 ), because n3 − n2 ≥ 21 n3 ≥ 0 for all n ≥ 2.

8/19
Bruno P. dos Santos Growth of functions
Asymptotic Notation
O-notation
Growth of functions
Ω-notation
Notation properties
Θ-notation
Home Work
o-notation
ω-notation

Ω-notation: example
n3 − n2 ∈ Ω(n3 )

We want:
• n3 − n2 ≥ cn3 ≥ 0 for all n ≥ n0
• n2 ≤ (1 − c)n3 , or simply: 1 ≤ (1 − c)n
1
if c = 2 for instance:
• 1 ≤ 12 n
• then, n0 = 2

• n3 − n2 ∈ Ω(n3 ), because n3 − n2 ≥ 21 n3 ≥ 0 for all n ≥ 2.

8/19
Bruno P. dos Santos Growth of functions
Asymptotic Notation
O-notation
Growth of functions
Ω-notation
Notation properties
Θ-notation
Home Work
o-notation
ω-notation

Θ-notation
Θ(g (n)) = {f (n) : there exist positive constants c1 , c2 and n0 such that
0 ≤ c1 · g (n) ≤ f (n) ≤ c2 · g (n) for all n ≥ n0 }

I.e., if f (n) ∈ Θ(g (n)) means that f (n) can be “sandwiched” between
c1 g (n) and c2 g (n). Growing as quickly as g (n).

• Asymptotically tight
bound (limite restrito)
• Pronounced “Theta of g
of n”

9/19
Bruno P. dos Santos Growth of functions
Asymptotic Notation
O-notation
Growth of functions
Ω-notation
Notation properties
Θ-notation
Home Work
o-notation
ω-notation

Θ-notation: example
2n2 + 2n ∈ Θ(n2 )

We want:
• 0 ≤ c1 n2 ≤ 2n2 + 2 ≤ c2 n2 for all n ≥ n0
• For one hand:
• 2n ≤ (2 − c1 )n2 , or simply: 2 ≤ (2 − c1 )n
• Taking c1 = 1, for instance
• then n0 = 2
• For the other hand:
• 2n ≤ (c2 − 2)n2 , or simply: 2 ≤ (c2 − 2)n
• Taking c2 = 3, for instance
• ten n0 = 2

• 2n2 + 2n ∈ Θ(n2 ), because 0 ≤ 1 · n2 ≤ 2n2 + 2n ≤ 3 · n2 for all


n ≥ 2.
10/19
Bruno P. dos Santos Growth of functions
Asymptotic Notation
O-notation
Growth of functions
Ω-notation
Notation properties
Θ-notation
Home Work
o-notation
ω-notation

Θ-notation: example
2n2 + 2n ∈ Θ(n2 )

We want:
• 0 ≤ c1 n2 ≤ 2n2 + 2 ≤ c2 n2 for all n ≥ n0
• For one hand:
• 2n ≤ (2 − c1 )n2 , or simply: 2 ≤ (2 − c1 )n
• Taking c1 = 1, for instance
• then n0 = 2
• For the other hand:
• 2n ≤ (c2 − 2)n2 , or simply: 2 ≤ (c2 − 2)n
• Taking c2 = 3, for instance
• ten n0 = 2

• 2n2 + 2n ∈ Θ(n2 ), because 0 ≤ 1 · n2 ≤ 2n2 + 2n ≤ 3 · n2 for all


n ≥ 2.
10/19
Bruno P. dos Santos Growth of functions
Asymptotic Notation
O-notation
Growth of functions
Ω-notation
Notation properties
Θ-notation
Home Work
o-notation
ω-notation

Θ-notation: example
2n2 + 2n ∈ Θ(n2 )

We want:
• 0 ≤ c1 n2 ≤ 2n2 + 2 ≤ c2 n2 for all n ≥ n0
• For one hand:
• 2n ≤ (2 − c1 )n2 , or simply: 2 ≤ (2 − c1 )n
• Taking c1 = 1, for instance
• then n0 = 2
• For the other hand:
• 2n ≤ (c2 − 2)n2 , or simply: 2 ≤ (c2 − 2)n
• Taking c2 = 3, for instance
• ten n0 = 2

• 2n2 + 2n ∈ Θ(n2 ), because 0 ≤ 1 · n2 ≤ 2n2 + 2n ≤ 3 · n2 for all


n ≥ 2.
10/19
Bruno P. dos Santos Growth of functions
Asymptotic Notation
O-notation
Growth of functions
Ω-notation
Notation properties
Θ-notation
Home Work
o-notation
ω-notation

Θ-notation: example
2n2 + 2n ∈ Θ(n2 )

We want:
• 0 ≤ c1 n2 ≤ 2n2 + 2 ≤ c2 n2 for all n ≥ n0
• For one hand:
• 2n ≤ (2 − c1 )n2 , or simply: 2 ≤ (2 − c1 )n
• Taking c1 = 1, for instance
• then n0 = 2
• For the other hand:
• 2n ≤ (c2 − 2)n2 , or simply: 2 ≤ (c2 − 2)n
• Taking c2 = 3, for instance
• ten n0 = 2

• 2n2 + 2n ∈ Θ(n2 ), because 0 ≤ 1 · n2 ≤ 2n2 + 2n ≤ 3 · n2 for all


n ≥ 2.
10/19
Bruno P. dos Santos Growth of functions
Asymptotic Notation
O-notation
Growth of functions
Ω-notation
Notation properties
Θ-notation
Home Work
o-notation
ω-notation

Θ-notation: example
2n2 + 2n ∈ Θ(n2 )

We want:
• 0 ≤ c1 n2 ≤ 2n2 + 2 ≤ c2 n2 for all n ≥ n0
• For one hand:
• 2n ≤ (2 − c1 )n2 , or simply: 2 ≤ (2 − c1 )n
• Taking c1 = 1, for instance
• then n0 = 2
• For the other hand:
• 2n ≤ (c2 − 2)n2 , or simply: 2 ≤ (c2 − 2)n
• Taking c2 = 3, for instance
• ten n0 = 2

• 2n2 + 2n ∈ Θ(n2 ), because 0 ≤ 1 · n2 ≤ 2n2 + 2n ≤ 3 · n2 for all


n ≥ 2.
10/19
Bruno P. dos Santos Growth of functions
Asymptotic Notation
O-notation
Growth of functions
Ω-notation
Notation properties
Θ-notation
Home Work
o-notation
ω-notation

Θ-notation: example
2n2 + 2n ∈ Θ(n2 )

We want:
• 0 ≤ c1 n2 ≤ 2n2 + 2 ≤ c2 n2 for all n ≥ n0
• For one hand:
• 2n ≤ (2 − c1 )n2 , or simply: 2 ≤ (2 − c1 )n
• Taking c1 = 1, for instance
• then n0 = 2
• For the other hand:
• 2n ≤ (c2 − 2)n2 , or simply: 2 ≤ (c2 − 2)n
• Taking c2 = 3, for instance
• ten n0 = 2

• 2n2 + 2n ∈ Θ(n2 ), because 0 ≤ 1 · n2 ≤ 2n2 + 2n ≤ 3 · n2 for all


n ≥ 2.
10/19
Bruno P. dos Santos Growth of functions
Asymptotic Notation
O-notation
Growth of functions
Ω-notation
Notation properties
Θ-notation
Home Work
o-notation
ω-notation

Θ-notation: example
2n2 + 2n ∈ Θ(n2 )

We want:
• 0 ≤ c1 n2 ≤ 2n2 + 2 ≤ c2 n2 for all n ≥ n0
• For one hand:
• 2n ≤ (2 − c1 )n2 , or simply: 2 ≤ (2 − c1 )n
• Taking c1 = 1, for instance
• then n0 = 2
• For the other hand:
• 2n ≤ (c2 − 2)n2 , or simply: 2 ≤ (c2 − 2)n
• Taking c2 = 3, for instance
• ten n0 = 2

• 2n2 + 2n ∈ Θ(n2 ), because 0 ≤ 1 · n2 ≤ 2n2 + 2n ≤ 3 · n2 for all


n ≥ 2.
10/19
Bruno P. dos Santos Growth of functions
Asymptotic Notation
O-notation
Growth of functions
Ω-notation
Notation properties
Θ-notation
Home Work
o-notation
ω-notation

Θ-notation: example
2n2 + 2n ∈ Θ(n2 )

We want:
• 0 ≤ c1 n2 ≤ 2n2 + 2 ≤ c2 n2 for all n ≥ n0
• For one hand:
• 2n ≤ (2 − c1 )n2 , or simply: 2 ≤ (2 − c1 )n
• Taking c1 = 1, for instance
• then n0 = 2
• For the other hand:
• 2n ≤ (c2 − 2)n2 , or simply: 2 ≤ (c2 − 2)n
• Taking c2 = 3, for instance
• ten n0 = 2

• 2n2 + 2n ∈ Θ(n2 ), because 0 ≤ 1 · n2 ≤ 2n2 + 2n ≤ 3 · n2 for all


n ≥ 2.
10/19
Bruno P. dos Santos Growth of functions
Asymptotic Notation
O-notation
Growth of functions
Ω-notation
Notation properties
Θ-notation
Home Work
o-notation
ω-notation

Θ-notation: example
2n2 + 2n ∈ Θ(n2 )

We want:
• 0 ≤ c1 n2 ≤ 2n2 + 2 ≤ c2 n2 for all n ≥ n0
• For one hand:
• 2n ≤ (2 − c1 )n2 , or simply: 2 ≤ (2 − c1 )n
• Taking c1 = 1, for instance
• then n0 = 2
• For the other hand:
• 2n ≤ (c2 − 2)n2 , or simply: 2 ≤ (c2 − 2)n
• Taking c2 = 3, for instance
• ten n0 = 2

• 2n2 + 2n ∈ Θ(n2 ), because 0 ≤ 1 · n2 ≤ 2n2 + 2n ≤ 3 · n2 for all


n ≥ 2.
10/19
Bruno P. dos Santos Growth of functions
Asymptotic Notation
O-notation
Growth of functions
Ω-notation
Notation properties
Θ-notation
Home Work
o-notation
ω-notation

Θ-notation: example
2n2 + 2n ∈ Θ(n2 )

We want:
• 0 ≤ c1 n2 ≤ 2n2 + 2 ≤ c2 n2 for all n ≥ n0
• For one hand:
• 2n ≤ (2 − c1 )n2 , or simply: 2 ≤ (2 − c1 )n
• Taking c1 = 1, for instance
• then n0 = 2
• For the other hand:
• 2n ≤ (c2 − 2)n2 , or simply: 2 ≤ (c2 − 2)n
• Taking c2 = 3, for instance
• ten n0 = 2

• 2n2 + 2n ∈ Θ(n2 ), because 0 ≤ 1 · n2 ≤ 2n2 + 2n ≤ 3 · n2 for all


n ≥ 2.
10/19
Bruno P. dos Santos Growth of functions
Asymptotic Notation
O-notation
Growth of functions
Ω-notation
Notation properties
Θ-notation
Home Work
o-notation
ω-notation

o-notation
o(g (n)) = {f (n) : for any positive constant c > 0, there exist a
constant n0 such that 0 ≤ f (n) < cg (n) for all n ≥ n0 }

I.e., if f (n) ∈ o(g (n)) means that f (n) grows more slowly than g (n).

• Intuitively, in o-notation, the function f (n) becomes insignificant


relative to g (n) as n approaches infinity
f (n)
• limn→∞ g (n) =0

o-notation: example
100n2 ∈ o(n3 )

We want: for all c > 0∃n0 > 0 that satisfy the definition.
• 100n2 < cn3 , or simply: 100 < cn
• we can take: n0 = 100
c +1
11/19
Bruno P. dos Santos Growth of functions
Asymptotic Notation
O-notation
Growth of functions
Ω-notation
Notation properties
Θ-notation
Home Work
o-notation
ω-notation

o-notation
o(g (n)) = {f (n) : for any positive constant c > 0, there exist a
constant n0 such that 0 ≤ f (n) < cg (n) for all n ≥ n0 }

I.e., if f (n) ∈ o(g (n)) means that f (n) grows more slowly than g (n).

• Intuitively, in o-notation, the function f (n) becomes insignificant


relative to g (n) as n approaches infinity
f (n)
• limn→∞ g (n) =0

o-notation: example
100n2 ∈ o(n3 )

We want: for all c > 0∃n0 > 0 that satisfy the definition.
• 100n2 < cn3 , or simply: 100 < cn
• we can take: n0 = 100
c +1
11/19
Bruno P. dos Santos Growth of functions
Asymptotic Notation
O-notation
Growth of functions
Ω-notation
Notation properties
Θ-notation
Home Work
o-notation
ω-notation

ω-notation
ω(g (n)) = {f (n) : for any positive constant c > 0, there exist a
constant n0 such that 0 ≤ cg (n) < f (n) for all n ≥ n0 }

I.e., if f (n) ∈ o(g (n)) means that f (n) grows faster than g (n).

• Intuitively, in ω-notation, the function f (n) becomes significant


relative to g (n) as n approaches infinity
f (n)
g (n) = ∞
• limn→∞

ω-notation: example
n3
1000 ∈ ω(n2 )

We want: for all c > 0∃n0 > 0 that satisfy the definition.
n3 n
• > cn2 , or simply: 1000
1000 <c
• we can take: n0 = 1000c + 1
12/19
Bruno P. dos Santos Growth of functions
Asymptotic Notation
O-notation
Growth of functions
Ω-notation
Notation properties
Θ-notation
Home Work
o-notation
ω-notation

ω-notation
ω(g (n)) = {f (n) : for any positive constant c > 0, there exist a
constant n0 such that 0 ≤ cg (n) < f (n) for all n ≥ n0 }

I.e., if f (n) ∈ o(g (n)) means that f (n) grows faster than g (n).

• Intuitively, in ω-notation, the function f (n) becomes significant


relative to g (n) as n approaches infinity
f (n)
g (n) = ∞
• limn→∞

ω-notation: example
n3
1000 ∈ ω(n2 )

We want: for all c > 0∃n0 > 0 that satisfy the definition.
n3 n
• > cn2 , or simply: 1000
1000 <c
• we can take: n0 = 1000c + 1
12/19
Bruno P. dos Santos Growth of functions
Definition
Comparing functions
Growth of functions
Transitivity
Notation properties
Reflexivity
Home Work
Symmetry
An simple analogy

Relation between notation (classes)

f (n)
• f (n) ∈ o(g (n)) if limn→∞ g (n) =0
• f (n) ∈ O(g (n)) if limn→∞ gf (n)
(n) ≥0
f (n)
• f (n) ∈ Θ(g (n)) if 0 < limn→∞ g (n) <∞
f (n)
• f (n) ∈ Ω(g (n)) if 0 < limn→∞ g (n) ≤∞
f (n)
• f (n) ∈ ω(g (n)) if limn→∞ g (n) =∞

13/19
Bruno P. dos Santos Growth of functions
Definition
Comparing functions
Growth of functions
Transitivity
Notation properties
Reflexivity
Home Work
Symmetry
An simple analogy

Many of the relational properties of real numbers apply to asymptotic


comparisons as well. For the following, assume that f (n) and g (n) are
asymptotically positive.

14/19
Bruno P. dos Santos Growth of functions
Definition
Comparing functions
Growth of functions
Transitivity
Notation properties
Reflexivity
Home Work
Symmetry
An simple analogy

• If f (n) ∈ o(g (n)) and g (n) ∈ o(h(n)) imply f (n) ∈ o(h(n))


• If f (n) ∈ O(g (n)) and g (n) ∈ O(h(n)) imply f (n) ∈ O(h(n))
• If f (n) ∈ Θ(g (n)) and g (n) ∈ Θ(h(n)) imply f (n) ∈ Θ(h(n))
• If f (n) ∈ Ω(g (n)) and g (n) ∈ Ω(h(n)) imply f (n) ∈ Ω(h(n))
• If f (n) ∈ ω(g (n)) and g (n) ∈ ω(h(n)) imply f (n) ∈ ω(h(n))

15/19
Bruno P. dos Santos Growth of functions
Definition
Comparing functions
Growth of functions
Transitivity
Notation properties
Reflexivity
Home Work
Symmetry
An simple analogy

• f (n) ∈ O(f (n))


• f (n) ∈ Ω(f (n))
• f (n) ∈ Θ(f (n))

• f (n) ∈
/ o(f (n))
• f (n) ∈
/ ω(f (n))

16/19
Bruno P. dos Santos Growth of functions
Definition
Comparing functions
Growth of functions
Transitivity
Notation properties
Reflexivity
Home Work
Symmetry
An simple analogy

• Symmetry
• f (n) ∈ Θ(g (n)) iff (if and only if) g (n) ∈ Θ(f (n))

• Transpose Symmetry
• f (n) ∈ O(g (n)) iff g (n) ∈ Ω(f (n))
• f (n) ∈ o(g (n)) iff g (n) ∈ ω(f (n))

17/19
Bruno P. dos Santos Growth of functions
Definition
Comparing functions
Growth of functions
Transitivity
Notation properties
Reflexivity
Home Work
Symmetry
An simple analogy

Draw an analogy
• f (n) ∈ o(g (n)) is like a < b
• f (n) ∈ O(g (n)) is like a ≤ b
• f (n) ∈ Θ(g (n)) is like a = b
• f (n) ∈ Ω(g (n)) is like a ≥ b
• f (n) ∈ ω(g (n)) is like a > b

18/19
Bruno P. dos Santos Growth of functions
Growth of functions
Notation properties
Home Work

CLRS book:
• Chapter 3
• Pay attention on 3.2
• Exercises: 3.1-1, 3.1-2, 3.1-3, 3.1-4, 3.1-7
• Problems: 3-1, 3-2, 3-3a, 3-4: a,b,f.

19/19
Bruno P. dos Santos Growth of functions

You might also like