θ−notation
f(n)=θ(g(n))≈f(n)=g(n) in degree

O−notation
f(n)=θ(g(n))≈f(n)≤g(n) in degree
- Upper bound
- g(n) is an upper bound of f(n): g(n)이 실수 전체 n에 대해 f(n) 보다 작다.

- Asymptotic upper bound
- f(n)=O(g(n))
- 0≤f(n)≤cg(n) for all n0≤n
- n0≤n인 모든 양수 n에 대해 위 조건을 만족시키는 양수 c가 존재하는 경우
Ω−notation
f(n)=θ(g(n))≈f(n)≤g(n) in degree

Asymptotic notation
Asymptotic notation에서 c와 n0를 찾기 위해서 각 변을 nd(d는 차수)로 나누고 n=1부터 대입한다.
일반적으로 p(n)=i=0∑daini 은 p(n)=θ(nd) 이다.
추가적인 Asymptotic notation
o−notation
f(n)=o(g(n))≈f(n)<g(n)
omega−notation
f(n)=ω(g(n))≈f(n)>g(n)
Time-complexity of sorting algorithm
| 알고리즘 | 최선의 경우 (Best Case) | 최악의 경우 (Worst Case) |
|---|
| Insertion Sort | Θ(n) | Θ(n²) |
| Selection Sort | Θ(n²) | Θ(n²) |
| Merge Sort | Θ(n log n) | Θ(n log n) |
| Binary Search | Θ(1) | Θ(log n) |
Comparision of functions
f(n) and g(n) are asymptotically positive (n이 충분히 클 때, 양수)라고 가정하자
Transitivity (=,≤,≥,<,>)
-
(f(n)=Θ(g(n)) and (g(n)=Θ(h(n)) imply (f(n)=Θ(h(n))
-
f(n)=O(g(n))) and (g(n)=O(h(n))) imply (f(n)=O(h(n)))
-
(f(n)=Ω(g(n))) and (g(n)=Ω(h(n))) imply (f(n)=Ω(h(n)))
-
(f(n)=o(g(n))) and (g(n)=o(h(n))) imply (f(n)=o(h(n)))
-
(f(n)=Θ(g(n))) and (g(n)=Θ(h(n))) imply (f(n)=Θ(h(n)))
Reflexivity (=,≤,≥)
- (f(n)=Θ(f(n)))
- (f(n)=O(f(n)))
- (f(n)=Ω(f(n)))
Symmetry (=)
- (f(n)=Θ(g(n))) if and only if (g(n)=Θ(f(n)))
Transpose symmetry (≤↔≥, <↔>)
- (f(n)=O(g(n))) if and only if (g(n)=Ω(f(n)))
- (f(n)=o(g(n))) if and only if (g(n)=ω(f(n)))
Trichotomy
어떤 실수 a, b에 대하여, a<b, a=b, a>b 중 하나는 반드시 성립한다.
두 함수가 항상 asymptotic comparable 할까?
f(n) ≠ O(g(n)) & f(n) ≠ Ω (g(n))이 가능할까?
- f(n) = n, g(n) = n1+sin(n) 이라고 가정하자.
- −1≤1+sin(n)≤1 이기 때문에 n0≤n1+sin(n)≤n2이다.
- (2)에 따라 n1+sin(n) 는 진동하기 때문에 특정 구간에서 비교가 불가능 하다.
- 따라서 f(n) ≠ O(g(n)) & f(n) ≠ Ω (g(n))이 가능한 경우가 있다.