You are on page 1of 15

Analysis

Notasi Asymptotic
Pertemuan : III

Jurusan Teknik Informatika – Universitas Widyatama


Latar belakang

• Terdapat 2 persamaan

• Jika kita misalkan n nilai tertentu maka

IF-UTAMA 2
Latar belakang

• 2 persamaan tersebut memiliki tingkat


pertumbuhan sebanding
• Oleh karena itu orde n2 bisa dikatakan
mewakili T(n)
• Itulah gambaran asimtotik

IF-UTAMA 3
Notasi Asimtotik

IF-UTAMA 4
Big-oh
Big Oh

Definition: f(n) is in O(g(n)), denoted f(n)  O(g(n)), if


order of growth of f(n) ≤ order of growth of g(n) (within
constant multiple), i.e., there exist positive constant c
and non-negative integer n0 such that
f(n) ≤ c g(n) for every n ≥ n0

Examples:
• 10n is in O(n2)

• 5n+20 is in O(n)
Example

• Buktikan

• Penyelesaian

IF-UTAMA 7
Example

• Buktikan

• Penyelesaian

IF-UTAMA 8
Big-omega
-notation

• Formal definition
– A function t(n) is said to be in (g(n)), denoted t(n)
 (g(n)), if t(n) is bounded below by some
constant multiple of g(n) for all large n, i.e., if there
exist some positive constant c and some
nonnegative integer n0 such that
t(n)  cg(n) for all n  n0

• Example
Example

• Buktikan

• Penyelesaian

IF-UTAMA 11
Big-theta
-notation

• Formal definition
– A function t(n) is said to be in (g(n)), denoted t(n)
 (g(n)), if t(n) is bounded both above and below
by some positive constant multiples of g(n) for all
large n, i.e., if there exist some positive constant c1
and c2 and some nonnegative integer n0 such that
c2 g(n)  t(n)  c1 g(n) for all n  n0
Contoh

• Buktikan

• Penyelesaian
– Batas atas

• Untuk semua n >= 0 (c = 2, dan n0 = 0)


– Batas Bawah

• Untuk semua n >= 0 (c = 1, dan n0 = 0)


IF-UTAMA 14
Latihan Soal

• Tentukan apakah persamaan dibawah


benar atau salah
– n(n+1)/2 є O(n3)
– n(n+1)/2 є O(n2)
– n(n+1)/2 є (n3)
– n(n+1)/2 є (n)

IF-UTAMA 15

You might also like