Factorials: Turn product into a sum taking logs: ln(n!) = ln( - - PowerPoint PPT Presentation

factorials
SMART_READER_LITE
LIVE PREVIEW

Factorials: Turn product into a sum taking logs: ln(n!) = ln( - - PowerPoint PPT Presentation

Closed form for n! Mathematics for Computer Science MIT 6.042J/18.062J n n! ::= 1 2 3 (n-1) n = i i=1 Factorials: Turn product into a sum taking logs: ln(n!) = ln( 123(n 1)n ) = Stirlings


slide-1
SLIDE 1

1

stirling.1 Albert R Meyer, April 10, 2013

Mathematics for Computer Science MIT 6.042J/18.062J

Factorials: Stirling’s Formula

stirling.2 Albert R Meyer, April 10, 2013

Closed form for n!

n

n! ::= 1⋅2⋅3⋅⋅⋅(n-1)⋅ = n i

i=1

Turn product into a sum taking logs:

ln(n!) = ln( 1·2·3···(n – 1)·n ) = ln 1 + ln 2 + · · · + ln(n – 1) + ln(n)

n

=

1

∑ln(i)

i=

stirling.3 Albert R Meyer, April 10, 2013

Integral Method to bound

… ln 2 ln 3 ln 4 ln 5 ln n-1 ln n

ln 2 ln 3 ln 4 ln 5 ln n 2 3 1 4 5 n–2 n–1 n

ln(x+1) ln(x)

i=1

Closed form for n!

n

∑ln(i)

stirling.4 Albert R Meyer, April 10, 2013

≤ ≤

∑ ∫ ∫

n n i=1 1 n 1

ln(x) dx ln(i) ln(x +1) dx             ≤ ≤

n i=1

n nln +1 ln(i) e n +1 (n +1)ln +0.6 e      

Closed form for n!

reminder: x

∫lnxdx = x ln e

slide-2
SLIDE 2

2

stirling.5 Albert R Meyer, April 10, 2013

    

n

1 n ln(i) ≈ (n + )ln 

i=1

2 e

  ≈    

Closed form for n!

exponentiating:

n

n

n! n / e e

stirling.6 Albert R Meyer, April 10, 2013

n!~ 2πn n e

Stirling’s Formula

A precise approximation:

 

n

   

slide-3
SLIDE 3

MIT OpenCourseWare http://ocw.mit.edu

6.042J / 18.062J Mathematics for Computer Science

Spring 2015 For information about citing these materials or our Terms of Use, visit: http://ocw.mit.edu/terms.