Download presentation
Presentation is loading. Please wait.
1
Asymptotics & Stirling’s Approximation
Mathematics for Computer Science MIT 6.042J/18.062J Asymptotics & Stirling’s Approximation Copyright © Albert Meyer, 2002. Prof. Albert Meyer & Dr. Radhika Nagpal
2
Factorial defines a product:
Stirling’s Formula Factorial defines a product: Turn product into a sum taking logs: ln(n!) = ln(1 · 2 · 3 · · · (n – 1) · n) = ln 1 + · · · + ln(n – 1) + ln(n) =
3
… bound by integral method Stirling’s Formula ln (n) … ln (n+1) ln
2 3 1 4 5 n–2 n–1 n … … ln 2 ln 3 ln 4 ln 5 ln n-1 ln n
4
Integral method to bound ln(n!)
Stirling’s Formula Integral method to bound ln(n!)
5
Stirling’s Formula “~” means:
6
Asymptotic Notation f(x) = O(g(x)) +c c g(x) blue stays below red f(x)
7
Definition 3.1: Asymptotic Equivalence
f(n) is asymptotically equivalent to g(n) when: Denoted by: f(n) ~ g(n)
8
Definition 3.1: Asymptotic Equivalence
f(n) is asymptotically equivalent to g(n) when: Denoted by: f(n) ~ g(n)
9
Denoted by: f(n) = o(g(n))
Definition 7.1: Little Oh f(n) is asymptotically smaller to g(n) when: Denoted by: f(n) = o(g(n))
10
Denoted by: f(n) = O(g(n)) Note: f~g or f = o(g) f=O(g)
Definition 7.2: Big Oh f(n) is asymptotically bounded by g(n) when: Denoted by: f(n) = O(g(n)) Note: f~g or f = o(g) f=O(g)
11
f(n) = O(g(n)) iff c > 0, n0 n n0 |f(n)| c·g(n) Equivalently,
Definition 7.3: Big Oh Equivalently, f(n) = O(g(n)) iff c > 0, n0 n n0 |f(n)| c·g(n)
12
f(n) = (g(n)) iff f(n) = O(g(n)) and g(n) = O(f(n))
Definition 7.7: Theta f(n) = (g(n)) iff f(n) = O(g(n)) and g(n) = O(f(n))
13
Lemma: ln x = o(x) Proof: variable substitution:
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.