Calculus Favorite: Stirling s Approximation, Approximately

Similar documents
Making Infinitely Many Mistakes Deliberately Iteration

A description of a math circle set of activities around polynomials, especially interpolation.

19. TAYLOR SERIES AND TECHNIQUES

Taylor and Maclaurin Series

Sequences and Series

Constructing Taylor Series

8.5 Taylor Polynomials and Taylor Series

Calculus II Study Guide Fall 2015 Instructor: Barry McQuarrie Page 1 of 8

AP Calculus Chapter 9: Infinite Series

10. e tan 1 (y) 11. sin 3 x

Harmonic Numbers. Math. 55 Some Inequalities May 9, :54 pm

n=1 ( 2 3 )n (a n ) converges by direct comparison to

Units. Year 1. Unit 1: Course Overview

MATH141: Calculus II Exam #4 review solutions 7/20/2017 Page 1

Taylor Series. richard/math230 These notes are taken from Calculus Vol I, by Tom M. Apostol,

1 Useful identities related to summations

Math 115 HW #5 Solutions

MATH 230 CALCULUS II OVERVIEW

Chapter 11 - Sequences and Series

Topics Covered in Calculus BC

B L U E V A L L E Y D I S T R I C T C U R R I C U L U M & I N S T R U C T I O N Mathematics AP Calculus BC

Advanced Placement Calculus II- What Your Child Will Learn

AP Calculus BC. Course Overview. Course Outline and Pacing Guide

Correlation with College Board Advanced Placement Course Descriptions

Completion Date: Monday February 11, 2008

1 Question related to polynomials

AP Calculus BC Scope & Sequence

Chapter 5. Means and Variances

A geometric proof of the spectral theorem for real symmetric matrices

CHAPTER 7: TECHNIQUES OF INTEGRATION

Section Taylor and Maclaurin Series

AP Calculus BC Syllabus Course Overview

Syllabus for BC Calculus

Topic Subtopics Essential Knowledge (EK)

AP Calculus AB. Slide 1 / 175. Slide 2 / 175. Slide 3 / 175. Integration. Table of Contents

7.1 Indefinite Integrals Calculus

8.7 MacLaurin Polynomials

February 13, Option 9 Overview. Mind Map

Math 0230 Calculus 2 Lectures

Algebra & Trig Review

5.9 Representations of Functions as a Power Series

Math 495 Dr. Rick Kreminski Colorado State University Pueblo November 19, 2014 The Riemann Hypothesis: The #1 Problem in Mathematics

AP Calculus BC. Functions, Graphs, and Limits

CHINO VALLEY UNIFIED SCHOOL DISTRICT INSTRUCTIONAL GUIDE CALCULUS BC ADVANCED PLACEMENT

Academic Content Standard MATHEMATICS. MA 51 Advanced Placement Calculus BC

Practice problems from old exams for math 132 William H. Meeks III

DRAFT. Pre-calculus Curriculum Map Quarter 1 Chapters P 2. Extraneous Critical numbers Test intervals

Power series and Taylor series

What I Learned Teaching AP Calculus

I. AP Calculus AB Major Topic: Functions, Graphs, and Limits

CALCULUS AB SUMMER ASSIGNMENT

2. FUNCTIONS AND ALGEBRA

MIDLAND ISD ADVANCED PLACEMENT CURRICULUM STANDARDS AP CALCULUS BC

MATHEMATICS AP Calculus (BC) Standard: Number, Number Sense and Operations

Introduction Derivation General formula List of series Convergence Applications Test SERIES 4 INU0114/514 (MATHS 1)

Math 113 (Calculus 2) Exam 4

Continuity and One-Sided Limits

TAYLOR AND MACLAURIN SERIES

5 Integrals reviewed Basic facts U-substitution... 5

WeBWorK, Problems 2 and 3

Math 112 Rahman. Week Taylor Series Suppose the function f has the following power series:

Numerical Integration

Calculus II Lecture Notes

Lecture 32: Taylor Series and McLaurin series We saw last day that some functions are equal to a power series on part of their domain.

Part 3.3 Differentiation Taylor Polynomials

Physics Sep Example A Spin System

MATH 1242 FINAL EXAM Spring,

Harbor Creek School District

Big-oh stuff. You should know this definition by heart and be able to give it,

(c) Find the equation of the degree 3 polynomial that has the same y-value, slope, curvature, and third derivative as ln(x + 1) at x = 0.

Advanced Placement Calculus Syllabus- BC

Name: Firas Rassoul-Agha

Teaching with a Smile

A Hypothesis about Infinite Series, of the minimally centered variety. By Sidharth Ghoshal May 17, 2012

AP Calculus BC: Syllabus 3

MITOCW ocw f07-lec39_300k

3. LIMITS AND CONTINUITY

Introduction. So, why did I even bother to write this?

Finding Limits Graphically and Numerically

Contents. Preface xi. vii

On a coin-flip problem and its connection to π

Solving Quadratic & Higher Degree Equations

Prentice Hall. Calculus: Graphical, Numerical, Algebraic National Advanced Placement Course Descriptions for Calculus BC.

July 21 Math 2254 sec 001 Summer 2015

The Not-Formula Book for C2 Everything you need to know for Core 2 that won t be in the formula book Examination Board: AQA

SUMMATION TECHNIQUES

PURE MATHEMATICS AM 27

MCS 256 Discrete Calculus and Probability Exam 5: Final Examination 22 May 2007

Chapter 9: Infinite Series Part 2

27 2 x 1 = Solve the equation. Check your solution. 5. Solve the equation. Check your solution. 7. Solve the equation. Check your solution.

This format is the result of tinkering with a mixed lecture format for 3 terms. As such, it is still a work in progress and we will discuss

Curriculum Map for Mathematics HL (DP1)

Polynomials; Add/Subtract

Eigenvalues and eigenvectors

Unit Activity Correlations to Common Core State Standards. Precalculus. Table of Contents

Math 126: Course Summary

Sequences and Series. 256 Chapter 11 Sequences and Series. and then lim 1 1 = 1 0 = 1.

Stat 451 Lecture Notes Numerical Integration

AP Calculus AB. Integration. Table of Contents

Secondary Honors Algebra II Objectives

Transcription:

Calculus Favorite: Stirling s Approximation, Approximately Robert Sachs Department of Mathematical Sciences George Mason University Fairfax, Virginia 22030 rsachs@gmu.edu August 6, 2011

Introduction Stirling approximation says n! 2πn ( n e )n as n in the asymptotic sense that the ratio has limit 1. Nice topic for lots of reasons: challenging but reachable; important; useful in calculus (power series) and in computer science / discrete optimization (complexity of brute force search); backwards thinking approximating sum by integral; leave a bit to be done extends In this short presentation, will try to give flavor of class done with GMU honors and regular calculus 2; BC at magnet school as special appearance; in higher level TJ courses as an aside. Done interactively in class. R. Sachs (GMU) Stirling Approximation, Approximately August 2011 2 / 19

Start of class discussion How big is n!? Say for n = 1000? We ll do this in computer algebra. R. Sachs (GMU) Stirling Approximation, Approximately August 2011 3 / 19

Fun begins From Mathematica: input is Factorial[1000] which outputs as R. Sachs (GMU) Stirling Approximation, Approximately August 2011 4 / 19

Crazy output 40238726007709377354370243392300398571937486421071463254379991042993851239862902059204420848696940480047 99886101971960586316668729948085589013238296699445909974245040870737599188236277271887325197795059509952 76120874975462497043601418278094646496291056393887437886487337119181045825783647849977012476632889835955 73543251318532395846307555740911426241747434934755342864657661166779739666882029120737914385371958824980 81268678383745597317461360853795345242215865932019280908782973084313928444032812315586110369768013573042 16168747609675871348312025478589320767169132448426236131412508780208000261683151027341827977704784635868 17016436502415369139828126481021309276124489635992870511496497541990934222156683257208082133318611681155 36158365469840467089756029009505376164758477284218896796462449451607653534081989013854424879849599533191 01723355556602139450399736280750137837615307127761926849034352625200015888535147331611702103968175921510 90778801939317811419454525722386554146106289218796022383897147608850627686296714667469756291123408243920 81601537808898939645182632436716167621791689097799119037540312746222899880051954444142820121873617459926 42956581746628302955570299024324153181617210465832036786906117260158783520751516284225540265170483304226 14397428693306169089796848259012545832716822645806652676995865268227280707578139185817888965220816434834 48259932660433676601769996128318607883861502794659551311565520360939881806121385586003014356945272242063 44631797460594682573103790084024432438465657245014402821885252470935190620929023136493273497565513958720 55965422874977401141334696271542284586237738753823048386568897646192738381490014076731044664025989949022 R. Sachs (GMU) Stirling Approximation, Approximately August 2011 5 / 19

Crazy output Continued 22217659043399018860185665264850617997023561938970178600408118897299183110211712298459016419210688843871 21855646124960798722908519296819372388642614839657382291123125024186649353143970137428531926649875337218 94069428143411852015801412334482801505139969429015348307764456909907315243327828826986460278986432113908 35062170950025973898635542771967428222487575867657523442202075736305694988250879689281627538488633969099 59826280956121450994871701244516461260379029309120889086942028510640182154399457156805941872748998094254 74217358240106367740459574178516082923013535808184009699637252423056085590370062427124341690900415369010 59339838357779394109700277534720000000000000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 000000000000000000000000000000000000000000000000000000000000000000000000 R. Sachs (GMU) Stirling Approximation, Approximately August 2011 6 / 19

Laughter subsides, now floating point version From Mathematica: input is N[Factorial[1000]] which outputs as 4.023872600770938 10 2567 Try to explain this often get something like 1000 terms, average value 500, so roughly 500 1000 This is 9.33263618503219 10 2698 (spared you the total output) Only off by about 2 10 131 not too bad?! R. Sachs (GMU) Stirling Approximation, Approximately August 2011 7 / 19

Further exploration begins Soon get discussion to ask about n! and its definition as repeated multiplication Consider the summation idea using ln(n!) ln(n!) = n ln(k) and now compare sum to integral using left and right endpoints (and soon midpoint). k=1 R. Sachs (GMU) Stirling Approximation, Approximately August 2011 8 / 19

Graphical view Here is a graph, using 10 instead of 1000 so we can see things. 2.0 1.5 1.0 0.5 R. Sachs (GMU) Stirling Approximation, Approximately August 2011 9 / 19

More graphics Here is the graph, using 1000 steps where we can t see as well. 7 6 5 4 3 2 1 0 200 400 600 800 1000 R. Sachs (GMU) Stirling Approximation, Approximately August 2011 10 / 19

More graphics still Here is the tail of the graph, using 1000 steps, showing last ten. 6.906 6.904 6.902 6.900 6.898 0 R. Sachs (GMU) Stirling Approximation, Approximately August 2011 11 / 19

Some analysis As a first attempt, consider the integral of ln(x), compared to the Riemann left and right sums: n 1 ln(x) dx = x ln(x) x x=n x=1 = n ln(n) n + 1 Graph increases, so left endpoint sum is lower, right endpoint is higher. This yields some estimates: n 1 ln(n!) ln(n) = ln(k) < k=1 n 1 ln(x) dx < n ln(k) = ln(n!) k=2 R. Sachs (GMU) Stirling Approximation, Approximately August 2011 12 / 19

Analysis continued The inequalities we obtain for ln(n!) are not fabulous (yet): n ln(n) n + 1 < ln(n!) < n ln(n) n + 1 + ln(n) This yields the initial estimates: (n/e) n e < n! < (n/e) n n e R. Sachs (GMU) Stirling Approximation, Approximately August 2011 13 / 19

Trapezoid approximation Using the trapezoid approximation rather than endpoints does a better job (average of left and right) n 1 ln x dx n (ln(k 1) + ln(k) ) 1 = ln(n!) 2 2 ln(n) k=2 This unrolls to the approximation (note: arithmetic mean of logs is geometric mean without logs): n! (n/e) n e n Correct except numerical factor: e vs. 2π. R. Sachs (GMU) Stirling Approximation, Approximately August 2011 14 / 19

Frosting on the cake Numerical values are as follows e 2.718281828459045 2π 2.5066282746310002 Correct except numerical factor of about 10%. Full expansion can be had with some extra effort (Euler-Maclaurin formula). R. Sachs (GMU) Stirling Approximation, Approximately August 2011 15 / 19

Fancy script writing on the frosting on the cake From graphs it is clear most of the error is in the early terms. Using the discrete sum for a few steps and then using the integral cuts the numerical discrepancy. Here are some easy first few steps: ((e 2)/3) 3 2 2.4395225351414593 2 (2 e/5) 5 2 2.465563423812403 2 3 (2 e/7) 7 2 2.477101383175650 Recall 2π 2.5066282746310002 Correct except numerical factor of about 1%. R. Sachs (GMU) Stirling Approximation, Approximately August 2011 16 / 19

Using this result in teaching series When teaching power series, I use this result a lot to help students guess (intelligently) about radius of convergence. From Taylor (or Maclaurin) another naming issue we want to understand the sums: f (n) (a) (x a) n n=0 and Stirling says n! is much larger than the exponential term (x a) n, so it boils down to the growth rate (in n) of the derivatives. For exponentials and basic trig (sine and cosine) the factorial wins and the radius is infinite, while for fractional and negative powers, and their integrals or derivatives, there is a balance and a finite radius. n! R. Sachs (GMU) Stirling Approximation, Approximately August 2011 17 / 19

The exact value for the leading constant term The leading term (and more) can be obtained with some effort using Laplace s method for asymptotic expansions, which I suggest to students that they take more math. History is also pretty interesting: Stirling got this constant but demoivre did most of the work, but not the honor of the naming. Used Wallis product formula. Came in the context of probability for repeated Bernoulli trials, fair coin. 2n tries, exactly n of heads, tails. Need the central binomial coefficient: ( 2n n ) ( 1 2 )2n which Stirling s formula will approximate well and give the important factor of n 1 2. DeMoivre got the Gaussian (bell curve) out of the approximation. The full asymptotic expansion can be done by Laplace s method, starting from the formula n! = 0 tn e t dt. R. Sachs (GMU) Stirling Approximation, Approximately August 2011 18 / 19

Concluding remarks This is both a pretty and a useful result. The mathematics is not deep, but there is considerable thought involved. Lots of pieces came into play: integration by parts, integral related to discrete sum, crux move in problem solving. Thank you for your attention and I welcome your comments and/or questions. R. Sachs (GMU) Stirling Approximation, Approximately August 2011 19 / 19