2020-1ν•™κΈ°, λŒ€ν•™μ—μ„œ β€˜μ•Œκ³ λ¦¬μ¦˜β€™ μˆ˜μ—…μ„ λ“£κ³  κ³΅λΆ€ν•œ λ°”λ₯Ό μ •λ¦¬ν•œ κΈ€μž…λ‹ˆλ‹€. 지적은 μ–Έμ œλ‚˜ ν™˜μ˜μž…λ‹ˆλ‹€ :)

4 minute read

2020-1ν•™κΈ°, λŒ€ν•™μ—μ„œ β€˜μ•Œκ³ λ¦¬μ¦˜β€™ μˆ˜μ—…μ„ λ“£κ³  κ³΅λΆ€ν•œ λ°”λ₯Ό μ •λ¦¬ν•œ κΈ€μž…λ‹ˆλ‹€. 지적은 μ–Έμ œλ‚˜ ν™˜μ˜μž…λ‹ˆλ‹€ :)

보톡 μš°λ¦¬λŠ” μ–΄λ–€ μ•Œκ³ λ¦¬μ¦˜μ˜ μ„±λŠ₯을 μž…λ ₯ λ°μ΄ν„°μ˜ 크기 $N$에 λŒ€ν•œ ν•¨μˆ˜λ‘œ ν‘œν˜„ν•œλ‹€. 이번 ν¬μŠ€νŠΈμ—μ„œλŠ” μ•Œκ³ λ¦¬μ¦˜μ˜ μ„±λŠ₯을 ν‘œκΈ°ν•˜λŠ” μ—¬λŸ¬ 기법듀에 λŒ€ν•΄ μ‚΄νŽ΄λ³Έλ‹€ 😎

$O$ Notaiton

For two functions $f(n)$ and $g(n)$, $f(n) = O(g(n))$,

iff there exist a constant $c > 0$ and $n_0 \ge 0$ s.t. for all $n \ge n_0$,

we have $f(n) \le c\cdot g(n)$

즉, $g(n)$ is an asymptotic upper bound of $f(n)$.

$\Omega$ Notaiton

For two functions $f(n)$ and $g(n)$, $f(n) = \Omega(g(n))$,

iff there exist a constant $c > 0$ and $n_0 \ge 0$ s.t. for all $n \ge n_0$,

we have $f(n) \ge c\cdot g(n)$

즉, $g(n)$ is an asymptotic lower bound of $f(n)$.

$\Theta$ Notaiton

$f(n)$ is $\Theta(g(n))$ iff $f(n) = \Omega(g(n)) = O(g(n))$.

즉, $g(n)$ is an asymptotic approximation of $f(n)$.

Examples

ν‘œκΈ°λ²•μ— μ΅μˆ™ν•΄μ§€κΈ° μœ„ν•΄ λͺ‡κ°€μ§€ 문제λ₯Ό ν’€μ–΄λ³΄μž.

Q1. Show that for all positive integer $n$,

\[7n^5 + 1024 n^4 + 3n (\log n)^{248} + 10 = O(n^5)\]

A1. 논리에 따라 쑰금만 끄적이면 금방 ν’€λ¦Ό.

Q2. (T/F) If $f(n) = \min \{ n, 10^6 \}$, then $O(1)$.

A2. E-Z

Q3. (T/F) If $f(n) = O(n)$, then $2^{f(n)} = O(2^n)$.

A3. E-Z


Other Asymptotic Bounds

Definition. little-o notation

For every $\epsilon > 0$,

there exists a constant $n_0$ s.t. $f(n) \le \epsilon \cdot g(n)$ for $n > n_0$,

then $f(n) = o(g(n))$.

Definition. little-omega notation

if $g(n) = o(f(n))$, then $f(n) = \omega(g(n))$.

Examples

이해λ₯Ό 돕기 μœ„ν•΄ 사둀λ₯Ό λ¨Όμ € μ‚΄νŽ΄λ³΄μž.

[Trivial case]

  • $f(n) \ne o(f(n))$
  • $f(n) \ne \omega(f(n))$

  • if $f(n) = o(g(n))$, then $f(n) = O(g(n))$. However, the converse is not true.

[Definition by Limitation]

If $\displaystyle\lim_{n\rightarrow\infty} \frac{f(n)}{g(n)} = 0$, then $f(n) = o(g(n))$.

Q4. (T/F) If $f(n) = 2^n$ and $g(n) = n^c$ for $c \in \mathbb{N}$, then $g(n) = o(f(n))$.

A4. E-Z. μ•žμ—μ„œ μ–ΈκΈ‰ν•œ κ·Ήν•œμœΌλ‘œ μ •μ˜ν•œ little-o notation을 μ“°λ©΄ λ°”λ‘œ ν’€λ¦°λ‹€.

Q5. Show that for any fixed but arbitrarily small real number $c > 0$,

\[n \log n = o(n^{1+c})\]

A5. E-Z. 이것도 κ·Ήν•œμœΌλ‘œ μ •μ˜ν•œ 버전을 μ“°λ©΄ λ°”λ‘œ ν’€λ¦Ό.


Exercises

Q. (T/F) $2^n = n^{\omega(1)}$.

A. E-Z. 식을 잘 μ •λ¦¬ν•œ 후에, κ·Ήν•œμœΌλ‘œ μ •μ˜ν•œ 버전을 씀.


μ΄λ²ˆμ— μ‚΄νŽ΄λ³Έ <Asymptotic Analysis>λŠ” μ•Œκ³ λ¦¬μ¦˜μ˜ μ„±λŠ₯을 개랡적으둜 νŒλ‹¨ν•˜λŠ” μ§€ν‘œλ‹€. κ²½μš°μ— λ”°λΌμ„œλŠ” μ•Œκ³ λ¦¬μ¦˜μ— 뢙은 λ§μ…ˆΒ·κ³±μ…ˆμ˜ μƒμˆ˜ν…€ μ—­μ‹œ μ€‘μš”ν•˜λ‹€.

κ·ΈλŸ¬λ‚˜ <Asympototic Analysis>λŠ” μ΅œμ•…μ˜ 상황 μ•„λž˜μ„œ μ•Œκ³ λ¦¬μ¦˜μ˜ μ„±λŠ₯을 ν‰κ°€ν•˜κΈ° λ•Œλ¬Έμ—, 이것이 였히렀 μ•Œκ³ λ¦¬μ¦˜μ˜ μ‹€μ œ λΉ„μš©μ„ λΆ€ν’€λ¦¬κ²Œ λ§Œλ“€κΈ°λ„ ν•œλ‹€. 이런 λ¬Έμ œμ μ„ κ°œμ„ ν•œ 것이 λ°”λ‘œ <Amortized Analysis>이닀. κ³ κΈ‰ 자료ꡬ쑰λ₯Ό μ“Έλ•Œ <Amortized Analysis>κ°€ 자주 λ“±μž₯ν•˜κΈ° λ•Œλ¬Έμ—, κΌ­ μ•Œμ•„μ•Ό ν•˜λŠ” 기법 쀑 ν•˜λ‚˜λ‹€.

πŸ‘‰ Amortized Analysis

Categories:

Updated: