CINXE.COM
Stirling's approximation - Wikipedia
<!doctype html> <html class="client-nojs skin-theme-clientpref-day mf-expand-sections-clientpref-0 mf-font-size-clientpref-small mw-mf-amc-clientpref-0" lang="en" dir="ltr"> <head> <base href="https://en.m.wikipedia.org/wiki/Stirling's_approximation"> <meta charset="UTF-8"> <title>Stirling's approximation - Wikipedia</title> <script>(function(){var className="client-js skin-theme-clientpref-day mf-expand-sections-clientpref-0 mf-font-size-clientpref-small mw-mf-amc-clientpref-0";var cookie=document.cookie.match(/(?:^|; )enwikimwclientpreferences=([^;]+)/);if(cookie){cookie[1].split('%2C').forEach(function(pref){className=className.replace(new RegExp('(^| )'+pref.replace(/-clientpref-\w+$|[^\w-]+/g,'')+'-clientpref-\\w+( |$)'),'$1'+pref+'$2');});}document.documentElement.className=className;}());RLCONF={"wgBreakFrames":false,"wgSeparatorTransformTable":["",""],"wgDigitTransformTable":["",""],"wgDefaultDateFormat":"dmy","wgMonthNames":["","January","February","March","April","May","June","July","August","September","October","November","December"],"wgRequestId":"b8f3fbc0-d8b5-4671-9ac6-adb379ed5f60","wgCanonicalNamespace":"","wgCanonicalSpecialPageName":false,"wgNamespaceNumber":0,"wgPageName":"Stirling's_approximation","wgTitle":"Stirling's approximation","wgCurRevisionId":1243032138,"wgRevisionId":1243032138, "wgArticleId":151783,"wgIsArticle":true,"wgIsRedirect":false,"wgAction":"view","wgUserName":null,"wgUserGroups":["*"],"wgPageViewLanguage":"en","wgPageContentLanguage":"en","wgPageContentModel":"wikitext","wgRelevantPageName":"Stirling's_approximation","wgRelevantArticleId":151783,"wgIsProbablyEditable":true,"wgRelevantPageIsProbablyEditable":true,"wgRestrictionEdit":[],"wgRestrictionMove":[],"wgNoticeProject":"wikipedia","wgCiteReferencePreviewsActive":false,"wgFlaggedRevsParams":{"tags":{"status":{"levels":1}}},"wgMediaViewerOnClick":true,"wgMediaViewerEnabledByDefault":true,"wgPopupsFlags":0,"wgVisualEditor":{"pageLanguageCode":"en","pageLanguageDir":"ltr","pageVariantFallbacks":"en"},"wgMFMode":"stable","wgMFAmc":false,"wgMFAmcOutreachActive":false,"wgMFAmcOutreachUserEligible":false,"wgMFLazyLoadImages":true,"wgMFEditNoticesFeatureConflict":false,"wgMFDisplayWikibaseDescriptions":{"search":true,"watchlist":true,"tagline":false,"nearby":true},"wgMFIsSupportedEditRequest":true, "wgMFScriptPath":"","wgWMESchemaEditAttemptStepOversample":false,"wgWMEPageLength":30000,"wgRelatedArticlesCompat":[],"wgCentralAuthMobileDomain":true,"wgEditSubmitButtonLabelPublish":true,"wgSectionTranslationMissingLanguages":[{"lang":"ace","autonym":"Acèh","dir":"ltr"},{"lang":"ady","autonym":"адыгабзэ","dir":"ltr"},{"lang":"alt","autonym":"алтай тил","dir":"ltr"},{"lang":"am","autonym":"አማርኛ","dir":"ltr"},{"lang":"ami","autonym":"Pangcah","dir":"ltr"},{"lang":"an","autonym":"aragonés","dir":"ltr"},{"lang":"ang","autonym":"Ænglisc","dir":"ltr"},{"lang":"ann","autonym":"Obolo","dir":"ltr"},{"lang":"anp","autonym":"अंगिका","dir":"ltr"},{"lang":"ary","autonym":"الدارجة","dir":"rtl"},{"lang":"arz","autonym":"مصرى","dir":"rtl"},{"lang":"as","autonym":"অসমীয়া","dir":"ltr"},{"lang":"ast","autonym":"asturianu","dir":"ltr"},{"lang":"av","autonym":"авар","dir":"ltr"},{"lang":"avk","autonym":"Kotava","dir":"ltr"},{"lang": "awa","autonym":"अवधी","dir":"ltr"},{"lang":"ay","autonym":"Aymar aru","dir":"ltr"},{"lang":"az","autonym":"azərbaycanca","dir":"ltr"},{"lang":"azb","autonym":"تۆرکجه","dir":"rtl"},{"lang":"ba","autonym":"башҡортса","dir":"ltr"},{"lang":"ban","autonym":"Basa Bali","dir":"ltr"},{"lang":"bar","autonym":"Boarisch","dir":"ltr"},{"lang":"bbc","autonym":"Batak Toba","dir":"ltr"},{"lang":"bcl","autonym":"Bikol Central","dir":"ltr"},{"lang":"bdr","autonym":"Bajau Sama","dir":"ltr"},{"lang":"bew","autonym":"Betawi","dir":"ltr"},{"lang":"bho","autonym":"भोजपुरी","dir":"ltr"},{"lang":"bi","autonym":"Bislama","dir":"ltr"},{"lang":"bjn","autonym":"Banjar","dir":"ltr"},{"lang":"blk","autonym":"ပအိုဝ်ႏဘာႏသာႏ","dir":"ltr"},{"lang":"bm","autonym":"bamanankan","dir":"ltr"},{"lang":"bo","autonym":"བོད་ཡིག","dir":"ltr"},{"lang":"bpy","autonym":"বিষ্ণুপ্রিয়া মণিপুরী","dir":"ltr"},{"lang": "br","autonym":"brezhoneg","dir":"ltr"},{"lang":"bs","autonym":"bosanski","dir":"ltr"},{"lang":"btm","autonym":"Batak Mandailing","dir":"ltr"},{"lang":"bug","autonym":"Basa Ugi","dir":"ltr"},{"lang":"cdo","autonym":"閩東語 / Mìng-dĕ̤ng-ngṳ̄","dir":"ltr"},{"lang":"ce","autonym":"нохчийн","dir":"ltr"},{"lang":"ceb","autonym":"Cebuano","dir":"ltr"},{"lang":"ch","autonym":"Chamoru","dir":"ltr"},{"lang":"chr","autonym":"ᏣᎳᎩ","dir":"ltr"},{"lang":"co","autonym":"corsu","dir":"ltr"},{"lang":"cr","autonym":"Nēhiyawēwin / ᓀᐦᐃᔭᐍᐏᐣ","dir":"ltr"},{"lang":"crh","autonym":"qırımtatarca","dir":"ltr"},{"lang":"cu","autonym":"словѣньскъ / ⰔⰎⰑⰂⰡⰐⰠⰔⰍⰟ","dir":"ltr"},{"lang":"cy","autonym":"Cymraeg","dir":"ltr"},{"lang":"da","autonym":"dansk","dir":"ltr"},{"lang":"dag","autonym":"dagbanli","dir":"ltr"},{"lang":"dga","autonym":"Dagaare","dir":"ltr"},{"lang":"din","autonym":"Thuɔŋjäŋ","dir":"ltr"},{"lang":"diq","autonym":"Zazaki","dir" :"ltr"},{"lang":"dsb","autonym":"dolnoserbski","dir":"ltr"},{"lang":"dtp","autonym":"Kadazandusun","dir":"ltr"},{"lang":"dv","autonym":"ދިވެހިބަސް","dir":"rtl"},{"lang":"dz","autonym":"ཇོང་ཁ","dir":"ltr"},{"lang":"ee","autonym":"eʋegbe","dir":"ltr"},{"lang":"eml","autonym":"emiliàn e rumagnòl","dir":"ltr"},{"lang":"eo","autonym":"Esperanto","dir":"ltr"},{"lang":"et","autonym":"eesti","dir":"ltr"},{"lang":"fat","autonym":"mfantse","dir":"ltr"},{"lang":"ff","autonym":"Fulfulde","dir":"ltr"},{"lang":"fi","autonym":"suomi","dir":"ltr"},{"lang":"fj","autonym":"Na Vosa Vakaviti","dir":"ltr"},{"lang":"fo","autonym":"føroyskt","dir":"ltr"},{"lang":"fon","autonym":"fɔ̀ngbè","dir":"ltr"},{"lang":"frp","autonym":"arpetan","dir":"ltr"},{"lang":"frr","autonym":"Nordfriisk","dir":"ltr"},{"lang":"fur","autonym":"furlan","dir":"ltr"},{"lang":"fy","autonym":"Frysk","dir":"ltr"},{"lang":"gag","autonym":"Gagauz","dir":"ltr"},{"lang":"gan","autonym":"贛語","dir":"ltr"},{"lang" :"gcr","autonym":"kriyòl gwiyannen","dir":"ltr"},{"lang":"glk","autonym":"گیلکی","dir":"rtl"},{"lang":"gn","autonym":"Avañe'ẽ","dir":"ltr"},{"lang":"gom","autonym":"गोंयची कोंकणी / Gõychi Konknni","dir":"ltr"},{"lang":"gor","autonym":"Bahasa Hulontalo","dir":"ltr"},{"lang":"gpe","autonym":"Ghanaian Pidgin","dir":"ltr"},{"lang":"gu","autonym":"ગુજરાતી","dir":"ltr"},{"lang":"guc","autonym":"wayuunaiki","dir":"ltr"},{"lang":"gur","autonym":"farefare","dir":"ltr"},{"lang":"guw","autonym":"gungbe","dir":"ltr"},{"lang":"gv","autonym":"Gaelg","dir":"ltr"},{"lang":"ha","autonym":"Hausa","dir":"ltr"},{"lang":"hak","autonym":"客家語 / Hak-kâ-ngî","dir":"ltr"},{"lang":"haw","autonym":"Hawaiʻi","dir":"ltr"},{"lang":"hi","autonym":"हिन्दी","dir":"ltr"},{"lang":"hif","autonym":"Fiji Hindi","dir":"ltr"},{"lang":"hr","autonym":"hrvatski","dir":"ltr"},{"lang":"hsb","autonym":"hornjoserbsce","dir":"ltr"},{"lang":"ht","autonym": "Kreyòl ayisyen","dir":"ltr"},{"lang":"hy","autonym":"հայերեն","dir":"ltr"},{"lang":"hyw","autonym":"Արեւմտահայերէն","dir":"ltr"},{"lang":"ia","autonym":"interlingua","dir":"ltr"},{"lang":"iba","autonym":"Jaku Iban","dir":"ltr"},{"lang":"ie","autonym":"Interlingue","dir":"ltr"},{"lang":"ig","autonym":"Igbo","dir":"ltr"},{"lang":"igl","autonym":"Igala","dir":"ltr"},{"lang":"ilo","autonym":"Ilokano","dir":"ltr"},{"lang":"io","autonym":"Ido","dir":"ltr"},{"lang":"is","autonym":"íslenska","dir":"ltr"},{"lang":"iu","autonym":"ᐃᓄᒃᑎᑐᑦ / inuktitut","dir":"ltr"},{"lang":"jam","autonym":"Patois","dir":"ltr"},{"lang":"jv","autonym":"Jawa","dir":"ltr"},{"lang":"ka","autonym":"ქართული","dir":"ltr"},{"lang":"kaa","autonym":"Qaraqalpaqsha","dir":"ltr"},{"lang":"kab","autonym":"Taqbaylit","dir":"ltr"},{"lang":"kbd","autonym":"адыгэбзэ","dir":"ltr"},{"lang":"kbp","autonym":"Kabɩyɛ","dir":"ltr"},{"lang":"kcg","autonym":"Tyap","dir":"ltr"},{ "lang":"kg","autonym":"Kongo","dir":"ltr"},{"lang":"kge","autonym":"Kumoring","dir":"ltr"},{"lang":"ki","autonym":"Gĩkũyũ","dir":"ltr"},{"lang":"kl","autonym":"kalaallisut","dir":"ltr"},{"lang":"km","autonym":"ភាសាខ្មែរ","dir":"ltr"},{"lang":"kn","autonym":"ಕನ್ನಡ","dir":"ltr"},{"lang":"koi","autonym":"перем коми","dir":"ltr"},{"lang":"krc","autonym":"къарачай-малкъар","dir":"ltr"},{"lang":"ks","autonym":"कॉशुर / کٲشُر","dir":"rtl"},{"lang":"ku","autonym":"kurdî","dir":"ltr"},{"lang":"kus","autonym":"Kʋsaal","dir":"ltr"},{"lang":"kv","autonym":"коми","dir":"ltr"},{"lang":"kw","autonym":"kernowek","dir":"ltr"},{"lang":"ky","autonym":"кыргызча","dir":"ltr"},{"lang":"lad","autonym":"Ladino","dir":"ltr"},{"lang":"lb","autonym":"Lëtzebuergesch","dir":"ltr"},{"lang":"lez","autonym":"лезги","dir":"ltr"},{"lang":"lg","autonym":"Luganda","dir":"ltr"},{"lang":"li","autonym":"Limburgs","dir":"ltr"},{"lang": "lij","autonym":"Ligure","dir":"ltr"},{"lang":"lld","autonym":"Ladin","dir":"ltr"},{"lang":"lmo","autonym":"lombard","dir":"ltr"},{"lang":"ln","autonym":"lingála","dir":"ltr"},{"lang":"lo","autonym":"ລາວ","dir":"ltr"},{"lang":"ltg","autonym":"latgaļu","dir":"ltr"},{"lang":"lv","autonym":"latviešu","dir":"ltr"},{"lang":"mad","autonym":"Madhurâ","dir":"ltr"},{"lang":"mai","autonym":"मैथिली","dir":"ltr"},{"lang":"map-bms","autonym":"Basa Banyumasan","dir":"ltr"},{"lang":"mdf","autonym":"мокшень","dir":"ltr"},{"lang":"mg","autonym":"Malagasy","dir":"ltr"},{"lang":"mhr","autonym":"олык марий","dir":"ltr"},{"lang":"mi","autonym":"Māori","dir":"ltr"},{"lang":"min","autonym":"Minangkabau","dir":"ltr"},{"lang":"mk","autonym":"македонски","dir":"ltr"},{"lang":"ml","autonym":"മലയാളം","dir":"ltr"},{"lang":"mni","autonym":"ꯃꯤꯇꯩ ꯂꯣꯟ","dir":"ltr"},{"lang":"mnw","autonym":"ဘာသာမန်","dir":"ltr"},{"lang":"mos", "autonym":"moore","dir":"ltr"},{"lang":"mr","autonym":"मराठी","dir":"ltr"},{"lang":"mrj","autonym":"кырык мары","dir":"ltr"},{"lang":"ms","autonym":"Bahasa Melayu","dir":"ltr"},{"lang":"mt","autonym":"Malti","dir":"ltr"},{"lang":"mwl","autonym":"Mirandés","dir":"ltr"},{"lang":"my","autonym":"မြန်မာဘာသာ","dir":"ltr"},{"lang":"myv","autonym":"эрзянь","dir":"ltr"},{"lang":"mzn","autonym":"مازِرونی","dir":"rtl"},{"lang":"nah","autonym":"Nāhuatl","dir":"ltr"},{"lang":"nan","autonym":"閩南語 / Bân-lâm-gú","dir":"ltr"},{"lang":"nap","autonym":"Napulitano","dir":"ltr"},{"lang":"nb","autonym":"norsk bokmål","dir":"ltr"},{"lang":"nds","autonym":"Plattdüütsch","dir":"ltr"},{"lang":"nds-nl","autonym":"Nedersaksies","dir":"ltr"},{"lang":"ne","autonym":"नेपाली","dir":"ltr"},{"lang":"new","autonym":"नेपाल भाषा","dir":"ltr"},{"lang":"nia","autonym":"Li Niha","dir":"ltr"},{"lang":"nn","autonym":"norsk nynorsk" ,"dir":"ltr"},{"lang":"nqo","autonym":"ߒߞߏ","dir":"rtl"},{"lang":"nr","autonym":"isiNdebele seSewula","dir":"ltr"},{"lang":"nso","autonym":"Sesotho sa Leboa","dir":"ltr"},{"lang":"ny","autonym":"Chi-Chewa","dir":"ltr"},{"lang":"oc","autonym":"occitan","dir":"ltr"},{"lang":"om","autonym":"Oromoo","dir":"ltr"},{"lang":"or","autonym":"ଓଡ଼ିଆ","dir":"ltr"},{"lang":"os","autonym":"ирон","dir":"ltr"},{"lang":"pa","autonym":"ਪੰਜਾਬੀ","dir":"ltr"},{"lang":"pag","autonym":"Pangasinan","dir":"ltr"},{"lang":"pam","autonym":"Kapampangan","dir":"ltr"},{"lang":"pap","autonym":"Papiamentu","dir":"ltr"},{"lang":"pcd","autonym":"Picard","dir":"ltr"},{"lang":"pcm","autonym":"Naijá","dir":"ltr"},{"lang":"pdc","autonym":"Deitsch","dir":"ltr"},{"lang":"pms","autonym":"Piemontèis","dir":"ltr"},{"lang":"pnb","autonym":"پنجابی","dir":"rtl"},{"lang":"ps","autonym":"پښتو","dir":"rtl"},{"lang":"pwn","autonym":"pinayuanan","dir":"ltr"},{"lang":"qu","autonym":"Runa Simi", "dir":"ltr"},{"lang":"rm","autonym":"rumantsch","dir":"ltr"},{"lang":"rn","autonym":"ikirundi","dir":"ltr"},{"lang":"rsk","autonym":"руски","dir":"ltr"},{"lang":"rue","autonym":"русиньскый","dir":"ltr"},{"lang":"rup","autonym":"armãneashti","dir":"ltr"},{"lang":"rw","autonym":"Ikinyarwanda","dir":"ltr"},{"lang":"sa","autonym":"संस्कृतम्","dir":"ltr"},{"lang":"sah","autonym":"саха тыла","dir":"ltr"},{"lang":"sat","autonym":"ᱥᱟᱱᱛᱟᱲᱤ","dir":"ltr"},{"lang":"sc","autonym":"sardu","dir":"ltr"},{"lang":"sco","autonym":"Scots","dir":"ltr"},{"lang":"sd","autonym":"سنڌي","dir":"rtl"},{"lang":"se","autonym":"davvisámegiella","dir":"ltr"},{"lang":"sg","autonym":"Sängö","dir":"ltr"},{"lang":"sgs","autonym":"žemaitėška","dir":"ltr"},{"lang":"sh","autonym":"srpskohrvatski / српскохрватски","dir":"ltr"},{"lang":"shn","autonym":"ၽႃႇသႃႇတႆး ","dir":"ltr"},{"lang":"si","autonym":"සිංහල","dir":"ltr"} ,{"lang":"skr","autonym":"سرائیکی","dir":"rtl"},{"lang":"sl","autonym":"slovenščina","dir":"ltr"},{"lang":"sm","autonym":"Gagana Samoa","dir":"ltr"},{"lang":"smn","autonym":"anarâškielâ","dir":"ltr"},{"lang":"sn","autonym":"chiShona","dir":"ltr"},{"lang":"so","autonym":"Soomaaliga","dir":"ltr"},{"lang":"sr","autonym":"српски / srpski","dir":"ltr"},{"lang":"srn","autonym":"Sranantongo","dir":"ltr"},{"lang":"ss","autonym":"SiSwati","dir":"ltr"},{"lang":"st","autonym":"Sesotho","dir":"ltr"},{"lang":"stq","autonym":"Seeltersk","dir":"ltr"},{"lang":"su","autonym":"Sunda","dir":"ltr"},{"lang":"sw","autonym":"Kiswahili","dir":"ltr"},{"lang":"szl","autonym":"ślůnski","dir":"ltr"},{"lang":"ta","autonym":"தமிழ்","dir":"ltr"},{"lang":"tay","autonym":"Tayal","dir":"ltr"},{"lang":"tcy","autonym":"ತುಳು","dir":"ltr"},{"lang":"tdd","autonym":"ᥖᥭᥰ ᥖᥬᥲ ᥑᥨᥒᥰ","dir":"ltr"},{"lang":"te","autonym":"తెలుగు","dir":"ltr"},{"lang":"tet", "autonym":"tetun","dir":"ltr"},{"lang":"tg","autonym":"тоҷикӣ","dir":"ltr"},{"lang":"th","autonym":"ไทย","dir":"ltr"},{"lang":"ti","autonym":"ትግርኛ","dir":"ltr"},{"lang":"tk","autonym":"Türkmençe","dir":"ltr"},{"lang":"tl","autonym":"Tagalog","dir":"ltr"},{"lang":"tly","autonym":"tolışi","dir":"ltr"},{"lang":"tn","autonym":"Setswana","dir":"ltr"},{"lang":"to","autonym":"lea faka-Tonga","dir":"ltr"},{"lang":"tpi","autonym":"Tok Pisin","dir":"ltr"},{"lang":"trv","autonym":"Seediq","dir":"ltr"},{"lang":"ts","autonym":"Xitsonga","dir":"ltr"},{"lang":"tt","autonym":"татарча / tatarça","dir":"ltr"},{"lang":"tum","autonym":"chiTumbuka","dir":"ltr"},{"lang":"tw","autonym":"Twi","dir":"ltr"},{"lang":"ty","autonym":"reo tahiti","dir":"ltr"},{"lang":"tyv","autonym":"тыва дыл","dir":"ltr"},{"lang":"udm","autonym":"удмурт","dir":"ltr"},{"lang":"uz","autonym":"oʻzbekcha / ўзбекча","dir":"ltr"},{"lang":"ve","autonym":"Tshivenda","dir":"ltr"},{"lang" :"vec","autonym":"vèneto","dir":"ltr"},{"lang":"vep","autonym":"vepsän kel’","dir":"ltr"},{"lang":"vls","autonym":"West-Vlams","dir":"ltr"},{"lang":"vo","autonym":"Volapük","dir":"ltr"},{"lang":"vro","autonym":"võro","dir":"ltr"},{"lang":"wa","autonym":"walon","dir":"ltr"},{"lang":"war","autonym":"Winaray","dir":"ltr"},{"lang":"wo","autonym":"Wolof","dir":"ltr"},{"lang":"wuu","autonym":"吴语","dir":"ltr"},{"lang":"xal","autonym":"хальмг","dir":"ltr"},{"lang":"xh","autonym":"isiXhosa","dir":"ltr"},{"lang":"xmf","autonym":"მარგალური","dir":"ltr"},{"lang":"yi","autonym":"ייִדיש","dir":"rtl"},{"lang":"yo","autonym":"Yorùbá","dir":"ltr"},{"lang":"yue","autonym":"粵語","dir":"ltr"},{"lang":"za","autonym":"Vahcuengh","dir":"ltr"},{"lang":"zgh","autonym":"ⵜⴰⵎⴰⵣⵉⵖⵜ ⵜⴰⵏⴰⵡⴰⵢⵜ","dir":"ltr"},{"lang":"zu","autonym":"isiZulu","dir":"ltr"}],"wgSectionTranslationTargetLanguages":["ace","ady","alt","am","ami","an","ang","ann", "anp","ar","ary","arz","as","ast","av","avk","awa","ay","az","azb","ba","ban","bar","bbc","bcl","bdr","be","bew","bg","bho","bi","bjn","blk","bm","bn","bo","bpy","br","bs","btm","bug","ca","cdo","ce","ceb","ch","chr","ckb","co","cr","crh","cs","cu","cy","da","dag","de","dga","din","diq","dsb","dtp","dv","dz","ee","el","eml","eo","es","et","eu","fa","fat","ff","fi","fj","fo","fon","fr","frp","frr","fur","fy","gag","gan","gcr","gl","glk","gn","gom","gor","gpe","gu","guc","gur","guw","gv","ha","hak","haw","he","hi","hif","hr","hsb","ht","hu","hy","hyw","ia","iba","ie","ig","igl","ilo","io","is","it","iu","ja","jam","jv","ka","kaa","kab","kbd","kbp","kcg","kg","kge","ki","kk","kl","km","kn","ko","koi","krc","ks","ku","kus","kv","kw","ky","lad","lb","lez","lg","li","lij","lld","lmo","ln","lo","lt","ltg","lv","mad","mai","map-bms","mdf","mg","mhr","mi","min","mk","ml","mn","mni","mnw","mos","mr","mrj","ms","mt","mwl","my","myv","mzn","nah","nan","nap","nb","nds","nds-nl","ne","new","nia", "nl","nn","nqo","nr","nso","ny","oc","om","or","os","pa","pag","pam","pap","pcd","pcm","pdc","pl","pms","pnb","ps","pt","pwn","qu","rm","rn","ro","rsk","rue","rup","rw","sa","sah","sat","sc","scn","sco","sd","se","sg","sgs","sh","shi","shn","si","sk","skr","sl","sm","smn","sn","so","sq","sr","srn","ss","st","stq","su","sv","sw","szl","ta","tay","tcy","tdd","te","tet","tg","th","ti","tk","tl","tly","tn","to","tpi","tr","trv","ts","tt","tum","tw","ty","tyv","udm","ur","uz","ve","vec","vep","vi","vls","vo","vro","wa","war","wo","wuu","xal","xh","xmf","yi","yo","yue","za","zgh","zh","zu"],"isLanguageSearcherCXEntrypointEnabled":true,"mintEntrypointLanguages":["ace","ast","azb","bcl","bjn","bh","crh","ff","fon","ig","is","ki","ks","lmo","min","sat","ss","tn","vec"],"wgWikibaseItemId":"Q470877","wgCheckUserClientHintsHeadersJsApi":["brands","architecture","bitness","fullVersionList","mobile","model","platform","platformVersion"],"GEHomepageSuggestedEditsEnableTopics":true, "wgGETopicsMatchModeEnabled":false,"wgGEStructuredTaskRejectionReasonTextInputEnabled":false,"wgGELevelingUpEnabledForUser":false,"wgMinervaPermissions":{"watchable":true,"watch":false},"wgMinervaFeatures":{"beta":false,"donate":true,"mobileOptionsLink":true,"categories":false,"pageIssues":true,"talkAtTop":true,"historyInPageActions":false,"overflowSubmenu":false,"tabsOnSpecials":true,"personalMenu":false,"mainMenuExpanded":false,"echo":true,"nightMode":true},"wgMinervaDownloadNamespaces":[0]};RLSTATE={"ext.globalCssJs.user.styles":"ready","site.styles":"ready","user.styles":"ready","ext.globalCssJs.user":"ready","user":"ready","user.options":"loading","ext.math.styles":"ready","ext.cite.styles":"ready","ext.pygments":"ready","skins.minerva.styles":"ready","skins.minerva.content.styles.images":"ready","mediawiki.hlist":"ready","skins.minerva.codex.styles":"ready","skins.minerva.icons":"ready","skins.minerva.amc.styles":"ready","ext.wikimediamessages.styles":"ready","mobile.init.styles" :"ready","ext.relatedArticles.styles":"ready","wikibase.client.init":"ready","ext.wikimediaBadges":"ready"};RLPAGEMODULES=["ext.cite.ux-enhancements","ext.pygments.view","mediawiki.page.media","site","mediawiki.page.ready","skins.minerva.scripts","ext.centralNotice.geoIP","ext.centralNotice.startUp","ext.gadget.switcher","ext.urlShortener.toolbar","ext.centralauth.centralautologin","ext.popups","mobile.init","ext.echo.centralauth","ext.relatedArticles.readMore.bootstrap","ext.eventLogging","ext.wikimediaEvents","ext.navigationTiming","ext.cx.eventlogging.campaigns","ext.cx.entrypoints.mffrequentlanguages","ext.cx.entrypoints.languagesearcher.init","mw.externalguidance.init","ext.checkUser.clientHints","ext.growthExperiments.SuggestedEditSession","wikibase.sidebar.tracking"];</script> <script>(RLQ=window.RLQ||[]).push(function(){mw.loader.impl(function(){return["user.options@12s5i",function($,jQuery,require,module){mw.user.tokens.set({"patrolToken":"+\\","watchToken":"+\\","csrfToken":"+\\"}); }];});});</script> <link rel="stylesheet" href="/w/load.php?lang=en&modules=ext.cite.styles%7Cext.math.styles%7Cext.pygments%2CwikimediaBadges%7Cext.relatedArticles.styles%7Cext.wikimediamessages.styles%7Cmediawiki.hlist%7Cmobile.init.styles%7Cskins.minerva.amc.styles%7Cskins.minerva.codex.styles%7Cskins.minerva.content.styles.images%7Cskins.minerva.icons%2Cstyles%7Cwikibase.client.init&only=styles&skin=minerva"> <script async src="/w/load.php?lang=en&modules=startup&only=scripts&raw=1&skin=minerva"></script> <meta name="ResourceLoaderDynamicStyles" content=""> <link rel="stylesheet" href="/w/load.php?lang=en&modules=site.styles&only=styles&skin=minerva"> <meta name="generator" content="MediaWiki 1.44.0-wmf.4"> <meta name="referrer" content="origin"> <meta name="referrer" content="origin-when-cross-origin"> <meta name="robots" content="max-image-preview:standard"> <meta name="format-detection" content="telephone=no"> <meta name="theme-color" content="#eaecf0"> <meta property="og:image" content="https://upload.wikimedia.org/wikipedia/commons/thumb/4/48/Mplwp_factorial_gamma_stirling.svg/1200px-Mplwp_factorial_gamma_stirling.svg.png"> <meta property="og:image:width" content="1200"> <meta property="og:image:height" content="800"> <meta property="og:image" content="https://upload.wikimedia.org/wikipedia/commons/thumb/4/48/Mplwp_factorial_gamma_stirling.svg/800px-Mplwp_factorial_gamma_stirling.svg.png"> <meta property="og:image:width" content="800"> <meta property="og:image:height" content="533"> <meta property="og:image" content="https://upload.wikimedia.org/wikipedia/commons/thumb/4/48/Mplwp_factorial_gamma_stirling.svg/640px-Mplwp_factorial_gamma_stirling.svg.png"> <meta property="og:image:width" content="640"> <meta property="og:image:height" content="427"> <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes, minimum-scale=0.25, maximum-scale=5.0"> <meta property="og:title" content="Stirling's approximation - Wikipedia"> <meta property="og:type" content="website"> <link rel="preconnect" href="//upload.wikimedia.org"> <link rel="manifest" href="/w/api.php?action=webapp-manifest"> <link rel="alternate" type="application/x-wiki" title="Edit this page" href="/w/index.php?title=Stirling%27s_approximation&action=edit"> <link rel="apple-touch-icon" href="/static/apple-touch/wikipedia.png"> <link rel="icon" href="/static/favicon/wikipedia.ico"> <link rel="search" type="application/opensearchdescription+xml" href="/w/rest.php/v1/search" title="Wikipedia (en)"> <link rel="EditURI" type="application/rsd+xml" href="//en.wikipedia.org/w/api.php?action=rsd"> <link rel="canonical" href="https://en.wikipedia.org/wiki/Stirling%27s_approximation"> <link rel="license" href="https://creativecommons.org/licenses/by-sa/4.0/deed.en"> <link rel="dns-prefetch" href="//meta.wikimedia.org"> <link rel="dns-prefetch" href="//login.wikimedia.org"> <meta http-equiv="X-Translated-By" content="Google"> <meta http-equiv="X-Translated-To" content="en"> <script type="text/javascript" src="https://www.gstatic.com/_/translate_http/_/js/k=translate_http.tr.en_GB.1hbgkFx4Qn8.O/am=DgY/d=1/rs=AN8SPfqlmAPxwfG457BPbRXwNq39oSMGHg/m=corsproxy" data-sourceurl="https://en.m.wikipedia.org/wiki/Stirling's_approximation"></script> <link href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200" rel="stylesheet"> <script type="text/javascript" src="https://www.gstatic.com/_/translate_http/_/js/k=translate_http.tr.en_GB.1hbgkFx4Qn8.O/am=DgY/d=1/exm=corsproxy/ed=1/rs=AN8SPfqlmAPxwfG457BPbRXwNq39oSMGHg/m=phishing_protection" data-phishing-protection-enabled="false" data-forms-warning-enabled="true" data-source-url="https://en.m.wikipedia.org/wiki/Stirling's_approximation"></script> <meta name="robots" content="none"> </head> <body class="mediawiki ltr sitedir-ltr mw-hide-empty-elt ns-0 ns-subject mw-editable page-Stirling_s_approximation rootpage-Stirling_s_approximation stable issues-group-B skin-minerva action-view skin--responsive mw-mf-amc-disabled mw-mf"> <script type="text/javascript" src="https://www.gstatic.com/_/translate_http/_/js/k=translate_http.tr.en_GB.1hbgkFx4Qn8.O/am=DgY/d=1/exm=corsproxy,phishing_protection/ed=1/rs=AN8SPfqlmAPxwfG457BPbRXwNq39oSMGHg/m=navigationui" data-environment="prod" data-proxy-url="https://en-m-wikipedia-org.translate.goog" data-proxy-full-url="https://en-m-wikipedia-org.translate.goog/wiki/Stirling's_approximation?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-GB" data-source-url="https://en.m.wikipedia.org/wiki/Stirling's_approximation" data-source-language="auto" data-target-language="en" data-display-language="en-GB" data-detected-source-language="en" data-is-source-untranslated="false" data-source-untranslated-url="https://translate.google.com/website?sl=auto&tl=en&hl=en-GB&u=https://en.m.wikipedia.org/wiki/Stirling's_approximation&anno=2" data-client="tr"></script> <div id="mw-mf-viewport"> <div id="mw-mf-page-center"><a class="mw-mf-page-center__mask" href="https://en-m-wikipedia-org.translate.goog/wiki/Stirling's_approximation?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-GB#"></a> <header class="header-container header-chrome"> <div class="minerva-header"> <nav class="navigation-drawer toggle-list view-border-box"><input type="checkbox" id="main-menu-input" class="toggle-list__checkbox" role="button" aria-haspopup="true" aria-expanded="false" aria-labelledby="mw-mf-main-menu-button"> <label role="button" for="main-menu-input" id="mw-mf-main-menu-button" aria-hidden="true" data-event-name="ui.mainmenu" class="cdx-button cdx-button--size-large cdx-button--fake-button cdx-button--fake-button--enabled cdx-button--icon-only cdx-button--weight-quiet toggle-list__toggle"> <span class="minerva-icon minerva-icon--menu"></span> <span></span> </label> <div id="mw-mf-page-left" class="menu view-border-box"> <ul id="p-navigation" class="toggle-list__list"> <li class="toggle-list-item "><a class="toggle-list-item__anchor menu__item--home" href="https://en-m-wikipedia-org.translate.goog/wiki/Main_Page?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-GB" data-mw="interface"> <span class="minerva-icon minerva-icon--home"></span> <span class="toggle-list-item__label">Home</span> </a></li> <li class="toggle-list-item "><a class="toggle-list-item__anchor menu__item--random" href="https://en-m-wikipedia-org.translate.goog/wiki/Special:Random?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-GB" data-mw="interface"> <span class="minerva-icon minerva-icon--die"></span> <span class="toggle-list-item__label">Random</span> </a></li> <li class="toggle-list-item skin-minerva-list-item-jsonly"><a class="toggle-list-item__anchor menu__item--nearby" href="https://en-m-wikipedia-org.translate.goog/wiki/Special:Nearby?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-GB" data-event-name="menu.nearby" data-mw="interface"> <span class="minerva-icon minerva-icon--mapPin"></span> <span class="toggle-list-item__label">Nearby</span> </a></li> </ul> <ul id="p-personal" class="toggle-list__list"> <li class="toggle-list-item "><a class="toggle-list-item__anchor menu__item--login" href="https://en-m-wikipedia-org.translate.goog/w/index.php?title=Special:UserLogin&returnto=Stirling's+approximation&_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-GB" data-event-name="menu.login" data-mw="interface"> <span class="minerva-icon minerva-icon--logIn"></span> <span class="toggle-list-item__label">Log in</span> </a></li> </ul> <ul id="pt-preferences" class="toggle-list__list"> <li class="toggle-list-item skin-minerva-list-item-jsonly"><a class="toggle-list-item__anchor menu__item--settings" href="https://en-m-wikipedia-org.translate.goog/w/index.php?title=Special:MobileOptions&returnto=Stirling's+approximation&_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-GB" data-event-name="menu.settings" data-mw="interface"> <span class="minerva-icon minerva-icon--settings"></span> <span class="toggle-list-item__label">Settings</span> </a></li> </ul> <ul id="p-donation" class="toggle-list__list"> <li class="toggle-list-item "><a class="toggle-list-item__anchor menu__item--donate" href="https://translate.google.com/website?sl=auto&tl=en&hl=en-GB&u=https://donate.wikimedia.org/wiki/Special:FundraiserRedirector?utm_source%3Ddonate%26utm_medium%3Dsidebar%26utm_campaign%3DC13_en.wikipedia.org%26uselang%3Den%26utm_key%3Dminerva" data-event-name="menu.donate" data-mw="interface"> <span class="minerva-icon minerva-icon--heart"></span> <span class="toggle-list-item__label">Donate</span> </a></li> </ul> <ul class="hlist"> <li class="toggle-list-item "><a class="toggle-list-item__anchor menu__item--about" href="https://en-m-wikipedia-org.translate.goog/wiki/Wikipedia:About?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-GB" data-mw="interface"> <span class="toggle-list-item__label">About Wikipedia</span> </a></li> <li class="toggle-list-item "><a class="toggle-list-item__anchor menu__item--disclaimers" href="https://en-m-wikipedia-org.translate.goog/wiki/Wikipedia:General_disclaimer?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-GB" data-mw="interface"> <span class="toggle-list-item__label">Disclaimers</span> </a></li> </ul> </div><label class="main-menu-mask" for="main-menu-input"></label> </nav> <div class="branding-box"><a href="https://en-m-wikipedia-org.translate.goog/wiki/Main_Page?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-GB"> <span><img src="/static/images/mobile/copyright/wikipedia-wordmark-en.svg" alt="Wikipedia" width="120" height="18" style="width: 7.5em; height: 1.125em;"> </span> </a> </div> <form action="/w/index.php" method="get" class="minerva-search-form"> <div class="search-box"><input type="hidden" name="title" value="Special:Search"> <input class="search skin-minerva-search-trigger" id="searchInput" type="search" name="search" placeholder="Search Wikipedia" aria-label="Search Wikipedia" autocapitalize="sentences" title="Search Wikipedia [f]" accesskey="f"> <span class="search-box-icon-overlay"><span class="minerva-icon minerva-icon--search"></span> </span> </div><button id="searchIcon" class="cdx-button cdx-button--size-large cdx-button--icon-only cdx-button--weight-quiet skin-minerva-search-trigger"> <span class="minerva-icon minerva-icon--search"></span> <span>Search</span> </button> </form> <nav class="minerva-user-navigation" aria-label="User navigation"> </nav> </div> </header> <main id="content" class="mw-body"> <div class="banner-container"> <div id="siteNotice"></div> </div> <div class="pre-content heading-holder"> <div class="page-heading"> <h1 id="firstHeading" class="firstHeading mw-first-heading"><span class="mw-page-title-main">Stirling's approximation</span></h1> <div class="tagline"></div> </div> <ul id="p-associated-pages" class="minerva__tab-container"> <li class="minerva__tab selected"><a class="minerva__tab-text" href="https://en-m-wikipedia-org.translate.goog/wiki/Stirling%27s_approximation?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-GB" rel="" data-event-name="tabs.subject">Article</a></li> <li class="minerva__tab "><a class="minerva__tab-text" href="https://en-m-wikipedia-org.translate.goog/wiki/Talk:Stirling%27s_approximation?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-GB" rel="discussion" data-event-name="tabs.talk">Talk</a></li> </ul> <nav class="page-actions-menu"> <ul id="p-views" class="page-actions-menu__list"> <li id="language-selector" class="page-actions-menu__list-item"><a role="button" href="https://en-m-wikipedia-org.translate.goog/wiki/Stirling's_approximation?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-GB#p-lang" data-mw="interface" data-event-name="menu.languages" title="Language" class="cdx-button cdx-button--size-large cdx-button--fake-button cdx-button--fake-button--enabled cdx-button--icon-only cdx-button--weight-quiet language-selector"> <span class="minerva-icon minerva-icon--language"></span> <span>Language</span> </a></li> <li id="page-actions-watch" class="page-actions-menu__list-item"><a role="button" id="ca-watch" href="https://en-m-wikipedia-org.translate.goog/w/index.php?title=Special:UserLogin&returnto=Stirling's+approximation&_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-GB" data-event-name="menu.watch" class="cdx-button cdx-button--size-large cdx-button--fake-button cdx-button--fake-button--enabled cdx-button--icon-only cdx-button--weight-quiet menu__item--page-actions-watch"> <span class="minerva-icon minerva-icon--star"></span> <span>Watch</span> </a></li> <li id="page-actions-edit" class="page-actions-menu__list-item"><a role="button" id="ca-edit" href="https://en-m-wikipedia-org.translate.goog/w/index.php?title=Stirling's_approximation&action=edit&_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-GB" data-event-name="menu.edit" data-mw="interface" class="cdx-button cdx-button--size-large cdx-button--fake-button cdx-button--fake-button--enabled cdx-button--icon-only cdx-button--weight-quiet edit-page menu__item--page-actions-edit"> <span class="minerva-icon minerva-icon--edit"></span> <span>Edit</span> </a></li> </ul> </nav><!-- version 1.0.2 (change every time you update a partial) --> <div id="mw-content-subtitle"></div> </div> <div id="bodyContent" class="content"> <div id="mw-content-text" class="mw-body-content"> <script>function mfTempOpenSection(id){var block=document.getElementById("mf-section-"+id);block.className+=" open-block";block.previousSibling.className+=" open-block";}</script> <div class="mw-content-ltr mw-parser-output" lang="en" dir="ltr"> <section class="mf-section-0" id="mf-section-0"> <p>In <a href="https://en-m-wikipedia-org.translate.goog/wiki/Mathematics?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-GB" title="Mathematics">mathematics</a>, <b>Stirling's approximation</b> (or <b>Stirling's formula</b>) is an <a href="https://en-m-wikipedia-org.translate.goog/wiki/Asymptotic_analysis?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-GB" title="Asymptotic analysis">asymptotic</a> approximation for <a href="https://en-m-wikipedia-org.translate.goog/wiki/Factorial?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-GB" title="Factorial">factorials</a>. It is a good approximation, leading to accurate results even for small values of <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"> <math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle n}"><semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi> n </mi> </mstyle> </mrow> <annotation encoding="application/x-tex"> {\displaystyle n} </annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/a601995d55609f2d9f5e233e36fbe9ea26011b3b" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:1.395ex; height:1.676ex;" alt="{\displaystyle n}"></span>. It is named after <a href="https://en-m-wikipedia-org.translate.goog/wiki/James_Stirling_(mathematician)?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-GB" title="James Stirling (mathematician)">James Stirling</a>, though a related but less precise result was first stated by <a href="https://en-m-wikipedia-org.translate.goog/wiki/Abraham_de_Moivre?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-GB" title="Abraham de Moivre">Abraham de Moivre</a>.<sup id="cite_ref-dutka_1-0" class="reference"><a href="https://en-m-wikipedia-org.translate.goog/wiki/Stirling's_approximation?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-GB#cite_note-dutka-1"><span class="cite-bracket">[</span>1<span class="cite-bracket">]</span></a></sup><sup id="cite_ref-LeCam1986_2-0" class="reference"><a href="https://en-m-wikipedia-org.translate.goog/wiki/Stirling's_approximation?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-GB#cite_note-LeCam1986-2"><span class="cite-bracket">[</span>2<span class="cite-bracket">]</span></a></sup><sup id="cite_ref-Pearson1924_3-0" class="reference"><a href="https://en-m-wikipedia-org.translate.goog/wiki/Stirling's_approximation?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-GB#cite_note-Pearson1924-3"><span class="cite-bracket">[</span>3<span class="cite-bracket">]</span></a></sup></p> <figure class="mw-default-size mw-halign-right" typeof="mw:File/Thumb"> <a href="https://en-m-wikipedia-org.translate.goog/wiki/File:Mplwp_factorial_gamma_stirling.svg?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-GB" class="mw-file-description"><img src="//upload.wikimedia.org/wikipedia/commons/thumb/4/48/Mplwp_factorial_gamma_stirling.svg/300px-Mplwp_factorial_gamma_stirling.svg.png" decoding="async" width="300" height="200" class="mw-file-element" srcset="https://translate.google.com/website?sl=auto&tl=en&hl=en-GB&u=https://upload.wikimedia.org/wikipedia/commons/thumb/4/48/Mplwp_factorial_gamma_stirling.svg/450px-Mplwp_factorial_gamma_stirling.svg.png 1.5x,https://translate.google.com/website?sl=auto&tl=en&hl=en-GB&u=https://upload.wikimedia.org/wikipedia/commons/thumb/4/48/Mplwp_factorial_gamma_stirling.svg/600px-Mplwp_factorial_gamma_stirling.svg.png 2x" data-file-width="600" data-file-height="400"></a> <figcaption> Comparison of Stirling's approximation with the factorial </figcaption> </figure> <p>One way of stating the approximation involves the <a href="https://en-m-wikipedia-org.translate.goog/wiki/Logarithm?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-GB" title="Logarithm">logarithm</a> of the factorial: <span class="mwe-math-element"><span class="mwe-math-mathml-display mwe-math-mathml-a11y" style="display: none;"> <math display="block" xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \ln(n!)=n\ln n-n+O(\ln n),}"><semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi> ln </mi> <mo> <!-- --> </mo> <mo stretchy="false"> ( </mo> <mi> n </mi> <mo> ! </mo> <mo stretchy="false"> ) </mo> <mo> = </mo> <mi> n </mi> <mi> ln </mi> <mo> <!-- --> </mo> <mi> n </mi> <mo> −<!-- − --> </mo> <mi> n </mi> <mo> + </mo> <mi> O </mi> <mo stretchy="false"> ( </mo> <mi> ln </mi> <mo> <!-- --> </mo> <mi> n </mi> <mo stretchy="false"> ) </mo> <mo> , </mo> </mstyle> </mrow> <annotation encoding="application/x-tex"> {\displaystyle \ln(n!)=n\ln n-n+O(\ln n),} </annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/e36df40589da1d3ac3da57cd2e786e97cb4cac31" class="mwe-math-fallback-image-display mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:29.418ex; height:2.843ex;" alt="{\displaystyle \ln(n!)=n\ln n-n+O(\ln n),}"></span> where the <a href="https://en-m-wikipedia-org.translate.goog/wiki/Big_O_notation?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-GB" title="Big O notation">big O notation</a> means that, for all sufficiently large values of <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"> <math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle n}"><semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi> n </mi> </mstyle> </mrow> <annotation encoding="application/x-tex"> {\displaystyle n} </annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/a601995d55609f2d9f5e233e36fbe9ea26011b3b" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:1.395ex; height:1.676ex;" alt="{\displaystyle n}"></span>, the difference between <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"> <math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \ln(n!)}"><semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi> ln </mi> <mo> <!-- --> </mo> <mo stretchy="false"> ( </mo> <mi> n </mi> <mo> ! </mo> <mo stretchy="false"> ) </mo> </mstyle> </mrow> <annotation encoding="application/x-tex"> {\displaystyle \ln(n!)} </annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/d264f09c80b779e9028658543d5e31ae647cacf1" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:5.79ex; height:2.843ex;" alt="{\displaystyle \ln(n!)}"></span> and <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"> <math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle n\ln n-n}"><semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi> n </mi> <mi> ln </mi> <mo> <!-- --> </mo> <mi> n </mi> <mo> −<!-- − --> </mo> <mi> n </mi> </mstyle> </mrow> <annotation encoding="application/x-tex"> {\displaystyle n\ln n-n} </annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/e38807f2f9c7f462113eee75d0be2e1b5166313a" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.505ex; width:9.738ex; height:2.343ex;" alt="{\displaystyle n\ln n-n}"></span> will be at most proportional to the logarithm of <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"> <math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle n}"><semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi> n </mi> </mstyle> </mrow> <annotation encoding="application/x-tex"> {\displaystyle n} </annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/a601995d55609f2d9f5e233e36fbe9ea26011b3b" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:1.395ex; height:1.676ex;" alt="{\displaystyle n}"></span>. In computer science applications such as the <a href="https://en-m-wikipedia-org.translate.goog/wiki/Comparison_sort?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-GB#Number_of_comparisons_required_to_sort_a_list" title="Comparison sort">worst-case lower bound for comparison sorting</a>, it is convenient to instead use the <a href="https://en-m-wikipedia-org.translate.goog/wiki/Binary_logarithm?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-GB" title="Binary logarithm">binary logarithm</a>, giving the equivalent form <span class="mwe-math-element"><span class="mwe-math-mathml-display mwe-math-mathml-a11y" style="display: none;"> <math display="block" xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \log _{2}(n!)=n\log _{2}n-n\log _{2}e+O(\log _{2}n).}"><semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <msub> <mi> log </mi> <mrow class="MJX-TeXAtom-ORD"> <mn> 2 </mn> </mrow> </msub> <mo> <!-- --> </mo> <mo stretchy="false"> ( </mo> <mi> n </mi> <mo> ! </mo> <mo stretchy="false"> ) </mo> <mo> = </mo> <mi> n </mi> <msub> <mi> log </mi> <mrow class="MJX-TeXAtom-ORD"> <mn> 2 </mn> </mrow> </msub> <mo> <!-- --> </mo> <mi> n </mi> <mo> −<!-- − --> </mo> <mi> n </mi> <msub> <mi> log </mi> <mrow class="MJX-TeXAtom-ORD"> <mn> 2 </mn> </mrow> </msub> <mo> <!-- --> </mo> <mi> e </mi> <mo> + </mo> <mi> O </mi> <mo stretchy="false"> ( </mo> <msub> <mi> log </mi> <mrow class="MJX-TeXAtom-ORD"> <mn> 2 </mn> </mrow> </msub> <mo> <!-- --> </mo> <mi> n </mi> <mo stretchy="false"> ) </mo> <mo> . </mo> </mstyle> </mrow> <annotation encoding="application/x-tex"> {\displaystyle \log _{2}(n!)=n\log _{2}n-n\log _{2}e+O(\log _{2}n).} </annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/7fa4c11db5e9758b508117d276bf7fb509fa4dc4" class="mwe-math-fallback-image-display mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:41.561ex; height:2.843ex;" alt="{\displaystyle \log _{2}(n!)=n\log _{2}n-n\log _{2}e+O(\log _{2}n).}"></span> The error term in either base can be expressed more precisely as <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"> <math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle {\tfrac {1}{2}}\log(2\pi n)+O({\tfrac {1}{n}})}"><semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="false" scriptlevel="0"> <mfrac> <mn> 1 </mn> <mn> 2 </mn> </mfrac> </mstyle> </mrow> <mi> log </mi> <mo> <!-- --> </mo> <mo stretchy="false"> ( </mo> <mn> 2 </mn> <mi> π<!-- π --> </mi> <mi> n </mi> <mo stretchy="false"> ) </mo> <mo> + </mo> <mi> O </mi> <mo stretchy="false"> ( </mo> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="false" scriptlevel="0"> <mfrac> <mn> 1 </mn> <mi> n </mi> </mfrac> </mstyle> </mrow> <mo stretchy="false"> ) </mo> </mstyle> </mrow> <annotation encoding="application/x-tex"> {\displaystyle {\tfrac {1}{2}}\log(2\pi n)+O({\tfrac {1}{n}})} </annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/6b125b6276f948662e1497c2f6231d66dfb8ecee" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -1.171ex; width:18.961ex; height:3.509ex;" alt="{\displaystyle {\tfrac {1}{2}}\log(2\pi n)+O({\tfrac {1}{n}})}"></span>, corresponding to an approximate formula for the factorial itself, <span class="mwe-math-element"><span class="mwe-math-mathml-display mwe-math-mathml-a11y" style="display: none;"> <math display="block" xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle n!\sim {\sqrt {2\pi n}}\left({\frac {n}{e}}\right)^{n}.}"><semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi> n </mi> <mo> ! </mo> <mo> ∼<!-- ∼ --> </mo> <mrow class="MJX-TeXAtom-ORD"> <msqrt> <mn> 2 </mn> <mi> π<!-- π --> </mi> <mi> n </mi> </msqrt> </mrow> <msup> <mrow> <mo> ( </mo> <mrow class="MJX-TeXAtom-ORD"> <mfrac> <mi> n </mi> <mi> e </mi> </mfrac> </mrow> <mo> ) </mo> </mrow> <mrow class="MJX-TeXAtom-ORD"> <mi> n </mi> </mrow> </msup> <mo> . </mo> </mstyle> </mrow> <annotation encoding="application/x-tex"> {\displaystyle n!\sim {\sqrt {2\pi n}}\left({\frac {n}{e}}\right)^{n}.} </annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/3b3c28f23e205ed542a2b9bbeff5c56db3881877" class="mwe-math-fallback-image-display mw-invert skin-invert" aria-hidden="true" style="vertical-align: -1.838ex; width:17.837ex; height:4.843ex;" alt="{\displaystyle n!\sim {\sqrt {2\pi n}}\left({\frac {n}{e}}\right)^{n}.}"></span> Here the sign <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"> <math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \sim }"><semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mo> ∼<!-- ∼ --> </mo> </mstyle> </mrow> <annotation encoding="application/x-tex"> {\displaystyle \sim } </annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/afcc42adfcfdc24d5c4c474869e5d8eaa78d1173" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: 0.307ex; margin-bottom: -0.478ex; width:1.808ex; height:1.343ex;" alt="{\displaystyle \sim }"></span> means that the two quantities are <a href="https://en-m-wikipedia-org.translate.goog/wiki/Asymptotic_analysis?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-GB" title="Asymptotic analysis">asymptotic</a>, that is, that their ratio tends to 1 as <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"> <math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle n}"><semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi> n </mi> </mstyle> </mrow> <annotation encoding="application/x-tex"> {\displaystyle n} </annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/a601995d55609f2d9f5e233e36fbe9ea26011b3b" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:1.395ex; height:1.676ex;" alt="{\displaystyle n}"></span> tends to infinity. The following version of the bound <a class="mw-selflink-fragment" href="https://en-m-wikipedia-org.translate.goog/wiki/Stirling's_approximation?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-GB#Speed_of_convergence_and_error_estimates">holds for all <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"> <math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle n\geq 1}"><semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi> n </mi> <mo> ≥<!-- ≥ --> </mo> <mn> 1 </mn> </mstyle> </mrow> <annotation encoding="application/x-tex"> {\displaystyle n\geq 1} </annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/d8ce9ce38d06f6bf5a3fe063118c09c2b6202bfe" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.505ex; width:5.656ex; height:2.343ex;" alt="{\displaystyle n\geq 1}"></span>, rather than only asymptotically</a>: <span class="mwe-math-element"><span class="mwe-math-mathml-display mwe-math-mathml-a11y" style="display: none;"> <math display="block" xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle {\sqrt {2\pi n}}\ \left({\frac {n}{e}}\right)^{n}e^{\left({\frac {1}{12n}}-{\frac {1}{360n^{3}}}\right)}<n!<{\sqrt {2\pi n}}\ \left({\frac {n}{e}}\right)^{n}e^{\frac {1}{12n}}.}"><semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mrow class="MJX-TeXAtom-ORD"> <msqrt> <mn> 2 </mn> <mi> π<!-- π --> </mi> <mi> n </mi> </msqrt> </mrow> <mtext> </mtext> <msup> <mrow> <mo> ( </mo> <mrow class="MJX-TeXAtom-ORD"> <mfrac> <mi> n </mi> <mi> e </mi> </mfrac> </mrow> <mo> ) </mo> </mrow> <mrow class="MJX-TeXAtom-ORD"> <mi> n </mi> </mrow> </msup> <msup> <mi> e </mi> <mrow class="MJX-TeXAtom-ORD"> <mrow> <mo> ( </mo> <mrow> <mrow class="MJX-TeXAtom-ORD"> <mfrac> <mn> 1 </mn> <mrow> <mn> 12 </mn> <mi> n </mi> </mrow> </mfrac> </mrow> <mo> −<!-- − --> </mo> <mrow class="MJX-TeXAtom-ORD"> <mfrac> <mn> 1 </mn> <mrow> <mn> 360 </mn> <msup> <mi> n </mi> <mrow class="MJX-TeXAtom-ORD"> <mn> 3 </mn> </mrow> </msup> </mrow> </mfrac> </mrow> </mrow> <mo> ) </mo> </mrow> </mrow> </msup> <mo> < </mo> <mi> n </mi> <mo> ! </mo> <mo> < </mo> <mrow class="MJX-TeXAtom-ORD"> <msqrt> <mn> 2 </mn> <mi> π<!-- π --> </mi> <mi> n </mi> </msqrt> </mrow> <mtext> </mtext> <msup> <mrow> <mo> ( </mo> <mrow class="MJX-TeXAtom-ORD"> <mfrac> <mi> n </mi> <mi> e </mi> </mfrac> </mrow> <mo> ) </mo> </mrow> <mrow class="MJX-TeXAtom-ORD"> <mi> n </mi> </mrow> </msup> <msup> <mi> e </mi> <mrow class="MJX-TeXAtom-ORD"> <mfrac> <mn> 1 </mn> <mrow> <mn> 12 </mn> <mi> n </mi> </mrow> </mfrac> </mrow> </msup> <mo> . </mo> </mstyle> </mrow> <annotation encoding="application/x-tex"> {\displaystyle {\sqrt {2\pi n}}\ \left({\frac {n}{e}}\right)^{n}e^{\left({\frac {1}{12n}}-{\frac {1}{360n^{3}}}\right)}<n!<{\sqrt {2\pi n}}\ \left({\frac {n}{e}}\right)^{n}e^{\frac {1}{12n}}.} </annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/a37064928396b06c50c33f83ca9089f88abe3627" class="mwe-math-fallback-image-display mw-invert skin-invert" aria-hidden="true" style="vertical-align: -1.838ex; width:50.858ex; height:6.343ex;" alt="{\displaystyle {\sqrt {2\pi n}}\ \left({\frac {n}{e}}\right)^{n}e^{\left({\frac {1}{12n}}-{\frac {1}{360n^{3}}}\right)}<n!<{\sqrt {2\pi n}}\ \left({\frac {n}{e}}\right)^{n}e^{\frac {1}{12n}}.}"></span></p> <div id="toc" class="toc" role="navigation" aria-labelledby="mw-toc-heading"> <input type="checkbox" role="button" id="toctogglecheckbox" class="toctogglecheckbox" style="display:none"> <div class="toctitle" lang="en" dir="ltr"> <h2 id="mw-toc-heading">Contents</h2><span class="toctogglespan"><label class="toctogglelabel" for="toctogglecheckbox"></label></span> </div> <ul> <li class="toclevel-1 tocsection-1"><a href="https://en-m-wikipedia-org.translate.goog/wiki/Stirling's_approximation?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-GB#Derivation"><span class="tocnumber">1</span> <span class="toctext">Derivation</span></a></li> <li class="toclevel-1 tocsection-2"><a href="https://en-m-wikipedia-org.translate.goog/wiki/Stirling's_approximation?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-GB#Alternative_derivations"><span class="tocnumber">2</span> <span class="toctext">Alternative derivations</span></a> <ul> <li class="toclevel-2 tocsection-3"><a href="https://en-m-wikipedia-org.translate.goog/wiki/Stirling's_approximation?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-GB#Higher_orders"><span class="tocnumber">2.1</span> <span class="toctext">Higher orders</span></a></li> <li class="toclevel-2 tocsection-4"><a href="https://en-m-wikipedia-org.translate.goog/wiki/Stirling's_approximation?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-GB#Complex-analytic_version"><span class="tocnumber">2.2</span> <span class="toctext">Complex-analytic version</span></a></li> </ul></li> <li class="toclevel-1 tocsection-5"><a href="https://en-m-wikipedia-org.translate.goog/wiki/Stirling's_approximation?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-GB#Speed_of_convergence_and_error_estimates"><span class="tocnumber">3</span> <span class="toctext">Speed of convergence and error estimates</span></a></li> <li class="toclevel-1 tocsection-6"><a href="https://en-m-wikipedia-org.translate.goog/wiki/Stirling's_approximation?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-GB#Stirling's_formula_for_the_gamma_function"><span class="tocnumber">4</span> <span class="toctext">Stirling's formula for the gamma function</span></a></li> <li class="toclevel-1 tocsection-7"><a href="https://en-m-wikipedia-org.translate.goog/wiki/Stirling's_approximation?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-GB#Error_bounds"><span class="tocnumber">5</span> <span class="toctext">Error bounds</span></a></li> <li class="toclevel-1 tocsection-8"><a href="https://en-m-wikipedia-org.translate.goog/wiki/Stirling's_approximation?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-GB#A_convergent_version_of_Stirling's_formula"><span class="tocnumber">6</span> <span class="toctext">A convergent version of Stirling's formula</span></a></li> <li class="toclevel-1 tocsection-9"><a href="https://en-m-wikipedia-org.translate.goog/wiki/Stirling's_approximation?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-GB#Versions_suitable_for_calculators"><span class="tocnumber">7</span> <span class="toctext">Versions suitable for calculators</span></a></li> <li class="toclevel-1 tocsection-10"><a href="https://en-m-wikipedia-org.translate.goog/wiki/Stirling's_approximation?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-GB#History"><span class="tocnumber">8</span> <span class="toctext">History</span></a></li> <li class="toclevel-1 tocsection-11"><a href="https://en-m-wikipedia-org.translate.goog/wiki/Stirling's_approximation?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-GB#See_also"><span class="tocnumber">9</span> <span class="toctext">See also</span></a></li> <li class="toclevel-1 tocsection-12"><a href="https://en-m-wikipedia-org.translate.goog/wiki/Stirling's_approximation?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-GB#References"><span class="tocnumber">10</span> <span class="toctext">References</span></a></li> <li class="toclevel-1 tocsection-13"><a href="https://en-m-wikipedia-org.translate.goog/wiki/Stirling's_approximation?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-GB#Further_reading"><span class="tocnumber">11</span> <span class="toctext">Further reading</span></a></li> <li class="toclevel-1 tocsection-14"><a href="https://en-m-wikipedia-org.translate.goog/wiki/Stirling's_approximation?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-GB#External_links"><span class="tocnumber">12</span> <span class="toctext">External links</span></a></li> </ul> </div> </section> <div class="mw-heading mw-heading2 section-heading" onclick="mfTempOpenSection(1)"> <span class="indicator mf-icon mf-icon-expand mf-icon--small"></span> <h2 id="Derivation">Derivation</h2><span class="mw-editsection"> <a role="button" href="https://en-m-wikipedia-org.translate.goog/w/index.php?title=Stirling's_approximation&action=edit&section=1&_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-GB" title="Edit section: Derivation" class="cdx-button cdx-button--size-large cdx-button--fake-button cdx-button--fake-button--enabled cdx-button--icon-only cdx-button--weight-quiet "> <span class="minerva-icon minerva-icon--edit"></span> <span>edit</span> </a> </span> </div> <section class="mf-section-1 collapsible-block" id="mf-section-1"> <p>Roughly speaking, the simplest version of Stirling's formula can be quickly obtained by approximating the sum <span class="mwe-math-element"><span class="mwe-math-mathml-display mwe-math-mathml-a11y" style="display: none;"> <math display="block" xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \ln(n!)=\sum _{j=1}^{n}\ln j}"><semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi> ln </mi> <mo> <!-- --> </mo> <mo stretchy="false"> ( </mo> <mi> n </mi> <mo> ! </mo> <mo stretchy="false"> ) </mo> <mo> = </mo> <munderover> <mo> ∑<!-- ∑ --> </mo> <mrow class="MJX-TeXAtom-ORD"> <mi> j </mi> <mo> = </mo> <mn> 1 </mn> </mrow> <mrow class="MJX-TeXAtom-ORD"> <mi> n </mi> </mrow> </munderover> <mi> ln </mi> <mo> <!-- --> </mo> <mi> j </mi> </mstyle> </mrow> <annotation encoding="application/x-tex"> {\displaystyle \ln(n!)=\sum _{j=1}^{n}\ln j} </annotation> </semantics> </math></span> <noscript> <img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/0b37812cd938e78035eb60bbaf3ce1ccfa624615" class="mwe-math-fallback-image-display mw-invert skin-invert" aria-hidden="true" style="vertical-align: -3.338ex; width:15.915ex; height:7.176ex;" alt="{\displaystyle \ln(n!)=\sum _{j=1}^{n}\ln j}"> </noscript><span class="lazy-image-placeholder" style="width: 15.915ex;height: 7.176ex;vertical-align: -3.338ex;" data-src="https://wikimedia.org/api/rest_v1/media/math/render/svg/0b37812cd938e78035eb60bbaf3ce1ccfa624615" data-alt="{\displaystyle \ln(n!)=\sum _{j=1}^{n}\ln j}" data-class="mwe-math-fallback-image-display mw-invert skin-invert"> </span></span> with an <a href="https://en-m-wikipedia-org.translate.goog/wiki/Integral?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-GB" title="Integral">integral</a>: <span class="mwe-math-element"><span class="mwe-math-mathml-display mwe-math-mathml-a11y" style="display: none;"> <math display="block" xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \sum _{j=1}^{n}\ln j\approx \int _{1}^{n}\ln x\,{\rm {d}}x=n\ln n-n+1.}"><semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <munderover> <mo> ∑<!-- ∑ --> </mo> <mrow class="MJX-TeXAtom-ORD"> <mi> j </mi> <mo> = </mo> <mn> 1 </mn> </mrow> <mrow class="MJX-TeXAtom-ORD"> <mi> n </mi> </mrow> </munderover> <mi> ln </mi> <mo> <!-- --> </mo> <mi> j </mi> <mo> ≈<!-- ≈ --> </mo> <msubsup> <mo> ∫<!-- ∫ --> </mo> <mrow class="MJX-TeXAtom-ORD"> <mn> 1 </mn> </mrow> <mrow class="MJX-TeXAtom-ORD"> <mi> n </mi> </mrow> </msubsup> <mi> ln </mi> <mo> <!-- --> </mo> <mi> x </mi> <mspace width="thinmathspace"></mspace> <mrow class="MJX-TeXAtom-ORD"> <mrow class="MJX-TeXAtom-ORD"> <mi mathvariant="normal"> d </mi> </mrow> </mrow> <mi> x </mi> <mo> = </mo> <mi> n </mi> <mi> ln </mi> <mo> <!-- --> </mo> <mi> n </mi> <mo> −<!-- − --> </mo> <mi> n </mi> <mo> + </mo> <mn> 1. </mn> </mstyle> </mrow> <annotation encoding="application/x-tex"> {\displaystyle \sum _{j=1}^{n}\ln j\approx \int _{1}^{n}\ln x\,{\rm {d}}x=n\ln n-n+1.} </annotation> </semantics> </math></span> <noscript> <img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/a35e8e0205988cf8552eec558d121f764d7e4021" class="mwe-math-fallback-image-display mw-invert skin-invert" aria-hidden="true" style="vertical-align: -3.338ex; width:38.346ex; height:7.176ex;" alt="{\displaystyle \sum _{j=1}^{n}\ln j\approx \int _{1}^{n}\ln x\,{\rm {d}}x=n\ln n-n+1.}"> </noscript><span class="lazy-image-placeholder" style="width: 38.346ex;height: 7.176ex;vertical-align: -3.338ex;" data-src="https://wikimedia.org/api/rest_v1/media/math/render/svg/a35e8e0205988cf8552eec558d121f764d7e4021" data-alt="{\displaystyle \sum _{j=1}^{n}\ln j\approx \int _{1}^{n}\ln x\,{\rm {d}}x=n\ln n-n+1.}" data-class="mwe-math-fallback-image-display mw-invert skin-invert"> </span></span></p> <p>The full formula, together with precise estimates of its error, can be derived as follows. Instead of approximating <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"> <math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle n!}"><semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi> n </mi> <mo> ! </mo> </mstyle> </mrow> <annotation encoding="application/x-tex"> {\displaystyle n!} </annotation> </semantics> </math></span> <noscript> <img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/bae971720be3cc9b8d82f4cdac89cb89877514a6" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:2.042ex; height:2.176ex;" alt="{\displaystyle n!}"> </noscript><span class="lazy-image-placeholder" style="width: 2.042ex;height: 2.176ex;vertical-align: -0.338ex;" data-src="https://wikimedia.org/api/rest_v1/media/math/render/svg/bae971720be3cc9b8d82f4cdac89cb89877514a6" data-alt="{\displaystyle n!}" data-class="mwe-math-fallback-image-inline mw-invert skin-invert"> </span></span>, one considers its <a href="https://en-m-wikipedia-org.translate.goog/wiki/Natural_logarithm?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-GB" title="Natural logarithm">natural logarithm</a>, as this is a <a href="https://en-m-wikipedia-org.translate.goog/wiki/Slowly_varying_function?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-GB" title="Slowly varying function">slowly varying function</a>: <span class="mwe-math-element"><span class="mwe-math-mathml-display mwe-math-mathml-a11y" style="display: none;"> <math display="block" xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \ln(n!)=\ln 1+\ln 2+\cdots +\ln n.}"><semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi> ln </mi> <mo> <!-- --> </mo> <mo stretchy="false"> ( </mo> <mi> n </mi> <mo> ! </mo> <mo stretchy="false"> ) </mo> <mo> = </mo> <mi> ln </mi> <mo> <!-- --> </mo> <mn> 1 </mn> <mo> + </mo> <mi> ln </mi> <mo> <!-- --> </mo> <mn> 2 </mn> <mo> + </mo> <mo> ⋯<!-- ⋯ --> </mo> <mo> + </mo> <mi> ln </mi> <mo> <!-- --> </mo> <mi> n </mi> <mo> . </mo> </mstyle> </mrow> <annotation encoding="application/x-tex"> {\displaystyle \ln(n!)=\ln 1+\ln 2+\cdots +\ln n.} </annotation> </semantics> </math></span> <noscript> <img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/ef550ba2dbfb9b226fa3fb08d7c8eee738f3ced5" class="mwe-math-fallback-image-display mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:31.479ex; height:2.843ex;" alt="{\displaystyle \ln(n!)=\ln 1+\ln 2+\cdots +\ln n.}"> </noscript><span class="lazy-image-placeholder" style="width: 31.479ex;height: 2.843ex;vertical-align: -0.838ex;" data-src="https://wikimedia.org/api/rest_v1/media/math/render/svg/ef550ba2dbfb9b226fa3fb08d7c8eee738f3ced5" data-alt="{\displaystyle \ln(n!)=\ln 1+\ln 2+\cdots +\ln n.}" data-class="mwe-math-fallback-image-display mw-invert skin-invert"> </span></span></p> <p>The right-hand side of this equation minus <span class="mwe-math-element"><span class="mwe-math-mathml-display mwe-math-mathml-a11y" style="display: none;"> <math display="block" xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle {\tfrac {1}{2}}(\ln 1+\ln n)={\tfrac {1}{2}}\ln n}"><semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="false" scriptlevel="0"> <mfrac> <mn> 1 </mn> <mn> 2 </mn> </mfrac> </mstyle> </mrow> <mo stretchy="false"> ( </mo> <mi> ln </mi> <mo> <!-- --> </mo> <mn> 1 </mn> <mo> + </mo> <mi> ln </mi> <mo> <!-- --> </mo> <mi> n </mi> <mo stretchy="false"> ) </mo> <mo> = </mo> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="false" scriptlevel="0"> <mfrac> <mn> 1 </mn> <mn> 2 </mn> </mfrac> </mstyle> </mrow> <mi> ln </mi> <mo> <!-- --> </mo> <mi> n </mi> </mstyle> </mrow> <annotation encoding="application/x-tex"> {\displaystyle {\tfrac {1}{2}}(\ln 1+\ln n)={\tfrac {1}{2}}\ln n} </annotation> </semantics> </math></span> <noscript> <img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/3ff466fe2a6a445eb057ba2a96e93848c2b4116c" class="mwe-math-fallback-image-display mw-invert skin-invert" aria-hidden="true" style="vertical-align: -1.171ex; width:22.383ex; height:3.509ex;" alt="{\displaystyle {\tfrac {1}{2}}(\ln 1+\ln n)={\tfrac {1}{2}}\ln n}"> </noscript><span class="lazy-image-placeholder" style="width: 22.383ex;height: 3.509ex;vertical-align: -1.171ex;" data-src="https://wikimedia.org/api/rest_v1/media/math/render/svg/3ff466fe2a6a445eb057ba2a96e93848c2b4116c" data-alt="{\displaystyle {\tfrac {1}{2}}(\ln 1+\ln n)={\tfrac {1}{2}}\ln n}" data-class="mwe-math-fallback-image-display mw-invert skin-invert"> </span></span> is the approximation by the <a href="https://en-m-wikipedia-org.translate.goog/wiki/Trapezoid_rule?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-GB" class="mw-redirect" title="Trapezoid rule">trapezoid rule</a> of the integral <span class="mwe-math-element"><span class="mwe-math-mathml-display mwe-math-mathml-a11y" style="display: none;"> <math display="block" xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \ln(n!)-{\tfrac {1}{2}}\ln n\approx \int _{1}^{n}\ln x\,{\rm {d}}x=n\ln n-n+1,}"><semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi> ln </mi> <mo> <!-- --> </mo> <mo stretchy="false"> ( </mo> <mi> n </mi> <mo> ! </mo> <mo stretchy="false"> ) </mo> <mo> −<!-- − --> </mo> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="false" scriptlevel="0"> <mfrac> <mn> 1 </mn> <mn> 2 </mn> </mfrac> </mstyle> </mrow> <mi> ln </mi> <mo> <!-- --> </mo> <mi> n </mi> <mo> ≈<!-- ≈ --> </mo> <msubsup> <mo> ∫<!-- ∫ --> </mo> <mrow class="MJX-TeXAtom-ORD"> <mn> 1 </mn> </mrow> <mrow class="MJX-TeXAtom-ORD"> <mi> n </mi> </mrow> </msubsup> <mi> ln </mi> <mo> <!-- --> </mo> <mi> x </mi> <mspace width="thinmathspace"></mspace> <mrow class="MJX-TeXAtom-ORD"> <mrow class="MJX-TeXAtom-ORD"> <mi mathvariant="normal"> d </mi> </mrow> </mrow> <mi> x </mi> <mo> = </mo> <mi> n </mi> <mi> ln </mi> <mo> <!-- --> </mo> <mi> n </mi> <mo> −<!-- − --> </mo> <mi> n </mi> <mo> + </mo> <mn> 1 </mn> <mo> , </mo> </mstyle> </mrow> <annotation encoding="application/x-tex"> {\displaystyle \ln(n!)-{\tfrac {1}{2}}\ln n\approx \int _{1}^{n}\ln x\,{\rm {d}}x=n\ln n-n+1,} </annotation> </semantics> </math></span> <noscript> <img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/a6a6b30d17f28e2c139ac56d455fcbc7d4eb29d6" class="mwe-math-fallback-image-display mw-invert skin-invert" aria-hidden="true" style="vertical-align: -2.338ex; width:45.717ex; height:5.843ex;" alt="{\displaystyle \ln(n!)-{\tfrac {1}{2}}\ln n\approx \int _{1}^{n}\ln x\,{\rm {d}}x=n\ln n-n+1,}"> </noscript><span class="lazy-image-placeholder" style="width: 45.717ex;height: 5.843ex;vertical-align: -2.338ex;" data-src="https://wikimedia.org/api/rest_v1/media/math/render/svg/a6a6b30d17f28e2c139ac56d455fcbc7d4eb29d6" data-alt="{\displaystyle \ln(n!)-{\tfrac {1}{2}}\ln n\approx \int _{1}^{n}\ln x\,{\rm {d}}x=n\ln n-n+1,}" data-class="mwe-math-fallback-image-display mw-invert skin-invert"> </span></span></p> <p>and the error in this approximation is given by the <a href="https://en-m-wikipedia-org.translate.goog/wiki/Euler%E2%80%93Maclaurin_formula?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-GB" title="Euler–Maclaurin formula">Euler–Maclaurin formula</a>: <span class="mwe-math-element"><span class="mwe-math-mathml-display mwe-math-mathml-a11y" style="display: none;"> <math display="block" xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle {\begin{aligned}\ln(n!)-{\tfrac {1}{2}}\ln n&={\tfrac {1}{2}}\ln 1+\ln 2+\ln 3+\cdots +\ln(n-1)+{\tfrac {1}{2}}\ln n\\&=n\ln n-n+1+\sum _{k=2}^{m}{\frac {(-1)^{k}B_{k}}{k(k-1)}}\left({\frac {1}{n^{k-1}}}-1\right)+R_{m,n},\end{aligned}}}"><semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mrow class="MJX-TeXAtom-ORD"> <mtable columnalign="right left right left right left right left right left right left" rowspacing="3pt" columnspacing="0em 2em 0em 2em 0em 2em 0em 2em 0em 2em 0em" displaystyle="true"> <mtr> <mtd> <mi> ln </mi> <mo> <!-- --> </mo> <mo stretchy="false"> ( </mo> <mi> n </mi> <mo> ! </mo> <mo stretchy="false"> ) </mo> <mo> −<!-- − --> </mo> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="false" scriptlevel="0"> <mfrac> <mn> 1 </mn> <mn> 2 </mn> </mfrac> </mstyle> </mrow> <mi> ln </mi> <mo> <!-- --> </mo> <mi> n </mi> </mtd> <mtd> <mi></mi> <mo> = </mo> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="false" scriptlevel="0"> <mfrac> <mn> 1 </mn> <mn> 2 </mn> </mfrac> </mstyle> </mrow> <mi> ln </mi> <mo> <!-- --> </mo> <mn> 1 </mn> <mo> + </mo> <mi> ln </mi> <mo> <!-- --> </mo> <mn> 2 </mn> <mo> + </mo> <mi> ln </mi> <mo> <!-- --> </mo> <mn> 3 </mn> <mo> + </mo> <mo> ⋯<!-- ⋯ --> </mo> <mo> + </mo> <mi> ln </mi> <mo> <!-- --> </mo> <mo stretchy="false"> ( </mo> <mi> n </mi> <mo> −<!-- − --> </mo> <mn> 1 </mn> <mo stretchy="false"> ) </mo> <mo> + </mo> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="false" scriptlevel="0"> <mfrac> <mn> 1 </mn> <mn> 2 </mn> </mfrac> </mstyle> </mrow> <mi> ln </mi> <mo> <!-- --> </mo> <mi> n </mi> </mtd> </mtr> <mtr> <mtd></mtd> <mtd> <mi></mi> <mo> = </mo> <mi> n </mi> <mi> ln </mi> <mo> <!-- --> </mo> <mi> n </mi> <mo> −<!-- − --> </mo> <mi> n </mi> <mo> + </mo> <mn> 1 </mn> <mo> + </mo> <munderover> <mo> ∑<!-- ∑ --> </mo> <mrow class="MJX-TeXAtom-ORD"> <mi> k </mi> <mo> = </mo> <mn> 2 </mn> </mrow> <mrow class="MJX-TeXAtom-ORD"> <mi> m </mi> </mrow> </munderover> <mrow class="MJX-TeXAtom-ORD"> <mfrac> <mrow> <mo stretchy="false"> ( </mo> <mo> −<!-- − --> </mo> <mn> 1 </mn> <msup> <mo stretchy="false"> ) </mo> <mrow class="MJX-TeXAtom-ORD"> <mi> k </mi> </mrow> </msup> <msub> <mi> B </mi> <mrow class="MJX-TeXAtom-ORD"> <mi> k </mi> </mrow> </msub> </mrow> <mrow> <mi> k </mi> <mo stretchy="false"> ( </mo> <mi> k </mi> <mo> −<!-- − --> </mo> <mn> 1 </mn> <mo stretchy="false"> ) </mo> </mrow> </mfrac> </mrow> <mrow> <mo> ( </mo> <mrow> <mrow class="MJX-TeXAtom-ORD"> <mfrac> <mn> 1 </mn> <msup> <mi> n </mi> <mrow class="MJX-TeXAtom-ORD"> <mi> k </mi> <mo> −<!-- − --> </mo> <mn> 1 </mn> </mrow> </msup> </mfrac> </mrow> <mo> −<!-- − --> </mo> <mn> 1 </mn> </mrow> <mo> ) </mo> </mrow> <mo> + </mo> <msub> <mi> R </mi> <mrow class="MJX-TeXAtom-ORD"> <mi> m </mi> <mo> , </mo> <mi> n </mi> </mrow> </msub> <mo> , </mo> </mtd> </mtr> </mtable> </mrow> </mstyle> </mrow> <annotation encoding="application/x-tex"> {\displaystyle {\begin{aligned}\ln(n!)-{\tfrac {1}{2}}\ln n&={\tfrac {1}{2}}\ln 1+\ln 2+\ln 3+\cdots +\ln(n-1)+{\tfrac {1}{2}}\ln n\\&=n\ln n-n+1+\sum _{k=2}^{m}{\frac {(-1)^{k}B_{k}}{k(k-1)}}\left({\frac {1}{n^{k-1}}}-1\right)+R_{m,n},\end{aligned}}} </annotation> </semantics> </math></span> <noscript> <img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/559acb779d1d9e2ca828e3f8ebec37ebee2a8b6e" class="mwe-math-fallback-image-display mw-invert skin-invert" aria-hidden="true" style="vertical-align: -4.838ex; width:69.729ex; height:10.843ex;" alt="{\displaystyle {\begin{aligned}\ln(n!)-{\tfrac {1}{2}}\ln n&={\tfrac {1}{2}}\ln 1+\ln 2+\ln 3+\cdots +\ln(n-1)+{\tfrac {1}{2}}\ln n\\&=n\ln n-n+1+\sum _{k=2}^{m}{\frac {(-1)^{k}B_{k}}{k(k-1)}}\left({\frac {1}{n^{k-1}}}-1\right)+R_{m,n},\end{aligned}}}"> </noscript><span class="lazy-image-placeholder" style="width: 69.729ex;height: 10.843ex;vertical-align: -4.838ex;" data-src="https://wikimedia.org/api/rest_v1/media/math/render/svg/559acb779d1d9e2ca828e3f8ebec37ebee2a8b6e" data-alt="{\displaystyle {\begin{aligned}\ln(n!)-{\tfrac {1}{2}}\ln n&={\tfrac {1}{2}}\ln 1+\ln 2+\ln 3+\cdots +\ln(n-1)+{\tfrac {1}{2}}\ln n\\&=n\ln n-n+1+\sum _{k=2}^{m}{\frac {(-1)^{k}B_{k}}{k(k-1)}}\left({\frac {1}{n^{k-1}}}-1\right)+R_{m,n},\end{aligned}}}" data-class="mwe-math-fallback-image-display mw-invert skin-invert"> </span></span></p> <p>where <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"> <math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle B_{k}}"><semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <msub> <mi> B </mi> <mrow class="MJX-TeXAtom-ORD"> <mi> k </mi> </mrow> </msub> </mstyle> </mrow> <annotation encoding="application/x-tex"> {\displaystyle B_{k}} </annotation> </semantics> </math></span> <noscript> <img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/6a6457760e36cf45e1471e33bcc1536cb4802fb9" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.671ex; width:2.853ex; height:2.509ex;" alt="{\displaystyle B_{k}}"> </noscript><span class="lazy-image-placeholder" style="width: 2.853ex;height: 2.509ex;vertical-align: -0.671ex;" data-src="https://wikimedia.org/api/rest_v1/media/math/render/svg/6a6457760e36cf45e1471e33bcc1536cb4802fb9" data-alt="{\displaystyle B_{k}}" data-class="mwe-math-fallback-image-inline mw-invert skin-invert"> </span></span> is a <a href="https://en-m-wikipedia-org.translate.goog/wiki/Bernoulli_number?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-GB" title="Bernoulli number">Bernoulli number</a>, and <span class="texhtml"><i>R</i><sub><i>m</i>,<i>n</i></sub></span> is the remainder term in the Euler–Maclaurin formula. Take limits to find that <span class="mwe-math-element"><span class="mwe-math-mathml-display mwe-math-mathml-a11y" style="display: none;"> <math display="block" xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \lim _{n\to \infty }\left(\ln(n!)-n\ln n+n-{\tfrac {1}{2}}\ln n\right)=1-\sum _{k=2}^{m}{\frac {(-1)^{k}B_{k}}{k(k-1)}}+\lim _{n\to \infty }R_{m,n}.}"><semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <munder> <mo movablelimits="true" form="prefix"> lim </mo> <mrow class="MJX-TeXAtom-ORD"> <mi> n </mi> <mo stretchy="false"> →<!-- → --> </mo> <mi mathvariant="normal"> ∞<!-- ∞ --> </mi> </mrow> </munder> <mrow> <mo> ( </mo> <mrow> <mi> ln </mi> <mo> <!-- --> </mo> <mo stretchy="false"> ( </mo> <mi> n </mi> <mo> ! </mo> <mo stretchy="false"> ) </mo> <mo> −<!-- − --> </mo> <mi> n </mi> <mi> ln </mi> <mo> <!-- --> </mo> <mi> n </mi> <mo> + </mo> <mi> n </mi> <mo> −<!-- − --> </mo> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="false" scriptlevel="0"> <mfrac> <mn> 1 </mn> <mn> 2 </mn> </mfrac> </mstyle> </mrow> <mi> ln </mi> <mo> <!-- --> </mo> <mi> n </mi> </mrow> <mo> ) </mo> </mrow> <mo> = </mo> <mn> 1 </mn> <mo> −<!-- − --> </mo> <munderover> <mo> ∑<!-- ∑ --> </mo> <mrow class="MJX-TeXAtom-ORD"> <mi> k </mi> <mo> = </mo> <mn> 2 </mn> </mrow> <mrow class="MJX-TeXAtom-ORD"> <mi> m </mi> </mrow> </munderover> <mrow class="MJX-TeXAtom-ORD"> <mfrac> <mrow> <mo stretchy="false"> ( </mo> <mo> −<!-- − --> </mo> <mn> 1 </mn> <msup> <mo stretchy="false"> ) </mo> <mrow class="MJX-TeXAtom-ORD"> <mi> k </mi> </mrow> </msup> <msub> <mi> B </mi> <mrow class="MJX-TeXAtom-ORD"> <mi> k </mi> </mrow> </msub> </mrow> <mrow> <mi> k </mi> <mo stretchy="false"> ( </mo> <mi> k </mi> <mo> −<!-- − --> </mo> <mn> 1 </mn> <mo stretchy="false"> ) </mo> </mrow> </mfrac> </mrow> <mo> + </mo> <munder> <mo movablelimits="true" form="prefix"> lim </mo> <mrow class="MJX-TeXAtom-ORD"> <mi> n </mi> <mo stretchy="false"> →<!-- → --> </mo> <mi mathvariant="normal"> ∞<!-- ∞ --> </mi> </mrow> </munder> <msub> <mi> R </mi> <mrow class="MJX-TeXAtom-ORD"> <mi> m </mi> <mo> , </mo> <mi> n </mi> </mrow> </msub> <mo> . </mo> </mstyle> </mrow> <annotation encoding="application/x-tex"> {\displaystyle \lim _{n\to \infty }\left(\ln(n!)-n\ln n+n-{\tfrac {1}{2}}\ln n\right)=1-\sum _{k=2}^{m}{\frac {(-1)^{k}B_{k}}{k(k-1)}}+\lim _{n\to \infty }R_{m,n}.} </annotation> </semantics> </math></span> <noscript> <img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/e1de677b895e298f6e743494ca20df4f6c33349f" class="mwe-math-fallback-image-display mw-invert skin-invert" aria-hidden="true" style="vertical-align: -3.005ex; width:67.195ex; height:7.009ex;" alt="{\displaystyle \lim _{n\to \infty }\left(\ln(n!)-n\ln n+n-{\tfrac {1}{2}}\ln n\right)=1-\sum _{k=2}^{m}{\frac {(-1)^{k}B_{k}}{k(k-1)}}+\lim _{n\to \infty }R_{m,n}.}"> </noscript><span class="lazy-image-placeholder" style="width: 67.195ex;height: 7.009ex;vertical-align: -3.005ex;" data-src="https://wikimedia.org/api/rest_v1/media/math/render/svg/e1de677b895e298f6e743494ca20df4f6c33349f" data-alt="{\displaystyle \lim _{n\to \infty }\left(\ln(n!)-n\ln n+n-{\tfrac {1}{2}}\ln n\right)=1-\sum _{k=2}^{m}{\frac {(-1)^{k}B_{k}}{k(k-1)}}+\lim _{n\to \infty }R_{m,n}.}" data-class="mwe-math-fallback-image-display mw-invert skin-invert"> </span></span></p> <p>Denote this limit as <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"> <math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle y}"><semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi> y </mi> </mstyle> </mrow> <annotation encoding="application/x-tex"> {\displaystyle y} </annotation> </semantics> </math></span> <noscript> <img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/b8a6208ec717213d4317e666f1ae872e00620a0d" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.671ex; width:1.155ex; height:2.009ex;" alt="{\displaystyle y}"> </noscript><span class="lazy-image-placeholder" style="width: 1.155ex;height: 2.009ex;vertical-align: -0.671ex;" data-src="https://wikimedia.org/api/rest_v1/media/math/render/svg/b8a6208ec717213d4317e666f1ae872e00620a0d" data-alt="{\displaystyle y}" data-class="mwe-math-fallback-image-inline mw-invert skin-invert"> </span></span>. Because the remainder <span class="texhtml"><i>R</i><sub><i>m</i>,<i>n</i></sub></span> in the Euler–Maclaurin formula satisfies <span class="mwe-math-element"><span class="mwe-math-mathml-display mwe-math-mathml-a11y" style="display: none;"> <math display="block" xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle R_{m,n}=\lim _{n\to \infty }R_{m,n}+O\left({\frac {1}{n^{m}}}\right),}"><semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <msub> <mi> R </mi> <mrow class="MJX-TeXAtom-ORD"> <mi> m </mi> <mo> , </mo> <mi> n </mi> </mrow> </msub> <mo> = </mo> <munder> <mo movablelimits="true" form="prefix"> lim </mo> <mrow class="MJX-TeXAtom-ORD"> <mi> n </mi> <mo stretchy="false"> →<!-- → --> </mo> <mi mathvariant="normal"> ∞<!-- ∞ --> </mi> </mrow> </munder> <msub> <mi> R </mi> <mrow class="MJX-TeXAtom-ORD"> <mi> m </mi> <mo> , </mo> <mi> n </mi> </mrow> </msub> <mo> + </mo> <mi> O </mi> <mrow> <mo> ( </mo> <mrow class="MJX-TeXAtom-ORD"> <mfrac> <mn> 1 </mn> <msup> <mi> n </mi> <mrow class="MJX-TeXAtom-ORD"> <mi> m </mi> </mrow> </msup> </mfrac> </mrow> <mo> ) </mo> </mrow> <mo> , </mo> </mstyle> </mrow> <annotation encoding="application/x-tex"> {\displaystyle R_{m,n}=\lim _{n\to \infty }R_{m,n}+O\left({\frac {1}{n^{m}}}\right),} </annotation> </semantics> </math></span> <noscript> <img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/385ea6e95b78cc25641016606c4d729fb1d9dfc3" class="mwe-math-fallback-image-display mw-invert skin-invert" aria-hidden="true" style="vertical-align: -2.505ex; width:30.885ex; height:6.176ex;" alt="{\displaystyle R_{m,n}=\lim _{n\to \infty }R_{m,n}+O\left({\frac {1}{n^{m}}}\right),}"> </noscript><span class="lazy-image-placeholder" style="width: 30.885ex;height: 6.176ex;vertical-align: -2.505ex;" data-src="https://wikimedia.org/api/rest_v1/media/math/render/svg/385ea6e95b78cc25641016606c4d729fb1d9dfc3" data-alt="{\displaystyle R_{m,n}=\lim _{n\to \infty }R_{m,n}+O\left({\frac {1}{n^{m}}}\right),}" data-class="mwe-math-fallback-image-display mw-invert skin-invert"> </span></span></p> <p>where <a href="https://en-m-wikipedia-org.translate.goog/wiki/Big-O_notation?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-GB" class="mw-redirect" title="Big-O notation">big-O notation</a> is used, combining the equations above yields the approximation formula in its logarithmic form: <span class="mwe-math-element"><span class="mwe-math-mathml-display mwe-math-mathml-a11y" style="display: none;"> <math display="block" xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \ln(n!)=n\ln \left({\frac {n}{e}}\right)+{\tfrac {1}{2}}\ln n+y+\sum _{k=2}^{m}{\frac {(-1)^{k}B_{k}}{k(k-1)n^{k-1}}}+O\left({\frac {1}{n^{m}}}\right).}"><semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi> ln </mi> <mo> <!-- --> </mo> <mo stretchy="false"> ( </mo> <mi> n </mi> <mo> ! </mo> <mo stretchy="false"> ) </mo> <mo> = </mo> <mi> n </mi> <mi> ln </mi> <mo> <!-- --> </mo> <mrow> <mo> ( </mo> <mrow class="MJX-TeXAtom-ORD"> <mfrac> <mi> n </mi> <mi> e </mi> </mfrac> </mrow> <mo> ) </mo> </mrow> <mo> + </mo> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="false" scriptlevel="0"> <mfrac> <mn> 1 </mn> <mn> 2 </mn> </mfrac> </mstyle> </mrow> <mi> ln </mi> <mo> <!-- --> </mo> <mi> n </mi> <mo> + </mo> <mi> y </mi> <mo> + </mo> <munderover> <mo> ∑<!-- ∑ --> </mo> <mrow class="MJX-TeXAtom-ORD"> <mi> k </mi> <mo> = </mo> <mn> 2 </mn> </mrow> <mrow class="MJX-TeXAtom-ORD"> <mi> m </mi> </mrow> </munderover> <mrow class="MJX-TeXAtom-ORD"> <mfrac> <mrow> <mo stretchy="false"> ( </mo> <mo> −<!-- − --> </mo> <mn> 1 </mn> <msup> <mo stretchy="false"> ) </mo> <mrow class="MJX-TeXAtom-ORD"> <mi> k </mi> </mrow> </msup> <msub> <mi> B </mi> <mrow class="MJX-TeXAtom-ORD"> <mi> k </mi> </mrow> </msub> </mrow> <mrow> <mi> k </mi> <mo stretchy="false"> ( </mo> <mi> k </mi> <mo> −<!-- − --> </mo> <mn> 1 </mn> <mo stretchy="false"> ) </mo> <msup> <mi> n </mi> <mrow class="MJX-TeXAtom-ORD"> <mi> k </mi> <mo> −<!-- − --> </mo> <mn> 1 </mn> </mrow> </msup> </mrow> </mfrac> </mrow> <mo> + </mo> <mi> O </mi> <mrow> <mo> ( </mo> <mrow class="MJX-TeXAtom-ORD"> <mfrac> <mn> 1 </mn> <msup> <mi> n </mi> <mrow class="MJX-TeXAtom-ORD"> <mi> m </mi> </mrow> </msup> </mfrac> </mrow> <mo> ) </mo> </mrow> <mo> . </mo> </mstyle> </mrow> <annotation encoding="application/x-tex"> {\displaystyle \ln(n!)=n\ln \left({\frac {n}{e}}\right)+{\tfrac {1}{2}}\ln n+y+\sum _{k=2}^{m}{\frac {(-1)^{k}B_{k}}{k(k-1)n^{k-1}}}+O\left({\frac {1}{n^{m}}}\right).} </annotation> </semantics> </math></span> <noscript> <img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/28b026d2e5f73bf6ce88c47c248844d4cf622a73" class="mwe-math-fallback-image-display mw-invert skin-invert" aria-hidden="true" style="vertical-align: -3.005ex; width:63.818ex; height:7.009ex;" alt="{\displaystyle \ln(n!)=n\ln \left({\frac {n}{e}}\right)+{\tfrac {1}{2}}\ln n+y+\sum _{k=2}^{m}{\frac {(-1)^{k}B_{k}}{k(k-1)n^{k-1}}}+O\left({\frac {1}{n^{m}}}\right).}"> </noscript><span class="lazy-image-placeholder" style="width: 63.818ex;height: 7.009ex;vertical-align: -3.005ex;" data-src="https://wikimedia.org/api/rest_v1/media/math/render/svg/28b026d2e5f73bf6ce88c47c248844d4cf622a73" data-alt="{\displaystyle \ln(n!)=n\ln \left({\frac {n}{e}}\right)+{\tfrac {1}{2}}\ln n+y+\sum _{k=2}^{m}{\frac {(-1)^{k}B_{k}}{k(k-1)n^{k-1}}}+O\left({\frac {1}{n^{m}}}\right).}" data-class="mwe-math-fallback-image-display mw-invert skin-invert"> </span></span></p> <p>Taking the exponential of both sides and choosing any positive integer <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"> <math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle m}"><semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi> m </mi> </mstyle> </mrow> <annotation encoding="application/x-tex"> {\displaystyle m} </annotation> </semantics> </math></span> <noscript> <img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/0a07d98bb302f3856cbabc47b2b9016692e3f7bc" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:2.04ex; height:1.676ex;" alt="{\displaystyle m}"> </noscript><span class="lazy-image-placeholder" style="width: 2.04ex;height: 1.676ex;vertical-align: -0.338ex;" data-src="https://wikimedia.org/api/rest_v1/media/math/render/svg/0a07d98bb302f3856cbabc47b2b9016692e3f7bc" data-alt="{\displaystyle m}" data-class="mwe-math-fallback-image-inline mw-invert skin-invert"> </span></span>, one obtains a formula involving an unknown quantity <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"> <math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle e^{y}}"><semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <msup> <mi> e </mi> <mrow class="MJX-TeXAtom-ORD"> <mi> y </mi> </mrow> </msup> </mstyle> </mrow> <annotation encoding="application/x-tex"> {\displaystyle e^{y}} </annotation> </semantics> </math></span> <noscript> <img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/7ff26085237c8dc6802eba0882a8aea22e890183" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:2.133ex; height:2.343ex;" alt="{\displaystyle e^{y}}"> </noscript><span class="lazy-image-placeholder" style="width: 2.133ex;height: 2.343ex;vertical-align: -0.338ex;" data-src="https://wikimedia.org/api/rest_v1/media/math/render/svg/7ff26085237c8dc6802eba0882a8aea22e890183" data-alt="{\displaystyle e^{y}}" data-class="mwe-math-fallback-image-inline mw-invert skin-invert"> </span></span>. For <span class="texhtml"><i>m</i> = 1</span>, the formula is <span class="mwe-math-element"><span class="mwe-math-mathml-display mwe-math-mathml-a11y" style="display: none;"> <math display="block" xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle n!=e^{y}{\sqrt {n}}\left({\frac {n}{e}}\right)^{n}\left(1+O\left({\frac {1}{n}}\right)\right).}"><semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi> n </mi> <mo> ! </mo> <mo> = </mo> <msup> <mi> e </mi> <mrow class="MJX-TeXAtom-ORD"> <mi> y </mi> </mrow> </msup> <mrow class="MJX-TeXAtom-ORD"> <msqrt> <mi> n </mi> </msqrt> </mrow> <msup> <mrow> <mo> ( </mo> <mrow class="MJX-TeXAtom-ORD"> <mfrac> <mi> n </mi> <mi> e </mi> </mfrac> </mrow> <mo> ) </mo> </mrow> <mrow class="MJX-TeXAtom-ORD"> <mi> n </mi> </mrow> </msup> <mrow> <mo> ( </mo> <mrow> <mn> 1 </mn> <mo> + </mo> <mi> O </mi> <mrow> <mo> ( </mo> <mrow class="MJX-TeXAtom-ORD"> <mfrac> <mn> 1 </mn> <mi> n </mi> </mfrac> </mrow> <mo> ) </mo> </mrow> </mrow> <mo> ) </mo> </mrow> <mo> . </mo> </mstyle> </mrow> <annotation encoding="application/x-tex"> {\displaystyle n!=e^{y}{\sqrt {n}}\left({\frac {n}{e}}\right)^{n}\left(1+O\left({\frac {1}{n}}\right)\right).} </annotation> </semantics> </math></span> <noscript> <img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/c3280cd1e77e7ec163297311e38d28a2bcbc33c1" class="mwe-math-fallback-image-display mw-invert skin-invert" aria-hidden="true" style="vertical-align: -2.505ex; width:33.486ex; height:6.176ex;" alt="{\displaystyle n!=e^{y}{\sqrt {n}}\left({\frac {n}{e}}\right)^{n}\left(1+O\left({\frac {1}{n}}\right)\right).}"> </noscript><span class="lazy-image-placeholder" style="width: 33.486ex;height: 6.176ex;vertical-align: -2.505ex;" data-src="https://wikimedia.org/api/rest_v1/media/math/render/svg/c3280cd1e77e7ec163297311e38d28a2bcbc33c1" data-alt="{\displaystyle n!=e^{y}{\sqrt {n}}\left({\frac {n}{e}}\right)^{n}\left(1+O\left({\frac {1}{n}}\right)\right).}" data-class="mwe-math-fallback-image-display mw-invert skin-invert"> </span></span></p> <p>The quantity <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"> <math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle e^{y}}"><semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <msup> <mi> e </mi> <mrow class="MJX-TeXAtom-ORD"> <mi> y </mi> </mrow> </msup> </mstyle> </mrow> <annotation encoding="application/x-tex"> {\displaystyle e^{y}} </annotation> </semantics> </math></span> <noscript> <img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/7ff26085237c8dc6802eba0882a8aea22e890183" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:2.133ex; height:2.343ex;" alt="{\displaystyle e^{y}}"> </noscript><span class="lazy-image-placeholder" style="width: 2.133ex;height: 2.343ex;vertical-align: -0.338ex;" data-src="https://wikimedia.org/api/rest_v1/media/math/render/svg/7ff26085237c8dc6802eba0882a8aea22e890183" data-alt="{\displaystyle e^{y}}" data-class="mwe-math-fallback-image-inline mw-invert skin-invert"> </span></span> can be found by taking the limit on both sides as <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"> <math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle n}"><semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi> n </mi> </mstyle> </mrow> <annotation encoding="application/x-tex"> {\displaystyle n} </annotation> </semantics> </math></span> <noscript> <img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/a601995d55609f2d9f5e233e36fbe9ea26011b3b" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:1.395ex; height:1.676ex;" alt="{\displaystyle n}"> </noscript><span class="lazy-image-placeholder" style="width: 1.395ex;height: 1.676ex;vertical-align: -0.338ex;" data-src="https://wikimedia.org/api/rest_v1/media/math/render/svg/a601995d55609f2d9f5e233e36fbe9ea26011b3b" data-alt="{\displaystyle n}" data-class="mwe-math-fallback-image-inline mw-invert skin-invert"> </span></span> tends to infinity and using <a href="https://en-m-wikipedia-org.translate.goog/wiki/Wallis_product?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-GB" title="Wallis product">Wallis' product</a>, which shows that <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"> <math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle e^{y}={\sqrt {2\pi }}}"><semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <msup> <mi> e </mi> <mrow class="MJX-TeXAtom-ORD"> <mi> y </mi> </mrow> </msup> <mo> = </mo> <mrow class="MJX-TeXAtom-ORD"> <msqrt> <mn> 2 </mn> <mi> π<!-- π --> </mi> </msqrt> </mrow> </mstyle> </mrow> <annotation encoding="application/x-tex"> {\displaystyle e^{y}={\sqrt {2\pi }}} </annotation> </semantics> </math></span> <noscript> <img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/aa0fcfb78cc1c5ec93e19890d73eb3631fbfb6aa" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.671ex; width:9.662ex; height:3.009ex;" alt="{\displaystyle e^{y}={\sqrt {2\pi }}}"> </noscript><span class="lazy-image-placeholder" style="width: 9.662ex;height: 3.009ex;vertical-align: -0.671ex;" data-src="https://wikimedia.org/api/rest_v1/media/math/render/svg/aa0fcfb78cc1c5ec93e19890d73eb3631fbfb6aa" data-alt="{\displaystyle e^{y}={\sqrt {2\pi }}}" data-class="mwe-math-fallback-image-inline mw-invert skin-invert"> </span></span>. Therefore, one obtains Stirling's formula: <span class="mwe-math-element"><span class="mwe-math-mathml-display mwe-math-mathml-a11y" style="display: none;"> <math display="block" xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle n!={\sqrt {2\pi n}}\left({\frac {n}{e}}\right)^{n}\left(1+O\left({\frac {1}{n}}\right)\right).}"><semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi> n </mi> <mo> ! </mo> <mo> = </mo> <mrow class="MJX-TeXAtom-ORD"> <msqrt> <mn> 2 </mn> <mi> π<!-- π --> </mi> <mi> n </mi> </msqrt> </mrow> <msup> <mrow> <mo> ( </mo> <mrow class="MJX-TeXAtom-ORD"> <mfrac> <mi> n </mi> <mi> e </mi> </mfrac> </mrow> <mo> ) </mo> </mrow> <mrow class="MJX-TeXAtom-ORD"> <mi> n </mi> </mrow> </msup> <mrow> <mo> ( </mo> <mrow> <mn> 1 </mn> <mo> + </mo> <mi> O </mi> <mrow> <mo> ( </mo> <mrow class="MJX-TeXAtom-ORD"> <mfrac> <mn> 1 </mn> <mi> n </mi> </mfrac> </mrow> <mo> ) </mo> </mrow> </mrow> <mo> ) </mo> </mrow> <mo> . </mo> </mstyle> </mrow> <annotation encoding="application/x-tex"> {\displaystyle n!={\sqrt {2\pi n}}\left({\frac {n}{e}}\right)^{n}\left(1+O\left({\frac {1}{n}}\right)\right).} </annotation> </semantics> </math></span> <noscript> <img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/09ac088bf420d3ad4257f7593a0c1af48b0cf22c" class="mwe-math-fallback-image-display mw-invert skin-invert" aria-hidden="true" style="vertical-align: -2.505ex; width:33.847ex; height:6.176ex;" alt="{\displaystyle n!={\sqrt {2\pi n}}\left({\frac {n}{e}}\right)^{n}\left(1+O\left({\frac {1}{n}}\right)\right).}"> </noscript><span class="lazy-image-placeholder" style="width: 33.847ex;height: 6.176ex;vertical-align: -2.505ex;" data-src="https://wikimedia.org/api/rest_v1/media/math/render/svg/09ac088bf420d3ad4257f7593a0c1af48b0cf22c" data-alt="{\displaystyle n!={\sqrt {2\pi n}}\left({\frac {n}{e}}\right)^{n}\left(1+O\left({\frac {1}{n}}\right)\right).}" data-class="mwe-math-fallback-image-display mw-invert skin-invert"> </span></span></p> </section> <div class="mw-heading mw-heading2 section-heading" onclick="mfTempOpenSection(2)"> <span class="indicator mf-icon mf-icon-expand mf-icon--small"></span> <h2 id="Alternative_derivations">Alternative derivations</h2><span class="mw-editsection"> <a role="button" href="https://en-m-wikipedia-org.translate.goog/w/index.php?title=Stirling's_approximation&action=edit&section=2&_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-GB" title="Edit section: Alternative derivations" class="cdx-button cdx-button--size-large cdx-button--fake-button cdx-button--fake-button--enabled cdx-button--icon-only cdx-button--weight-quiet "> <span class="minerva-icon minerva-icon--edit"></span> <span>edit</span> </a> </span> </div> <section class="mf-section-2 collapsible-block" id="mf-section-2"> <p>An alternative formula for <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"> <math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle n!}"><semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi> n </mi> <mo> ! </mo> </mstyle> </mrow> <annotation encoding="application/x-tex"> {\displaystyle n!} </annotation> </semantics> </math></span> <noscript> <img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/bae971720be3cc9b8d82f4cdac89cb89877514a6" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:2.042ex; height:2.176ex;" alt="{\displaystyle n!}"> </noscript><span class="lazy-image-placeholder" style="width: 2.042ex;height: 2.176ex;vertical-align: -0.338ex;" data-src="https://wikimedia.org/api/rest_v1/media/math/render/svg/bae971720be3cc9b8d82f4cdac89cb89877514a6" data-alt="{\displaystyle n!}" data-class="mwe-math-fallback-image-inline mw-invert skin-invert"> </span></span> using the <a href="https://en-m-wikipedia-org.translate.goog/wiki/Gamma_function?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-GB" title="Gamma function">gamma function</a> is <span class="mwe-math-element"><span class="mwe-math-mathml-display mwe-math-mathml-a11y" style="display: none;"> <math display="block" xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle n!=\int _{0}^{\infty }x^{n}e^{-x}\,{\rm {d}}x.}"><semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi> n </mi> <mo> ! </mo> <mo> = </mo> <msubsup> <mo> ∫<!-- ∫ --> </mo> <mrow class="MJX-TeXAtom-ORD"> <mn> 0 </mn> </mrow> <mrow class="MJX-TeXAtom-ORD"> <mi mathvariant="normal"> ∞<!-- ∞ --> </mi> </mrow> </msubsup> <msup> <mi> x </mi> <mrow class="MJX-TeXAtom-ORD"> <mi> n </mi> </mrow> </msup> <msup> <mi> e </mi> <mrow class="MJX-TeXAtom-ORD"> <mo> −<!-- − --> </mo> <mi> x </mi> </mrow> </msup> <mspace width="thinmathspace"></mspace> <mrow class="MJX-TeXAtom-ORD"> <mrow class="MJX-TeXAtom-ORD"> <mi mathvariant="normal"> d </mi> </mrow> </mrow> <mi> x </mi> <mo> . </mo> </mstyle> </mrow> <annotation encoding="application/x-tex"> {\displaystyle n!=\int _{0}^{\infty }x^{n}e^{-x}\,{\rm {d}}x.} </annotation> </semantics> </math></span> <noscript> <img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/ec3d16f1466e7bef37e4674bce9f3ca8baa5a43b" class="mwe-math-fallback-image-display mw-invert skin-invert" aria-hidden="true" style="vertical-align: -2.338ex; width:19.605ex; height:5.843ex;" alt="{\displaystyle n!=\int _{0}^{\infty }x^{n}e^{-x}\,{\rm {d}}x.}"> </noscript><span class="lazy-image-placeholder" style="width: 19.605ex;height: 5.843ex;vertical-align: -2.338ex;" data-src="https://wikimedia.org/api/rest_v1/media/math/render/svg/ec3d16f1466e7bef37e4674bce9f3ca8baa5a43b" data-alt="{\displaystyle n!=\int _{0}^{\infty }x^{n}e^{-x}\,{\rm {d}}x.}" data-class="mwe-math-fallback-image-display mw-invert skin-invert"> </span></span> (as can be seen by repeated integration by parts). Rewriting and changing variables <span class="texhtml"><i>x</i> = <i>ny</i></span>, one obtains <span class="mwe-math-element"><span class="mwe-math-mathml-display mwe-math-mathml-a11y" style="display: none;"> <math display="block" xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle n!=\int _{0}^{\infty }e^{n\ln x-x}\,{\rm {d}}x=e^{n\ln n}n\int _{0}^{\infty }e^{n(\ln y-y)}\,{\rm {d}}y.}"><semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi> n </mi> <mo> ! </mo> <mo> = </mo> <msubsup> <mo> ∫<!-- ∫ --> </mo> <mrow class="MJX-TeXAtom-ORD"> <mn> 0 </mn> </mrow> <mrow class="MJX-TeXAtom-ORD"> <mi mathvariant="normal"> ∞<!-- ∞ --> </mi> </mrow> </msubsup> <msup> <mi> e </mi> <mrow class="MJX-TeXAtom-ORD"> <mi> n </mi> <mi> ln </mi> <mo> <!-- --> </mo> <mi> x </mi> <mo> −<!-- − --> </mo> <mi> x </mi> </mrow> </msup> <mspace width="thinmathspace"></mspace> <mrow class="MJX-TeXAtom-ORD"> <mrow class="MJX-TeXAtom-ORD"> <mi mathvariant="normal"> d </mi> </mrow> </mrow> <mi> x </mi> <mo> = </mo> <msup> <mi> e </mi> <mrow class="MJX-TeXAtom-ORD"> <mi> n </mi> <mi> ln </mi> <mo> <!-- --> </mo> <mi> n </mi> </mrow> </msup> <mi> n </mi> <msubsup> <mo> ∫<!-- ∫ --> </mo> <mrow class="MJX-TeXAtom-ORD"> <mn> 0 </mn> </mrow> <mrow class="MJX-TeXAtom-ORD"> <mi mathvariant="normal"> ∞<!-- ∞ --> </mi> </mrow> </msubsup> <msup> <mi> e </mi> <mrow class="MJX-TeXAtom-ORD"> <mi> n </mi> <mo stretchy="false"> ( </mo> <mi> ln </mi> <mo> <!-- --> </mo> <mi> y </mi> <mo> −<!-- − --> </mo> <mi> y </mi> <mo stretchy="false"> ) </mo> </mrow> </msup> <mspace width="thinmathspace"></mspace> <mrow class="MJX-TeXAtom-ORD"> <mrow class="MJX-TeXAtom-ORD"> <mi mathvariant="normal"> d </mi> </mrow> </mrow> <mi> y </mi> <mo> . </mo> </mstyle> </mrow> <annotation encoding="application/x-tex"> {\displaystyle n!=\int _{0}^{\infty }e^{n\ln x-x}\,{\rm {d}}x=e^{n\ln n}n\int _{0}^{\infty }e^{n(\ln y-y)}\,{\rm {d}}y.} </annotation> </semantics> </math></span> <noscript> <img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/b5c1d168cbbe92d515939df7b8703b02bac5aa0f" class="mwe-math-fallback-image-display mw-invert skin-invert" aria-hidden="true" style="vertical-align: -2.338ex; width:47.257ex; height:5.843ex;" alt="{\displaystyle n!=\int _{0}^{\infty }e^{n\ln x-x}\,{\rm {d}}x=e^{n\ln n}n\int _{0}^{\infty }e^{n(\ln y-y)}\,{\rm {d}}y.}"> </noscript><span class="lazy-image-placeholder" style="width: 47.257ex;height: 5.843ex;vertical-align: -2.338ex;" data-src="https://wikimedia.org/api/rest_v1/media/math/render/svg/b5c1d168cbbe92d515939df7b8703b02bac5aa0f" data-alt="{\displaystyle n!=\int _{0}^{\infty }e^{n\ln x-x}\,{\rm {d}}x=e^{n\ln n}n\int _{0}^{\infty }e^{n(\ln y-y)}\,{\rm {d}}y.}" data-class="mwe-math-fallback-image-display mw-invert skin-invert"> </span></span> Applying <a href="https://en-m-wikipedia-org.translate.goog/wiki/Laplace%27s_method?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-GB" title="Laplace's method">Laplace's method</a> one has <span class="mwe-math-element"><span class="mwe-math-mathml-display mwe-math-mathml-a11y" style="display: none;"> <math display="block" xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \int _{0}^{\infty }e^{n(\ln y-y)}\,{\rm {d}}y\sim {\sqrt {\frac {2\pi }{n}}}e^{-n},}"><semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <msubsup> <mo> ∫<!-- ∫ --> </mo> <mrow class="MJX-TeXAtom-ORD"> <mn> 0 </mn> </mrow> <mrow class="MJX-TeXAtom-ORD"> <mi mathvariant="normal"> ∞<!-- ∞ --> </mi> </mrow> </msubsup> <msup> <mi> e </mi> <mrow class="MJX-TeXAtom-ORD"> <mi> n </mi> <mo stretchy="false"> ( </mo> <mi> ln </mi> <mo> <!-- --> </mo> <mi> y </mi> <mo> −<!-- − --> </mo> <mi> y </mi> <mo stretchy="false"> ) </mo> </mrow> </msup> <mspace width="thinmathspace"></mspace> <mrow class="MJX-TeXAtom-ORD"> <mrow class="MJX-TeXAtom-ORD"> <mi mathvariant="normal"> d </mi> </mrow> </mrow> <mi> y </mi> <mo> ∼<!-- ∼ --> </mo> <mrow class="MJX-TeXAtom-ORD"> <msqrt> <mfrac> <mrow> <mn> 2 </mn> <mi> π<!-- π --> </mi> </mrow> <mi> n </mi> </mfrac> </msqrt> </mrow> <msup> <mi> e </mi> <mrow class="MJX-TeXAtom-ORD"> <mo> −<!-- − --> </mo> <mi> n </mi> </mrow> </msup> <mo> , </mo> </mstyle> </mrow> <annotation encoding="application/x-tex"> {\displaystyle \int _{0}^{\infty }e^{n(\ln y-y)}\,{\rm {d}}y\sim {\sqrt {\frac {2\pi }{n}}}e^{-n},} </annotation> </semantics> </math></span> <noscript> <img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/1cb2e06231b3f5f3502bb001fface31c74836498" class="mwe-math-fallback-image-display mw-invert skin-invert" aria-hidden="true" style="vertical-align: -2.338ex; width:28.794ex; height:6.176ex;" alt="{\displaystyle \int _{0}^{\infty }e^{n(\ln y-y)}\,{\rm {d}}y\sim {\sqrt {\frac {2\pi }{n}}}e^{-n},}"> </noscript><span class="lazy-image-placeholder" style="width: 28.794ex;height: 6.176ex;vertical-align: -2.338ex;" data-src="https://wikimedia.org/api/rest_v1/media/math/render/svg/1cb2e06231b3f5f3502bb001fface31c74836498" data-alt="{\displaystyle \int _{0}^{\infty }e^{n(\ln y-y)}\,{\rm {d}}y\sim {\sqrt {\frac {2\pi }{n}}}e^{-n},}" data-class="mwe-math-fallback-image-display mw-invert skin-invert"> </span></span> which recovers Stirling's formula: <span class="mwe-math-element"><span class="mwe-math-mathml-display mwe-math-mathml-a11y" style="display: none;"> <math display="block" xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle n!\sim e^{n\ln n}n{\sqrt {\frac {2\pi }{n}}}e^{-n}={\sqrt {2\pi n}}\left({\frac {n}{e}}\right)^{n}.}"><semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi> n </mi> <mo> ! </mo> <mo> ∼<!-- ∼ --> </mo> <msup> <mi> e </mi> <mrow class="MJX-TeXAtom-ORD"> <mi> n </mi> <mi> ln </mi> <mo> <!-- --> </mo> <mi> n </mi> </mrow> </msup> <mi> n </mi> <mrow class="MJX-TeXAtom-ORD"> <msqrt> <mfrac> <mrow> <mn> 2 </mn> <mi> π<!-- π --> </mi> </mrow> <mi> n </mi> </mfrac> </msqrt> </mrow> <msup> <mi> e </mi> <mrow class="MJX-TeXAtom-ORD"> <mo> −<!-- − --> </mo> <mi> n </mi> </mrow> </msup> <mo> = </mo> <mrow class="MJX-TeXAtom-ORD"> <msqrt> <mn> 2 </mn> <mi> π<!-- π --> </mi> <mi> n </mi> </msqrt> </mrow> <msup> <mrow> <mo> ( </mo> <mrow class="MJX-TeXAtom-ORD"> <mfrac> <mi> n </mi> <mi> e </mi> </mfrac> </mrow> <mo> ) </mo> </mrow> <mrow class="MJX-TeXAtom-ORD"> <mi> n </mi> </mrow> </msup> <mo> . </mo> </mstyle> </mrow> <annotation encoding="application/x-tex"> {\displaystyle n!\sim e^{n\ln n}n{\sqrt {\frac {2\pi }{n}}}e^{-n}={\sqrt {2\pi n}}\left({\frac {n}{e}}\right)^{n}.} </annotation> </semantics> </math></span> <noscript> <img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/b91b7ad167af44b3b4bb07390fce77ba1ba23879" class="mwe-math-fallback-image-display mw-invert skin-invert" aria-hidden="true" style="vertical-align: -2.338ex; width:36.998ex; height:6.176ex;" alt="{\displaystyle n!\sim e^{n\ln n}n{\sqrt {\frac {2\pi }{n}}}e^{-n}={\sqrt {2\pi n}}\left({\frac {n}{e}}\right)^{n}.}"> </noscript><span class="lazy-image-placeholder" style="width: 36.998ex;height: 6.176ex;vertical-align: -2.338ex;" data-src="https://wikimedia.org/api/rest_v1/media/math/render/svg/b91b7ad167af44b3b4bb07390fce77ba1ba23879" data-alt="{\displaystyle n!\sim e^{n\ln n}n{\sqrt {\frac {2\pi }{n}}}e^{-n}={\sqrt {2\pi n}}\left({\frac {n}{e}}\right)^{n}.}" data-class="mwe-math-fallback-image-display mw-invert skin-invert"> </span></span></p> <div class="mw-heading mw-heading3"> <h3 id="Higher_orders">Higher orders</h3><span class="mw-editsection"> <a role="button" href="https://en-m-wikipedia-org.translate.goog/w/index.php?title=Stirling's_approximation&action=edit&section=3&_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-GB" title="Edit section: Higher orders" class="cdx-button cdx-button--size-large cdx-button--fake-button cdx-button--fake-button--enabled cdx-button--icon-only cdx-button--weight-quiet "> <span class="minerva-icon minerva-icon--edit"></span> <span>edit</span> </a> </span> </div> <p>In fact, further corrections can also be obtained using Laplace's method. From previous result, we know that <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"> <math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \Gamma (x)\sim x^{x}e^{-x}}"><semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi mathvariant="normal"> Γ<!-- Γ --> </mi> <mo stretchy="false"> ( </mo> <mi> x </mi> <mo stretchy="false"> ) </mo> <mo> ∼<!-- ∼ --> </mo> <msup> <mi> x </mi> <mrow class="MJX-TeXAtom-ORD"> <mi> x </mi> </mrow> </msup> <msup> <mi> e </mi> <mrow class="MJX-TeXAtom-ORD"> <mo> −<!-- − --> </mo> <mi> x </mi> </mrow> </msup> </mstyle> </mrow> <annotation encoding="application/x-tex"> {\displaystyle \Gamma (x)\sim x^{x}e^{-x}} </annotation> </semantics> </math></span> <noscript> <img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/65cbf7864fae628b3dbee15f718cedf1167b6b03" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:13.727ex; height:3.009ex;" alt="{\displaystyle \Gamma (x)\sim x^{x}e^{-x}}"> </noscript><span class="lazy-image-placeholder" style="width: 13.727ex;height: 3.009ex;vertical-align: -0.838ex;" data-src="https://wikimedia.org/api/rest_v1/media/math/render/svg/65cbf7864fae628b3dbee15f718cedf1167b6b03" data-alt="{\displaystyle \Gamma (x)\sim x^{x}e^{-x}}" data-class="mwe-math-fallback-image-inline mw-invert skin-invert"> </span></span>, so we "peel off" this dominant term, then perform two changes of variables, to obtain:<span class="mwe-math-element"><span class="mwe-math-mathml-display mwe-math-mathml-a11y" style="display: none;"> <math display="block" xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle x^{-x}e^{x}\Gamma (x)=\int _{\mathbb {R} }e^{x(1+t-e^{t})}dt}"><semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <msup> <mi> x </mi> <mrow class="MJX-TeXAtom-ORD"> <mo> −<!-- − --> </mo> <mi> x </mi> </mrow> </msup> <msup> <mi> e </mi> <mrow class="MJX-TeXAtom-ORD"> <mi> x </mi> </mrow> </msup> <mi mathvariant="normal"> Γ<!-- Γ --> </mi> <mo stretchy="false"> ( </mo> <mi> x </mi> <mo stretchy="false"> ) </mo> <mo> = </mo> <msub> <mo> ∫<!-- ∫ --> </mo> <mrow class="MJX-TeXAtom-ORD"> <mrow class="MJX-TeXAtom-ORD"> <mi mathvariant="double-struck"> R </mi> </mrow> </mrow> </msub> <msup> <mi> e </mi> <mrow class="MJX-TeXAtom-ORD"> <mi> x </mi> <mo stretchy="false"> ( </mo> <mn> 1 </mn> <mo> + </mo> <mi> t </mi> <mo> −<!-- − --> </mo> <msup> <mi> e </mi> <mrow class="MJX-TeXAtom-ORD"> <mi> t </mi> </mrow> </msup> <mo stretchy="false"> ) </mo> </mrow> </msup> <mi> d </mi> <mi> t </mi> </mstyle> </mrow> <annotation encoding="application/x-tex"> {\displaystyle x^{-x}e^{x}\Gamma (x)=\int _{\mathbb {R} }e^{x(1+t-e^{t})}dt} </annotation> </semantics> </math></span> <noscript> <img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/16c287e185c84a185918e750559381cf0a02e94f" class="mwe-math-fallback-image-display mw-invert skin-invert" aria-hidden="true" style="vertical-align: -2.338ex; width:27.801ex; height:5.676ex;" alt="{\displaystyle x^{-x}e^{x}\Gamma (x)=\int _{\mathbb {R} }e^{x(1+t-e^{t})}dt}"> </noscript><span class="lazy-image-placeholder" style="width: 27.801ex;height: 5.676ex;vertical-align: -2.338ex;" data-src="https://wikimedia.org/api/rest_v1/media/math/render/svg/16c287e185c84a185918e750559381cf0a02e94f" data-alt="{\displaystyle x^{-x}e^{x}\Gamma (x)=\int _{\mathbb {R} }e^{x(1+t-e^{t})}dt}" data-class="mwe-math-fallback-image-display mw-invert skin-invert"> </span></span>To verify this: <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"> <math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \int _{\mathbb {R} }e^{x(1+t-e^{t})}dt{\overset {t\mapsto \ln t}{=}}e^{x}\int _{0}^{\infty }t^{x-1}e^{-xt}dt{\overset {t\mapsto t/x}{=}}x^{-x}e^{x}\int _{0}^{\infty }e^{-t}t^{x-1}dt=x^{-x}e^{x}\Gamma (x)}"><semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <msub> <mo> ∫<!-- ∫ --> </mo> <mrow class="MJX-TeXAtom-ORD"> <mrow class="MJX-TeXAtom-ORD"> <mi mathvariant="double-struck"> R </mi> </mrow> </mrow> </msub> <msup> <mi> e </mi> <mrow class="MJX-TeXAtom-ORD"> <mi> x </mi> <mo stretchy="false"> ( </mo> <mn> 1 </mn> <mo> + </mo> <mi> t </mi> <mo> −<!-- − --> </mo> <msup> <mi> e </mi> <mrow class="MJX-TeXAtom-ORD"> <mi> t </mi> </mrow> </msup> <mo stretchy="false"> ) </mo> </mrow> </msup> <mi> d </mi> <mi> t </mi> <mrow class="MJX-TeXAtom-ORD"> <mover> <mo> = </mo> <mrow> <mi> t </mi> <mo stretchy="false"> ↦<!-- ↦ --> </mo> <mi> ln </mi> <mo> <!-- --> </mo> <mi> t </mi> </mrow> </mover> </mrow> <msup> <mi> e </mi> <mrow class="MJX-TeXAtom-ORD"> <mi> x </mi> </mrow> </msup> <msubsup> <mo> ∫<!-- ∫ --> </mo> <mrow class="MJX-TeXAtom-ORD"> <mn> 0 </mn> </mrow> <mrow class="MJX-TeXAtom-ORD"> <mi mathvariant="normal"> ∞<!-- ∞ --> </mi> </mrow> </msubsup> <msup> <mi> t </mi> <mrow class="MJX-TeXAtom-ORD"> <mi> x </mi> <mo> −<!-- − --> </mo> <mn> 1 </mn> </mrow> </msup> <msup> <mi> e </mi> <mrow class="MJX-TeXAtom-ORD"> <mo> −<!-- − --> </mo> <mi> x </mi> <mi> t </mi> </mrow> </msup> <mi> d </mi> <mi> t </mi> <mrow class="MJX-TeXAtom-ORD"> <mover> <mo> = </mo> <mrow> <mi> t </mi> <mo stretchy="false"> ↦<!-- ↦ --> </mo> <mi> t </mi> <mrow class="MJX-TeXAtom-ORD"> <mo> / </mo> </mrow> <mi> x </mi> </mrow> </mover> </mrow> <msup> <mi> x </mi> <mrow class="MJX-TeXAtom-ORD"> <mo> −<!-- − --> </mo> <mi> x </mi> </mrow> </msup> <msup> <mi> e </mi> <mrow class="MJX-TeXAtom-ORD"> <mi> x </mi> </mrow> </msup> <msubsup> <mo> ∫<!-- ∫ --> </mo> <mrow class="MJX-TeXAtom-ORD"> <mn> 0 </mn> </mrow> <mrow class="MJX-TeXAtom-ORD"> <mi mathvariant="normal"> ∞<!-- ∞ --> </mi> </mrow> </msubsup> <msup> <mi> e </mi> <mrow class="MJX-TeXAtom-ORD"> <mo> −<!-- − --> </mo> <mi> t </mi> </mrow> </msup> <msup> <mi> t </mi> <mrow class="MJX-TeXAtom-ORD"> <mi> x </mi> <mo> −<!-- − --> </mo> <mn> 1 </mn> </mrow> </msup> <mi> d </mi> <mi> t </mi> <mo> = </mo> <msup> <mi> x </mi> <mrow class="MJX-TeXAtom-ORD"> <mo> −<!-- − --> </mo> <mi> x </mi> </mrow> </msup> <msup> <mi> e </mi> <mrow class="MJX-TeXAtom-ORD"> <mi> x </mi> </mrow> </msup> <mi mathvariant="normal"> Γ<!-- Γ --> </mi> <mo stretchy="false"> ( </mo> <mi> x </mi> <mo stretchy="false"> ) </mo> </mstyle> </mrow> <annotation encoding="application/x-tex"> {\displaystyle \int _{\mathbb {R} }e^{x(1+t-e^{t})}dt{\overset {t\mapsto \ln t}{=}}e^{x}\int _{0}^{\infty }t^{x-1}e^{-xt}dt{\overset {t\mapsto t/x}{=}}x^{-x}e^{x}\int _{0}^{\infty }e^{-t}t^{x-1}dt=x^{-x}e^{x}\Gamma (x)} </annotation> </semantics> </math></span> <noscript> <img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/232a803997500953b97e1a5a9f6836039210d192" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -2.338ex; width:75.156ex; height:5.843ex;" alt="{\displaystyle \int _{\mathbb {R} }e^{x(1+t-e^{t})}dt{\overset {t\mapsto \ln t}{=}}e^{x}\int _{0}^{\infty }t^{x-1}e^{-xt}dt{\overset {t\mapsto t/x}{=}}x^{-x}e^{x}\int _{0}^{\infty }e^{-t}t^{x-1}dt=x^{-x}e^{x}\Gamma (x)}"> </noscript><span class="lazy-image-placeholder" style="width: 75.156ex;height: 5.843ex;vertical-align: -2.338ex;" data-src="https://wikimedia.org/api/rest_v1/media/math/render/svg/232a803997500953b97e1a5a9f6836039210d192" data-alt="{\displaystyle \int _{\mathbb {R} }e^{x(1+t-e^{t})}dt{\overset {t\mapsto \ln t}{=}}e^{x}\int _{0}^{\infty }t^{x-1}e^{-xt}dt{\overset {t\mapsto t/x}{=}}x^{-x}e^{x}\int _{0}^{\infty }e^{-t}t^{x-1}dt=x^{-x}e^{x}\Gamma (x)}" data-class="mwe-math-fallback-image-inline mw-invert skin-invert"> </span></span>.</p> <p>Now the function <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"> <math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle t\mapsto 1+t-e^{t}}"><semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi> t </mi> <mo stretchy="false"> ↦<!-- ↦ --> </mo> <mn> 1 </mn> <mo> + </mo> <mi> t </mi> <mo> −<!-- − --> </mo> <msup> <mi> e </mi> <mrow class="MJX-TeXAtom-ORD"> <mi> t </mi> </mrow> </msup> </mstyle> </mrow> <annotation encoding="application/x-tex"> {\displaystyle t\mapsto 1+t-e^{t}} </annotation> </semantics> </math></span> <noscript> <img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/df85098ac94220d1b2f6f7f33d40c86ca1b969bb" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.505ex; width:14.046ex; height:2.676ex;" alt="{\displaystyle t\mapsto 1+t-e^{t}}"> </noscript><span class="lazy-image-placeholder" style="width: 14.046ex;height: 2.676ex;vertical-align: -0.505ex;" data-src="https://wikimedia.org/api/rest_v1/media/math/render/svg/df85098ac94220d1b2f6f7f33d40c86ca1b969bb" data-alt="{\displaystyle t\mapsto 1+t-e^{t}}" data-class="mwe-math-fallback-image-inline mw-invert skin-invert"> </span></span> is unimodal, with maximum value zero. Locally around zero, it looks like <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"> <math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle -t^{2}/2}"><semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mo> −<!-- − --> </mo> <msup> <mi> t </mi> <mrow class="MJX-TeXAtom-ORD"> <mn> 2 </mn> </mrow> </msup> <mrow class="MJX-TeXAtom-ORD"> <mo> / </mo> </mrow> <mn> 2 </mn> </mstyle> </mrow> <annotation encoding="application/x-tex"> {\displaystyle -t^{2}/2} </annotation> </semantics> </math></span> <noscript> <img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/87a40dd6615f474e0416abe2054ab61156437375" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:6.027ex; height:3.176ex;" alt="{\displaystyle -t^{2}/2}"> </noscript><span class="lazy-image-placeholder" style="width: 6.027ex;height: 3.176ex;vertical-align: -0.838ex;" data-src="https://wikimedia.org/api/rest_v1/media/math/render/svg/87a40dd6615f474e0416abe2054ab61156437375" data-alt="{\displaystyle -t^{2}/2}" data-class="mwe-math-fallback-image-inline mw-invert skin-invert"> </span></span>, which is why we are able to perform Laplace's method. In order to extend Laplace's method to higher orders, we perform another change of variables by <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"> <math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle 1+t-e^{t}=-\tau ^{2}/2}"><semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mn> 1 </mn> <mo> + </mo> <mi> t </mi> <mo> −<!-- − --> </mo> <msup> <mi> e </mi> <mrow class="MJX-TeXAtom-ORD"> <mi> t </mi> </mrow> </msup> <mo> = </mo> <mo> −<!-- − --> </mo> <msup> <mi> τ<!-- τ --> </mi> <mrow class="MJX-TeXAtom-ORD"> <mn> 2 </mn> </mrow> </msup> <mrow class="MJX-TeXAtom-ORD"> <mo> / </mo> </mrow> <mn> 2 </mn> </mstyle> </mrow> <annotation encoding="application/x-tex"> {\displaystyle 1+t-e^{t}=-\tau ^{2}/2} </annotation> </semantics> </math></span> <noscript> <img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/fdc08f8f909f9fa9fb1c11a37fe2532327ffedf9" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:19.136ex; height:3.176ex;" alt="{\displaystyle 1+t-e^{t}=-\tau ^{2}/2}"> </noscript><span class="lazy-image-placeholder" style="width: 19.136ex;height: 3.176ex;vertical-align: -0.838ex;" data-src="https://wikimedia.org/api/rest_v1/media/math/render/svg/fdc08f8f909f9fa9fb1c11a37fe2532327ffedf9" data-alt="{\displaystyle 1+t-e^{t}=-\tau ^{2}/2}" data-class="mwe-math-fallback-image-inline mw-invert skin-invert"> </span></span>. This equation cannot be solved in closed form, but it can be solved by serial expansion, which gives us <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"> <math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle t=\tau -\tau ^{2}/6+\tau ^{3}/36+a_{4}\tau ^{4}+O(\tau ^{5})}"><semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi> t </mi> <mo> = </mo> <mi> τ<!-- τ --> </mi> <mo> −<!-- − --> </mo> <msup> <mi> τ<!-- τ --> </mi> <mrow class="MJX-TeXAtom-ORD"> <mn> 2 </mn> </mrow> </msup> <mrow class="MJX-TeXAtom-ORD"> <mo> / </mo> </mrow> <mn> 6 </mn> <mo> + </mo> <msup> <mi> τ<!-- τ --> </mi> <mrow class="MJX-TeXAtom-ORD"> <mn> 3 </mn> </mrow> </msup> <mrow class="MJX-TeXAtom-ORD"> <mo> / </mo> </mrow> <mn> 36 </mn> <mo> + </mo> <msub> <mi> a </mi> <mrow class="MJX-TeXAtom-ORD"> <mn> 4 </mn> </mrow> </msub> <msup> <mi> τ<!-- τ --> </mi> <mrow class="MJX-TeXAtom-ORD"> <mn> 4 </mn> </mrow> </msup> <mo> + </mo> <mi> O </mi> <mo stretchy="false"> ( </mo> <msup> <mi> τ<!-- τ --> </mi> <mrow class="MJX-TeXAtom-ORD"> <mn> 5 </mn> </mrow> </msup> <mo stretchy="false"> ) </mo> </mstyle> </mrow> <annotation encoding="application/x-tex"> {\displaystyle t=\tau -\tau ^{2}/6+\tau ^{3}/36+a_{4}\tau ^{4}+O(\tau ^{5})} </annotation> </semantics> </math></span> <noscript> <img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/f0309cb95f6a07fb980fc574633583ad027ea72e" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:37.429ex; height:3.176ex;" alt="{\displaystyle t=\tau -\tau ^{2}/6+\tau ^{3}/36+a_{4}\tau ^{4}+O(\tau ^{5})}"> </noscript><span class="lazy-image-placeholder" style="width: 37.429ex;height: 3.176ex;vertical-align: -0.838ex;" data-src="https://wikimedia.org/api/rest_v1/media/math/render/svg/f0309cb95f6a07fb980fc574633583ad027ea72e" data-alt="{\displaystyle t=\tau -\tau ^{2}/6+\tau ^{3}/36+a_{4}\tau ^{4}+O(\tau ^{5})}" data-class="mwe-math-fallback-image-inline mw-invert skin-invert"> </span></span>. Now plug back to the equation to obtain<span class="mwe-math-element"><span class="mwe-math-mathml-display mwe-math-mathml-a11y" style="display: none;"> <math display="block" xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle x^{-x}e^{x}\Gamma (x)=\int _{\mathbb {R} }e^{-x\tau ^{2}/2}(1-\tau /3+\tau ^{2}/12+4a_{4}\tau ^{3}+O(\tau ^{4}))d\tau ={\sqrt {2\pi }}(x^{-1/2}+x^{-3/2}/12)+O(x^{-5/2})}"><semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <msup> <mi> x </mi> <mrow class="MJX-TeXAtom-ORD"> <mo> −<!-- − --> </mo> <mi> x </mi> </mrow> </msup> <msup> <mi> e </mi> <mrow class="MJX-TeXAtom-ORD"> <mi> x </mi> </mrow> </msup> <mi mathvariant="normal"> Γ<!-- Γ --> </mi> <mo stretchy="false"> ( </mo> <mi> x </mi> <mo stretchy="false"> ) </mo> <mo> = </mo> <msub> <mo> ∫<!-- ∫ --> </mo> <mrow class="MJX-TeXAtom-ORD"> <mrow class="MJX-TeXAtom-ORD"> <mi mathvariant="double-struck"> R </mi> </mrow> </mrow> </msub> <msup> <mi> e </mi> <mrow class="MJX-TeXAtom-ORD"> <mo> −<!-- − --> </mo> <mi> x </mi> <msup> <mi> τ<!-- τ --> </mi> <mrow class="MJX-TeXAtom-ORD"> <mn> 2 </mn> </mrow> </msup> <mrow class="MJX-TeXAtom-ORD"> <mo> / </mo> </mrow> <mn> 2 </mn> </mrow> </msup> <mo stretchy="false"> ( </mo> <mn> 1 </mn> <mo> −<!-- − --> </mo> <mi> τ<!-- τ --> </mi> <mrow class="MJX-TeXAtom-ORD"> <mo> / </mo> </mrow> <mn> 3 </mn> <mo> + </mo> <msup> <mi> τ<!-- τ --> </mi> <mrow class="MJX-TeXAtom-ORD"> <mn> 2 </mn> </mrow> </msup> <mrow class="MJX-TeXAtom-ORD"> <mo> / </mo> </mrow> <mn> 12 </mn> <mo> + </mo> <mn> 4 </mn> <msub> <mi> a </mi> <mrow class="MJX-TeXAtom-ORD"> <mn> 4 </mn> </mrow> </msub> <msup> <mi> τ<!-- τ --> </mi> <mrow class="MJX-TeXAtom-ORD"> <mn> 3 </mn> </mrow> </msup> <mo> + </mo> <mi> O </mi> <mo stretchy="false"> ( </mo> <msup> <mi> τ<!-- τ --> </mi> <mrow class="MJX-TeXAtom-ORD"> <mn> 4 </mn> </mrow> </msup> <mo stretchy="false"> ) </mo> <mo stretchy="false"> ) </mo> <mi> d </mi> <mi> τ<!-- τ --> </mi> <mo> = </mo> <mrow class="MJX-TeXAtom-ORD"> <msqrt> <mn> 2 </mn> <mi> π<!-- π --> </mi> </msqrt> </mrow> <mo stretchy="false"> ( </mo> <msup> <mi> x </mi> <mrow class="MJX-TeXAtom-ORD"> <mo> −<!-- − --> </mo> <mn> 1 </mn> <mrow class="MJX-TeXAtom-ORD"> <mo> / </mo> </mrow> <mn> 2 </mn> </mrow> </msup> <mo> + </mo> <msup> <mi> x </mi> <mrow class="MJX-TeXAtom-ORD"> <mo> −<!-- − --> </mo> <mn> 3 </mn> <mrow class="MJX-TeXAtom-ORD"> <mo> / </mo> </mrow> <mn> 2 </mn> </mrow> </msup> <mrow class="MJX-TeXAtom-ORD"> <mo> / </mo> </mrow> <mn> 12 </mn> <mo stretchy="false"> ) </mo> <mo> + </mo> <mi> O </mi> <mo stretchy="false"> ( </mo> <msup> <mi> x </mi> <mrow class="MJX-TeXAtom-ORD"> <mo> −<!-- − --> </mo> <mn> 5 </mn> <mrow class="MJX-TeXAtom-ORD"> <mo> / </mo> </mrow> <mn> 2 </mn> </mrow> </msup> <mo stretchy="false"> ) </mo> </mstyle> </mrow> <annotation encoding="application/x-tex"> {\displaystyle x^{-x}e^{x}\Gamma (x)=\int _{\mathbb {R} }e^{-x\tau ^{2}/2}(1-\tau /3+\tau ^{2}/12+4a_{4}\tau ^{3}+O(\tau ^{4}))d\tau ={\sqrt {2\pi }}(x^{-1/2}+x^{-3/2}/12)+O(x^{-5/2})} </annotation> </semantics> </math></span> <noscript> <img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/53413a29c58763f2cc53f7f32fce6513f57ee2b1" class="mwe-math-fallback-image-display mw-invert skin-invert" aria-hidden="true" style="vertical-align: -2.338ex; width:99.464ex; height:5.676ex;" alt="{\displaystyle x^{-x}e^{x}\Gamma (x)=\int _{\mathbb {R} }e^{-x\tau ^{2}/2}(1-\tau /3+\tau ^{2}/12+4a_{4}\tau ^{3}+O(\tau ^{4}))d\tau ={\sqrt {2\pi }}(x^{-1/2}+x^{-3/2}/12)+O(x^{-5/2})}"> </noscript><span class="lazy-image-placeholder" style="width: 99.464ex;height: 5.676ex;vertical-align: -2.338ex;" data-src="https://wikimedia.org/api/rest_v1/media/math/render/svg/53413a29c58763f2cc53f7f32fce6513f57ee2b1" data-alt="{\displaystyle x^{-x}e^{x}\Gamma (x)=\int _{\mathbb {R} }e^{-x\tau ^{2}/2}(1-\tau /3+\tau ^{2}/12+4a_{4}\tau ^{3}+O(\tau ^{4}))d\tau ={\sqrt {2\pi }}(x^{-1/2}+x^{-3/2}/12)+O(x^{-5/2})}" data-class="mwe-math-fallback-image-display mw-invert skin-invert"> </span></span>notice how we don't need to actually find <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"> <math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle a_{4}}"><semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <msub> <mi> a </mi> <mrow class="MJX-TeXAtom-ORD"> <mn> 4 </mn> </mrow> </msub> </mstyle> </mrow> <annotation encoding="application/x-tex"> {\displaystyle a_{4}} </annotation> </semantics> </math></span> <noscript> <img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/c9fde542c1a0ee6390f05d9c0a58e9de213e4415" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.671ex; width:2.284ex; height:2.009ex;" alt="{\displaystyle a_{4}}"> </noscript><span class="lazy-image-placeholder" style="width: 2.284ex;height: 2.009ex;vertical-align: -0.671ex;" data-src="https://wikimedia.org/api/rest_v1/media/math/render/svg/c9fde542c1a0ee6390f05d9c0a58e9de213e4415" data-alt="{\displaystyle a_{4}}" data-class="mwe-math-fallback-image-inline mw-invert skin-invert"> </span></span>, since it is cancelled out by the integral. Higher orders can be achieved by computing more terms in <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"> <math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle t=\tau +\cdots }"><semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi> t </mi> <mo> = </mo> <mi> τ<!-- τ --> </mi> <mo> + </mo> <mo> ⋯<!-- ⋯ --> </mo> </mstyle> </mrow> <annotation encoding="application/x-tex"> {\displaystyle t=\tau +\cdots } </annotation> </semantics> </math></span> <noscript> <img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/914f0925da4067a78b1976f1bd9be2966c62d1ba" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.505ex; width:10.704ex; height:2.176ex;" alt="{\displaystyle t=\tau +\cdots }"> </noscript><span class="lazy-image-placeholder" style="width: 10.704ex;height: 2.176ex;vertical-align: -0.505ex;" data-src="https://wikimedia.org/api/rest_v1/media/math/render/svg/914f0925da4067a78b1976f1bd9be2966c62d1ba" data-alt="{\displaystyle t=\tau +\cdots }" data-class="mwe-math-fallback-image-inline mw-invert skin-invert"> </span></span>, which can be obtained programmatically.<sup id="cite_ref-mathematica-program_4-0" class="reference"><a href="https://en-m-wikipedia-org.translate.goog/wiki/Stirling's_approximation?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-GB#cite_note-mathematica-program-4"><span class="cite-bracket">[</span>note 1<span class="cite-bracket">]</span></a></sup></p> <p>Thus we get Stirling's formula to two orders:<span class="mwe-math-element"><span class="mwe-math-mathml-display mwe-math-mathml-a11y" style="display: none;"> <math display="block" xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle n!={\sqrt {2\pi n}}\left({\frac {n}{e}}\right)^{n}\left(1+{\frac {1}{12n}}+O\left({\frac {1}{n^{2}}}\right)\right).}"><semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi> n </mi> <mo> ! </mo> <mo> = </mo> <mrow class="MJX-TeXAtom-ORD"> <msqrt> <mn> 2 </mn> <mi> π<!-- π --> </mi> <mi> n </mi> </msqrt> </mrow> <msup> <mrow> <mo> ( </mo> <mrow class="MJX-TeXAtom-ORD"> <mfrac> <mi> n </mi> <mi> e </mi> </mfrac> </mrow> <mo> ) </mo> </mrow> <mrow class="MJX-TeXAtom-ORD"> <mi> n </mi> </mrow> </msup> <mrow> <mo> ( </mo> <mrow> <mn> 1 </mn> <mo> + </mo> <mrow class="MJX-TeXAtom-ORD"> <mfrac> <mn> 1 </mn> <mrow> <mn> 12 </mn> <mi> n </mi> </mrow> </mfrac> </mrow> <mo> + </mo> <mi> O </mi> <mrow> <mo> ( </mo> <mrow class="MJX-TeXAtom-ORD"> <mfrac> <mn> 1 </mn> <msup> <mi> n </mi> <mrow class="MJX-TeXAtom-ORD"> <mn> 2 </mn> </mrow> </msup> </mfrac> </mrow> <mo> ) </mo> </mrow> </mrow> <mo> ) </mo> </mrow> <mo> . </mo> </mstyle> </mrow> <annotation encoding="application/x-tex"> {\displaystyle n!={\sqrt {2\pi n}}\left({\frac {n}{e}}\right)^{n}\left(1+{\frac {1}{12n}}+O\left({\frac {1}{n^{2}}}\right)\right).} </annotation> </semantics> </math></span> <noscript> <img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/6cfc1fbd35d1f53867d7cce1047d3ceaf6741f4e" class="mwe-math-fallback-image-display mw-invert skin-invert" aria-hidden="true" style="vertical-align: -2.505ex; width:42.298ex; height:6.176ex;" alt="{\displaystyle n!={\sqrt {2\pi n}}\left({\frac {n}{e}}\right)^{n}\left(1+{\frac {1}{12n}}+O\left({\frac {1}{n^{2}}}\right)\right).}"> </noscript><span class="lazy-image-placeholder" style="width: 42.298ex;height: 6.176ex;vertical-align: -2.505ex;" data-src="https://wikimedia.org/api/rest_v1/media/math/render/svg/6cfc1fbd35d1f53867d7cce1047d3ceaf6741f4e" data-alt="{\displaystyle n!={\sqrt {2\pi n}}\left({\frac {n}{e}}\right)^{n}\left(1+{\frac {1}{12n}}+O\left({\frac {1}{n^{2}}}\right)\right).}" data-class="mwe-math-fallback-image-display mw-invert skin-invert"> </span></span></p> <div class="mw-heading mw-heading3"> <h3 id="Complex-analytic_version">Complex-analytic version</h3><span class="mw-editsection"> <a role="button" href="https://en-m-wikipedia-org.translate.goog/w/index.php?title=Stirling's_approximation&action=edit&section=4&_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-GB" title="Edit section: Complex-analytic version" class="cdx-button cdx-button--size-large cdx-button--fake-button cdx-button--fake-button--enabled cdx-button--icon-only cdx-button--weight-quiet "> <span class="minerva-icon minerva-icon--edit"></span> <span>edit</span> </a> </span> </div> <p>A complex-analysis version of this method<sup id="cite_ref-flajolet-sedgewick_5-0" class="reference"><a href="https://en-m-wikipedia-org.translate.goog/wiki/Stirling's_approximation?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-GB#cite_note-flajolet-sedgewick-5"><span class="cite-bracket">[</span>4<span class="cite-bracket">]</span></a></sup> is to consider <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"> <math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle {\frac {1}{n!}}}"><semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mrow class="MJX-TeXAtom-ORD"> <mfrac> <mn> 1 </mn> <mrow> <mi> n </mi> <mo> ! </mo> </mrow> </mfrac> </mrow> </mstyle> </mrow> <annotation encoding="application/x-tex"> {\displaystyle {\frac {1}{n!}}} </annotation> </semantics> </math></span> <noscript> <img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/13afd849707d08294eb548c3947c0f29801a4ad2" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -2.005ex; width:2.878ex; height:5.343ex;" alt="{\displaystyle {\frac {1}{n!}}}"> </noscript><span class="lazy-image-placeholder" style="width: 2.878ex;height: 5.343ex;vertical-align: -2.005ex;" data-src="https://wikimedia.org/api/rest_v1/media/math/render/svg/13afd849707d08294eb548c3947c0f29801a4ad2" data-alt="{\displaystyle {\frac {1}{n!}}}" data-class="mwe-math-fallback-image-inline mw-invert skin-invert"> </span></span> as a <a href="https://en-m-wikipedia-org.translate.goog/wiki/Taylor_series?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-GB" title="Taylor series">Taylor coefficient</a> of the exponential function <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"> <math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle e^{z}=\sum _{n=0}^{\infty }{\frac {z^{n}}{n!}}}"><semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <msup> <mi> e </mi> <mrow class="MJX-TeXAtom-ORD"> <mi> z </mi> </mrow> </msup> <mo> = </mo> <munderover> <mo> ∑<!-- ∑ --> </mo> <mrow class="MJX-TeXAtom-ORD"> <mi> n </mi> <mo> = </mo> <mn> 0 </mn> </mrow> <mrow class="MJX-TeXAtom-ORD"> <mi mathvariant="normal"> ∞<!-- ∞ --> </mi> </mrow> </munderover> <mrow class="MJX-TeXAtom-ORD"> <mfrac> <msup> <mi> z </mi> <mrow class="MJX-TeXAtom-ORD"> <mi> n </mi> </mrow> </msup> <mrow> <mi> n </mi> <mo> ! </mo> </mrow> </mfrac> </mrow> </mstyle> </mrow> <annotation encoding="application/x-tex"> {\displaystyle e^{z}=\sum _{n=0}^{\infty }{\frac {z^{n}}{n!}}} </annotation> </semantics> </math></span> <noscript> <img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/62afa4bdef0bbdf72a026e48d8089103e84fa37d" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -3.005ex; width:12.071ex; height:6.843ex;" alt="{\displaystyle e^{z}=\sum _{n=0}^{\infty }{\frac {z^{n}}{n!}}}"> </noscript><span class="lazy-image-placeholder" style="width: 12.071ex;height: 6.843ex;vertical-align: -3.005ex;" data-src="https://wikimedia.org/api/rest_v1/media/math/render/svg/62afa4bdef0bbdf72a026e48d8089103e84fa37d" data-alt="{\displaystyle e^{z}=\sum _{n=0}^{\infty }{\frac {z^{n}}{n!}}}" data-class="mwe-math-fallback-image-inline mw-invert skin-invert"> </span></span>, computed by <a href="https://en-m-wikipedia-org.translate.goog/wiki/Cauchy%27s_integral_formula?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-GB" title="Cauchy's integral formula">Cauchy's integral formula</a> as <span class="mwe-math-element"><span class="mwe-math-mathml-display mwe-math-mathml-a11y" style="display: none;"> <math display="block" xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle {\frac {1}{n!}}={\frac {1}{2\pi i}}\oint \limits _{|z|=r}{\frac {e^{z}}{z^{n+1}}}\,\mathrm {d} z.}"><semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mrow class="MJX-TeXAtom-ORD"> <mfrac> <mn> 1 </mn> <mrow> <mi> n </mi> <mo> ! </mo> </mrow> </mfrac> </mrow> <mo> = </mo> <mrow class="MJX-TeXAtom-ORD"> <mfrac> <mn> 1 </mn> <mrow> <mn> 2 </mn> <mi> π<!-- π --> </mi> <mi> i </mi> </mrow> </mfrac> </mrow> <munder> <mo> ∮<!-- ∮ --> </mo> <mrow class="MJX-TeXAtom-ORD"> <mrow class="MJX-TeXAtom-ORD"> <mo stretchy="false"> | </mo> </mrow> <mi> z </mi> <mrow class="MJX-TeXAtom-ORD"> <mo stretchy="false"> | </mo> </mrow> <mo> = </mo> <mi> r </mi> </mrow> </munder> <mrow class="MJX-TeXAtom-ORD"> <mfrac> <msup> <mi> e </mi> <mrow class="MJX-TeXAtom-ORD"> <mi> z </mi> </mrow> </msup> <msup> <mi> z </mi> <mrow class="MJX-TeXAtom-ORD"> <mi> n </mi> <mo> + </mo> <mn> 1 </mn> </mrow> </msup> </mfrac> </mrow> <mspace width="thinmathspace"></mspace> <mrow class="MJX-TeXAtom-ORD"> <mi mathvariant="normal"> d </mi> </mrow> <mi> z </mi> <mo> . </mo> </mstyle> </mrow> <annotation encoding="application/x-tex"> {\displaystyle {\frac {1}{n!}}={\frac {1}{2\pi i}}\oint \limits _{|z|=r}{\frac {e^{z}}{z^{n+1}}}\,\mathrm {d} z.} </annotation> </semantics> </math></span> <noscript> <img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/9c8e7fbd26bd3cb1707d6e67604a7f64734ba243" class="mwe-math-fallback-image-display mw-invert skin-invert" aria-hidden="true" style="vertical-align: -4.505ex; width:22.662ex; height:7.843ex;" alt="{\displaystyle {\frac {1}{n!}}={\frac {1}{2\pi i}}\oint \limits _{|z|=r}{\frac {e^{z}}{z^{n+1}}}\,\mathrm {d} z.}"> </noscript><span class="lazy-image-placeholder" style="width: 22.662ex;height: 7.843ex;vertical-align: -4.505ex;" data-src="https://wikimedia.org/api/rest_v1/media/math/render/svg/9c8e7fbd26bd3cb1707d6e67604a7f64734ba243" data-alt="{\displaystyle {\frac {1}{n!}}={\frac {1}{2\pi i}}\oint \limits _{|z|=r}{\frac {e^{z}}{z^{n+1}}}\,\mathrm {d} z.}" data-class="mwe-math-fallback-image-display mw-invert skin-invert"> </span></span></p> <p>This line integral can then be approximated using the <a href="https://en-m-wikipedia-org.translate.goog/wiki/Method_of_steepest_descent?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-GB" title="Method of steepest descent">saddle-point method</a> with an appropriate choice of contour radius <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"> <math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle r=r_{n}}"><semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi> r </mi> <mo> = </mo> <msub> <mi> r </mi> <mrow class="MJX-TeXAtom-ORD"> <mi> n </mi> </mrow> </msub> </mstyle> </mrow> <annotation encoding="application/x-tex"> {\displaystyle r=r_{n}} </annotation> </semantics> </math></span> <noscript> <img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/402caef90569e54e6e8864e299f869dd849df91e" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.671ex; width:6.414ex; height:2.009ex;" alt="{\displaystyle r=r_{n}}"> </noscript><span class="lazy-image-placeholder" style="width: 6.414ex;height: 2.009ex;vertical-align: -0.671ex;" data-src="https://wikimedia.org/api/rest_v1/media/math/render/svg/402caef90569e54e6e8864e299f869dd849df91e" data-alt="{\displaystyle r=r_{n}}" data-class="mwe-math-fallback-image-inline mw-invert skin-invert"> </span></span>. The dominant portion of the integral near the saddle point is then approximated by a real integral and Laplace's method, while the remaining portion of the integral can be bounded above to give an error term.</p> </section> <div class="mw-heading mw-heading2 section-heading" onclick="mfTempOpenSection(3)"> <span class="indicator mf-icon mf-icon-expand mf-icon--small"></span> <h2 id="Speed_of_convergence_and_error_estimates">Speed of convergence and error estimates</h2><span class="mw-editsection"> <a role="button" href="https://en-m-wikipedia-org.translate.goog/w/index.php?title=Stirling's_approximation&action=edit&section=5&_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-GB" title="Edit section: Speed of convergence and error estimates" class="cdx-button cdx-button--size-large cdx-button--fake-button cdx-button--fake-button--enabled cdx-button--icon-only cdx-button--weight-quiet "> <span class="minerva-icon minerva-icon--edit"></span> <span>edit</span> </a> </span> </div> <section class="mf-section-3 collapsible-block" id="mf-section-3"> <figure class="mw-default-size" typeof="mw:File/Thumb"> <a href="https://en-m-wikipedia-org.translate.goog/wiki/File:Stirling_series_relative_error.svg?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-GB" class="mw-file-description"> <noscript> <img src="//upload.wikimedia.org/wikipedia/commons/thumb/3/37/Stirling_series_relative_error.svg/400px-Stirling_series_relative_error.svg.png" decoding="async" width="400" height="286" class="mw-file-element" data-file-width="740" data-file-height="530"> </noscript><span class="lazy-image-placeholder" style="width: 400px;height: 286px;" data-src="//upload.wikimedia.org/wikipedia/commons/thumb/3/37/Stirling_series_relative_error.svg/400px-Stirling_series_relative_error.svg.png" data-width="400" data-height="286" data-srcset="//upload.wikimedia.org/wikipedia/commons/thumb/3/37/Stirling_series_relative_error.svg/600px-Stirling_series_relative_error.svg.png 1.5x, //upload.wikimedia.org/wikipedia/commons/thumb/3/37/Stirling_series_relative_error.svg/800px-Stirling_series_relative_error.svg.png 2x" data-class="mw-file-element"> </span></a> <figcaption> The relative error in a truncated Stirling series vs. <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"> <math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle n}"><semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi> n </mi> </mstyle> </mrow> <annotation encoding="application/x-tex"> {\displaystyle n} </annotation> </semantics> </math></span> <noscript> <img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/a601995d55609f2d9f5e233e36fbe9ea26011b3b" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:1.395ex; height:1.676ex;" alt="{\displaystyle n}"> </noscript><span class="lazy-image-placeholder" style="width: 1.395ex;height: 1.676ex;vertical-align: -0.338ex;" data-src="https://wikimedia.org/api/rest_v1/media/math/render/svg/a601995d55609f2d9f5e233e36fbe9ea26011b3b" data-alt="{\displaystyle n}" data-class="mwe-math-fallback-image-inline mw-invert skin-invert"> </span></span>, for 0 to 5 terms. The kinks in the curves represent points where the truncated series coincides with <span class="texhtml">Γ(<i>n</i> + 1)</span>. </figcaption> </figure> <p>Stirling's formula is in fact the first approximation to the following series (now called the <b>Stirling series</b>):<sup id="cite_ref-nist_6-0" class="reference"><a href="https://en-m-wikipedia-org.translate.goog/wiki/Stirling's_approximation?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-GB#cite_note-nist-6"><span class="cite-bracket">[</span>5<span class="cite-bracket">]</span></a></sup> <span class="mwe-math-element"><span class="mwe-math-mathml-display mwe-math-mathml-a11y" style="display: none;"> <math display="block" xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle n!\sim {\sqrt {2\pi n}}\left({\frac {n}{e}}\right)^{n}\left(1+{\frac {1}{12n}}+{\frac {1}{288n^{2}}}-{\frac {139}{51840n^{3}}}-{\frac {571}{2488320n^{4}}}+\cdots \right).}"><semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi> n </mi> <mo> ! </mo> <mo> ∼<!-- ∼ --> </mo> <mrow class="MJX-TeXAtom-ORD"> <msqrt> <mn> 2 </mn> <mi> π<!-- π --> </mi> <mi> n </mi> </msqrt> </mrow> <msup> <mrow> <mo> ( </mo> <mrow class="MJX-TeXAtom-ORD"> <mfrac> <mi> n </mi> <mi> e </mi> </mfrac> </mrow> <mo> ) </mo> </mrow> <mrow class="MJX-TeXAtom-ORD"> <mi> n </mi> </mrow> </msup> <mrow> <mo> ( </mo> <mrow> <mn> 1 </mn> <mo> + </mo> <mrow class="MJX-TeXAtom-ORD"> <mfrac> <mn> 1 </mn> <mrow> <mn> 12 </mn> <mi> n </mi> </mrow> </mfrac> </mrow> <mo> + </mo> <mrow class="MJX-TeXAtom-ORD"> <mfrac> <mn> 1 </mn> <mrow> <mn> 288 </mn> <msup> <mi> n </mi> <mrow class="MJX-TeXAtom-ORD"> <mn> 2 </mn> </mrow> </msup> </mrow> </mfrac> </mrow> <mo> −<!-- − --> </mo> <mrow class="MJX-TeXAtom-ORD"> <mfrac> <mn> 139 </mn> <mrow> <mn> 51840 </mn> <msup> <mi> n </mi> <mrow class="MJX-TeXAtom-ORD"> <mn> 3 </mn> </mrow> </msup> </mrow> </mfrac> </mrow> <mo> −<!-- − --> </mo> <mrow class="MJX-TeXAtom-ORD"> <mfrac> <mn> 571 </mn> <mrow> <mn> 2488320 </mn> <msup> <mi> n </mi> <mrow class="MJX-TeXAtom-ORD"> <mn> 4 </mn> </mrow> </msup> </mrow> </mfrac> </mrow> <mo> + </mo> <mo> ⋯<!-- ⋯ --> </mo> </mrow> <mo> ) </mo> </mrow> <mo> . </mo> </mstyle> </mrow> <annotation encoding="application/x-tex"> {\displaystyle n!\sim {\sqrt {2\pi n}}\left({\frac {n}{e}}\right)^{n}\left(1+{\frac {1}{12n}}+{\frac {1}{288n^{2}}}-{\frac {139}{51840n^{3}}}-{\frac {571}{2488320n^{4}}}+\cdots \right).} </annotation> </semantics> </math></span> <noscript> <img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/3b2cf3c9b6fe771f6b3c1179a846ed77f19f4f89" class="mwe-math-fallback-image-display mw-invert skin-invert" aria-hidden="true" style="vertical-align: -2.505ex; width:71.968ex; height:6.176ex;" alt="{\displaystyle n!\sim {\sqrt {2\pi n}}\left({\frac {n}{e}}\right)^{n}\left(1+{\frac {1}{12n}}+{\frac {1}{288n^{2}}}-{\frac {139}{51840n^{3}}}-{\frac {571}{2488320n^{4}}}+\cdots \right).}"> </noscript><span class="lazy-image-placeholder" style="width: 71.968ex;height: 6.176ex;vertical-align: -2.505ex;" data-src="https://wikimedia.org/api/rest_v1/media/math/render/svg/3b2cf3c9b6fe771f6b3c1179a846ed77f19f4f89" data-alt="{\displaystyle n!\sim {\sqrt {2\pi n}}\left({\frac {n}{e}}\right)^{n}\left(1+{\frac {1}{12n}}+{\frac {1}{288n^{2}}}-{\frac {139}{51840n^{3}}}-{\frac {571}{2488320n^{4}}}+\cdots \right).}" data-class="mwe-math-fallback-image-display mw-invert skin-invert"> </span></span></p> <p>An explicit formula for the coefficients in this series was given by G. Nemes.<sup id="cite_ref-Nemes2010-2_7-0" class="reference"><a href="https://en-m-wikipedia-org.translate.goog/wiki/Stirling's_approximation?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-GB#cite_note-Nemes2010-2-7"><span class="cite-bracket">[</span>6<span class="cite-bracket">]</span></a></sup> Further terms are listed in the <a href="https://en-m-wikipedia-org.translate.goog/wiki/On-Line_Encyclopedia_of_Integer_Sequences?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-GB" title="On-Line Encyclopedia of Integer Sequences">On-Line Encyclopedia of Integer Sequences</a> as <a href="https://translate.google.com/website?sl=auto&tl=en&hl=en-GB&u=https://oeis.org/A001163" class="extiw" title="oeis:A001163">A001163</a> and <a href="https://translate.google.com/website?sl=auto&tl=en&hl=en-GB&u=https://oeis.org/A001164" class="extiw" title="oeis:A001164">A001164</a>. The first graph in this section shows the <a href="https://en-m-wikipedia-org.translate.goog/wiki/Approximation_error?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-GB" title="Approximation error">relative error</a> vs. <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"> <math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle n}"><semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi> n </mi> </mstyle> </mrow> <annotation encoding="application/x-tex"> {\displaystyle n} </annotation> </semantics> </math></span> <noscript> <img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/a601995d55609f2d9f5e233e36fbe9ea26011b3b" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:1.395ex; height:1.676ex;" alt="{\displaystyle n}"> </noscript><span class="lazy-image-placeholder" style="width: 1.395ex;height: 1.676ex;vertical-align: -0.338ex;" data-src="https://wikimedia.org/api/rest_v1/media/math/render/svg/a601995d55609f2d9f5e233e36fbe9ea26011b3b" data-alt="{\displaystyle n}" data-class="mwe-math-fallback-image-inline mw-invert skin-invert"> </span></span>, for 1 through all 5 terms listed above. (Bender and Orszag<sup id="cite_ref-8" class="reference"><a href="https://en-m-wikipedia-org.translate.goog/wiki/Stirling's_approximation?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-GB#cite_note-8"><span class="cite-bracket">[</span>7<span class="cite-bracket">]</span></a></sup> p. 218) gives the asymptotic formula for the coefficients:<span class="mwe-math-element"><span class="mwe-math-mathml-display mwe-math-mathml-a11y" style="display: none;"> <math display="block" xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle A_{2j+1}\sim (-1)^{j}2(2j)!/(2\pi )^{2(j+1)}}"><semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <msub> <mi> A </mi> <mrow class="MJX-TeXAtom-ORD"> <mn> 2 </mn> <mi> j </mi> <mo> + </mo> <mn> 1 </mn> </mrow> </msub> <mo> ∼<!-- ∼ --> </mo> <mo stretchy="false"> ( </mo> <mo> −<!-- − --> </mo> <mn> 1 </mn> <msup> <mo stretchy="false"> ) </mo> <mrow class="MJX-TeXAtom-ORD"> <mi> j </mi> </mrow> </msup> <mn> 2 </mn> <mo stretchy="false"> ( </mo> <mn> 2 </mn> <mi> j </mi> <mo stretchy="false"> ) </mo> <mo> ! </mo> <mrow class="MJX-TeXAtom-ORD"> <mo> / </mo> </mrow> <mo stretchy="false"> ( </mo> <mn> 2 </mn> <mi> π<!-- π --> </mi> <msup> <mo stretchy="false"> ) </mo> <mrow class="MJX-TeXAtom-ORD"> <mn> 2 </mn> <mo stretchy="false"> ( </mo> <mi> j </mi> <mo> + </mo> <mn> 1 </mn> <mo stretchy="false"> ) </mo> </mrow> </msup> </mstyle> </mrow> <annotation encoding="application/x-tex"> {\displaystyle A_{2j+1}\sim (-1)^{j}2(2j)!/(2\pi )^{2(j+1)}} </annotation> </semantics> </math></span> <noscript> <img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/7e99c9ce19477b939bdfffc501b95a1ed9df9b3a" class="mwe-math-fallback-image-display mw-invert skin-invert" aria-hidden="true" style="vertical-align: -1.005ex; width:30.68ex; height:3.509ex;" alt="{\displaystyle A_{2j+1}\sim (-1)^{j}2(2j)!/(2\pi )^{2(j+1)}}"> </noscript><span class="lazy-image-placeholder" style="width: 30.68ex;height: 3.509ex;vertical-align: -1.005ex;" data-src="https://wikimedia.org/api/rest_v1/media/math/render/svg/7e99c9ce19477b939bdfffc501b95a1ed9df9b3a" data-alt="{\displaystyle A_{2j+1}\sim (-1)^{j}2(2j)!/(2\pi )^{2(j+1)}}" data-class="mwe-math-fallback-image-display mw-invert skin-invert"> </span></span>which shows that it grows superexponentially, and that by <a href="https://en-m-wikipedia-org.translate.goog/wiki/Ratio_test?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-GB" title="Ratio test">ratio test</a> the <a href="https://en-m-wikipedia-org.translate.goog/wiki/Radius_of_convergence?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-GB" title="Radius of convergence">radius of convergence</a> is zero.</p> <figure class="mw-default-size" typeof="mw:File/Thumb"> <a href="https://en-m-wikipedia-org.translate.goog/wiki/File:Stirling_error_vs_number_of_terms.svg?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-GB" class="mw-file-description"> <noscript> <img src="//upload.wikimedia.org/wikipedia/commons/thumb/a/a8/Stirling_error_vs_number_of_terms.svg/400px-Stirling_error_vs_number_of_terms.svg.png" decoding="async" width="400" height="271" class="mw-file-element" data-file-width="736" data-file-height="499"> </noscript><span class="lazy-image-placeholder" style="width: 400px;height: 271px;" data-src="//upload.wikimedia.org/wikipedia/commons/thumb/a/a8/Stirling_error_vs_number_of_terms.svg/400px-Stirling_error_vs_number_of_terms.svg.png" data-width="400" data-height="271" data-srcset="//upload.wikimedia.org/wikipedia/commons/thumb/a/a8/Stirling_error_vs_number_of_terms.svg/600px-Stirling_error_vs_number_of_terms.svg.png 1.5x, //upload.wikimedia.org/wikipedia/commons/thumb/a/a8/Stirling_error_vs_number_of_terms.svg/800px-Stirling_error_vs_number_of_terms.svg.png 2x" data-class="mw-file-element"> </span></a> <figcaption> The relative error in a truncated Stirling series vs. the number of terms used </figcaption> </figure> <p>As <span class="texhtml"><i>n</i> → ∞</span>, the error in the truncated series is asymptotically equal to the first omitted term. This is an example of an <a href="https://en-m-wikipedia-org.translate.goog/wiki/Asymptotic_expansion?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-GB" title="Asymptotic expansion">asymptotic expansion</a>. It is not a <a href="https://en-m-wikipedia-org.translate.goog/wiki/Convergent_series?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-GB" title="Convergent series">convergent series</a>; for any <i>particular</i> value of <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"> <math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle n}"><semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi> n </mi> </mstyle> </mrow> <annotation encoding="application/x-tex"> {\displaystyle n} </annotation> </semantics> </math></span> <noscript> <img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/a601995d55609f2d9f5e233e36fbe9ea26011b3b" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:1.395ex; height:1.676ex;" alt="{\displaystyle n}"> </noscript><span class="lazy-image-placeholder" style="width: 1.395ex;height: 1.676ex;vertical-align: -0.338ex;" data-src="https://wikimedia.org/api/rest_v1/media/math/render/svg/a601995d55609f2d9f5e233e36fbe9ea26011b3b" data-alt="{\displaystyle n}" data-class="mwe-math-fallback-image-inline mw-invert skin-invert"> </span></span> there are only so many terms of the series that improve accuracy, after which accuracy worsens. This is shown in the next graph, which shows the relative error versus the number of terms in the series, for larger numbers of terms. More precisely, let <span class="texhtml"><i>S</i>(<i>n</i>, <i>t</i>)</span> be the Stirling series to <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"> <math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle t}"><semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi> t </mi> </mstyle> </mrow> <annotation encoding="application/x-tex"> {\displaystyle t} </annotation> </semantics> </math></span> <noscript> <img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/65658b7b223af9e1acc877d848888ecdb4466560" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:0.84ex; height:2.009ex;" alt="{\displaystyle t}"> </noscript><span class="lazy-image-placeholder" style="width: 0.84ex;height: 2.009ex;vertical-align: -0.338ex;" data-src="https://wikimedia.org/api/rest_v1/media/math/render/svg/65658b7b223af9e1acc877d848888ecdb4466560" data-alt="{\displaystyle t}" data-class="mwe-math-fallback-image-inline mw-invert skin-invert"> </span></span> terms evaluated at <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"> <math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle n}"><semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi> n </mi> </mstyle> </mrow> <annotation encoding="application/x-tex"> {\displaystyle n} </annotation> </semantics> </math></span> <noscript> <img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/a601995d55609f2d9f5e233e36fbe9ea26011b3b" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:1.395ex; height:1.676ex;" alt="{\displaystyle n}"> </noscript><span class="lazy-image-placeholder" style="width: 1.395ex;height: 1.676ex;vertical-align: -0.338ex;" data-src="https://wikimedia.org/api/rest_v1/media/math/render/svg/a601995d55609f2d9f5e233e36fbe9ea26011b3b" data-alt="{\displaystyle n}" data-class="mwe-math-fallback-image-inline mw-invert skin-invert"> </span></span>. The graphs show <span class="mwe-math-element"><span class="mwe-math-mathml-display mwe-math-mathml-a11y" style="display: none;"> <math display="block" xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \left|\ln \left({\frac {S(n,t)}{n!}}\right)\right|,}"><semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mrow> <mo> | </mo> <mrow> <mi> ln </mi> <mo> <!-- --> </mo> <mrow> <mo> ( </mo> <mrow class="MJX-TeXAtom-ORD"> <mfrac> <mrow> <mi> S </mi> <mo stretchy="false"> ( </mo> <mi> n </mi> <mo> , </mo> <mi> t </mi> <mo stretchy="false"> ) </mo> </mrow> <mrow> <mi> n </mi> <mo> ! </mo> </mrow> </mfrac> </mrow> <mo> ) </mo> </mrow> </mrow> <mo> | </mo> </mrow> <mo> , </mo> </mstyle> </mrow> <annotation encoding="application/x-tex"> {\displaystyle \left|\ln \left({\frac {S(n,t)}{n!}}\right)\right|,} </annotation> </semantics> </math></span> <noscript> <img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/451995218e426dea9963cd62fd1caaa712d0ae8c" class="mwe-math-fallback-image-display mw-invert skin-invert" aria-hidden="true" style="vertical-align: -2.671ex; width:15.101ex; height:6.509ex;" alt="{\displaystyle \left|\ln \left({\frac {S(n,t)}{n!}}\right)\right|,}"> </noscript><span class="lazy-image-placeholder" style="width: 15.101ex;height: 6.509ex;vertical-align: -2.671ex;" data-src="https://wikimedia.org/api/rest_v1/media/math/render/svg/451995218e426dea9963cd62fd1caaa712d0ae8c" data-alt="{\displaystyle \left|\ln \left({\frac {S(n,t)}{n!}}\right)\right|,}" data-class="mwe-math-fallback-image-display mw-invert skin-invert"> </span></span> which, when small, is essentially the relative error.</p> <p>Writing Stirling's series in the form <span class="mwe-math-element"><span class="mwe-math-mathml-display mwe-math-mathml-a11y" style="display: none;"> <math display="block" xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \ln(n!)\sim n\ln n-n+{\tfrac {1}{2}}\ln(2\pi n)+{\frac {1}{12n}}-{\frac {1}{360n^{3}}}+{\frac {1}{1260n^{5}}}-{\frac {1}{1680n^{7}}}+\cdots ,}"><semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi> ln </mi> <mo> <!-- --> </mo> <mo stretchy="false"> ( </mo> <mi> n </mi> <mo> ! </mo> <mo stretchy="false"> ) </mo> <mo> ∼<!-- ∼ --> </mo> <mi> n </mi> <mi> ln </mi> <mo> <!-- --> </mo> <mi> n </mi> <mo> −<!-- − --> </mo> <mi> n </mi> <mo> + </mo> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="false" scriptlevel="0"> <mfrac> <mn> 1 </mn> <mn> 2 </mn> </mfrac> </mstyle> </mrow> <mi> ln </mi> <mo> <!-- --> </mo> <mo stretchy="false"> ( </mo> <mn> 2 </mn> <mi> π<!-- π --> </mi> <mi> n </mi> <mo stretchy="false"> ) </mo> <mo> + </mo> <mrow class="MJX-TeXAtom-ORD"> <mfrac> <mn> 1 </mn> <mrow> <mn> 12 </mn> <mi> n </mi> </mrow> </mfrac> </mrow> <mo> −<!-- − --> </mo> <mrow class="MJX-TeXAtom-ORD"> <mfrac> <mn> 1 </mn> <mrow> <mn> 360 </mn> <msup> <mi> n </mi> <mrow class="MJX-TeXAtom-ORD"> <mn> 3 </mn> </mrow> </msup> </mrow> </mfrac> </mrow> <mo> + </mo> <mrow class="MJX-TeXAtom-ORD"> <mfrac> <mn> 1 </mn> <mrow> <mn> 1260 </mn> <msup> <mi> n </mi> <mrow class="MJX-TeXAtom-ORD"> <mn> 5 </mn> </mrow> </msup> </mrow> </mfrac> </mrow> <mo> −<!-- − --> </mo> <mrow class="MJX-TeXAtom-ORD"> <mfrac> <mn> 1 </mn> <mrow> <mn> 1680 </mn> <msup> <mi> n </mi> <mrow class="MJX-TeXAtom-ORD"> <mn> 7 </mn> </mrow> </msup> </mrow> </mfrac> </mrow> <mo> + </mo> <mo> ⋯<!-- ⋯ --> </mo> <mo> , </mo> </mstyle> </mrow> <annotation encoding="application/x-tex"> {\displaystyle \ln(n!)\sim n\ln n-n+{\tfrac {1}{2}}\ln(2\pi n)+{\frac {1}{12n}}-{\frac {1}{360n^{3}}}+{\frac {1}{1260n^{5}}}-{\frac {1}{1680n^{7}}}+\cdots ,} </annotation> </semantics> </math></span> <noscript> <img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/7ea7279df14c37194e55c825ac63e749ba4c2a98" class="mwe-math-fallback-image-display mw-invert skin-invert" aria-hidden="true" style="vertical-align: -2.171ex; width:76.307ex; height:5.509ex;" alt="{\displaystyle \ln(n!)\sim n\ln n-n+{\tfrac {1}{2}}\ln(2\pi n)+{\frac {1}{12n}}-{\frac {1}{360n^{3}}}+{\frac {1}{1260n^{5}}}-{\frac {1}{1680n^{7}}}+\cdots ,}"> </noscript><span class="lazy-image-placeholder" style="width: 76.307ex;height: 5.509ex;vertical-align: -2.171ex;" data-src="https://wikimedia.org/api/rest_v1/media/math/render/svg/7ea7279df14c37194e55c825ac63e749ba4c2a98" data-alt="{\displaystyle \ln(n!)\sim n\ln n-n+{\tfrac {1}{2}}\ln(2\pi n)+{\frac {1}{12n}}-{\frac {1}{360n^{3}}}+{\frac {1}{1260n^{5}}}-{\frac {1}{1680n^{7}}}+\cdots ,}" data-class="mwe-math-fallback-image-display mw-invert skin-invert"> </span></span> it is known that the error in truncating the series is always of the opposite sign and at most the same magnitude as the first omitted term.</p> <p>Other bounds, due to Robbins,<sup id="cite_ref-Robbins1955_9-0" class="reference"><a href="https://en-m-wikipedia-org.translate.goog/wiki/Stirling's_approximation?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-GB#cite_note-Robbins1955-9"><span class="cite-bracket">[</span>8<span class="cite-bracket">]</span></a></sup> valid for all positive integers <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"> <math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle n}"><semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi> n </mi> </mstyle> </mrow> <annotation encoding="application/x-tex"> {\displaystyle n} </annotation> </semantics> </math></span> <noscript> <img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/a601995d55609f2d9f5e233e36fbe9ea26011b3b" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:1.395ex; height:1.676ex;" alt="{\displaystyle n}"> </noscript><span class="lazy-image-placeholder" style="width: 1.395ex;height: 1.676ex;vertical-align: -0.338ex;" data-src="https://wikimedia.org/api/rest_v1/media/math/render/svg/a601995d55609f2d9f5e233e36fbe9ea26011b3b" data-alt="{\displaystyle n}" data-class="mwe-math-fallback-image-inline mw-invert skin-invert"> </span></span> are <span class="mwe-math-element"><span class="mwe-math-mathml-display mwe-math-mathml-a11y" style="display: none;"> <math display="block" xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle {\sqrt {2\pi n}}\left({\frac {n}{e}}\right)^{n}e^{\frac {1}{12n+1}}<n!<{\sqrt {2\pi n}}\left({\frac {n}{e}}\right)^{n}e^{\frac {1}{12n}}.}"><semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mrow class="MJX-TeXAtom-ORD"> <msqrt> <mn> 2 </mn> <mi> π<!-- π --> </mi> <mi> n </mi> </msqrt> </mrow> <msup> <mrow> <mo> ( </mo> <mrow class="MJX-TeXAtom-ORD"> <mfrac> <mi> n </mi> <mi> e </mi> </mfrac> </mrow> <mo> ) </mo> </mrow> <mrow class="MJX-TeXAtom-ORD"> <mi> n </mi> </mrow> </msup> <msup> <mi> e </mi> <mrow class="MJX-TeXAtom-ORD"> <mfrac> <mn> 1 </mn> <mrow> <mn> 12 </mn> <mi> n </mi> <mo> + </mo> <mn> 1 </mn> </mrow> </mfrac> </mrow> </msup> <mo> < </mo> <mi> n </mi> <mo> ! </mo> <mo> < </mo> <mrow class="MJX-TeXAtom-ORD"> <msqrt> <mn> 2 </mn> <mi> π<!-- π --> </mi> <mi> n </mi> </msqrt> </mrow> <msup> <mrow> <mo> ( </mo> <mrow class="MJX-TeXAtom-ORD"> <mfrac> <mi> n </mi> <mi> e </mi> </mfrac> </mrow> <mo> ) </mo> </mrow> <mrow class="MJX-TeXAtom-ORD"> <mi> n </mi> </mrow> </msup> <msup> <mi> e </mi> <mrow class="MJX-TeXAtom-ORD"> <mfrac> <mn> 1 </mn> <mrow> <mn> 12 </mn> <mi> n </mi> </mrow> </mfrac> </mrow> </msup> <mo> . </mo> </mstyle> </mrow> <annotation encoding="application/x-tex"> {\displaystyle {\sqrt {2\pi n}}\left({\frac {n}{e}}\right)^{n}e^{\frac {1}{12n+1}}<n!<{\sqrt {2\pi n}}\left({\frac {n}{e}}\right)^{n}e^{\frac {1}{12n}}.} </annotation> </semantics> </math></span> <noscript> <img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/7326478542ba974e9a5b120756b3ca0cd834a404" class="mwe-math-fallback-image-display mw-invert skin-invert" aria-hidden="true" style="vertical-align: -1.838ex; width:43.265ex; height:5.176ex;" alt="{\displaystyle {\sqrt {2\pi n}}\left({\frac {n}{e}}\right)^{n}e^{\frac {1}{12n+1}}<n!<{\sqrt {2\pi n}}\left({\frac {n}{e}}\right)^{n}e^{\frac {1}{12n}}.}"> </noscript><span class="lazy-image-placeholder" style="width: 43.265ex;height: 5.176ex;vertical-align: -1.838ex;" data-src="https://wikimedia.org/api/rest_v1/media/math/render/svg/7326478542ba974e9a5b120756b3ca0cd834a404" data-alt="{\displaystyle {\sqrt {2\pi n}}\left({\frac {n}{e}}\right)^{n}e^{\frac {1}{12n+1}}<n!<{\sqrt {2\pi n}}\left({\frac {n}{e}}\right)^{n}e^{\frac {1}{12n}}.}" data-class="mwe-math-fallback-image-display mw-invert skin-invert"> </span></span> This upper bound corresponds to stopping the above series for <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"> <math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \ln(n!)}"><semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi> ln </mi> <mo> <!-- --> </mo> <mo stretchy="false"> ( </mo> <mi> n </mi> <mo> ! </mo> <mo stretchy="false"> ) </mo> </mstyle> </mrow> <annotation encoding="application/x-tex"> {\displaystyle \ln(n!)} </annotation> </semantics> </math></span> <noscript> <img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/d264f09c80b779e9028658543d5e31ae647cacf1" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:5.79ex; height:2.843ex;" alt="{\displaystyle \ln(n!)}"> </noscript><span class="lazy-image-placeholder" style="width: 5.79ex;height: 2.843ex;vertical-align: -0.838ex;" data-src="https://wikimedia.org/api/rest_v1/media/math/render/svg/d264f09c80b779e9028658543d5e31ae647cacf1" data-alt="{\displaystyle \ln(n!)}" data-class="mwe-math-fallback-image-inline mw-invert skin-invert"> </span></span> after the <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"> <math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle {\frac {1}{n}}}"><semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mrow class="MJX-TeXAtom-ORD"> <mfrac> <mn> 1 </mn> <mi> n </mi> </mfrac> </mrow> </mstyle> </mrow> <annotation encoding="application/x-tex"> {\displaystyle {\frac {1}{n}}} </annotation> </semantics> </math></span> <noscript> <img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/cf0aefecf48d43fdedd71e318ae6129bd67be252" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -1.838ex; width:2.231ex; height:5.176ex;" alt="{\displaystyle {\frac {1}{n}}}"> </noscript><span class="lazy-image-placeholder" style="width: 2.231ex;height: 5.176ex;vertical-align: -1.838ex;" data-src="https://wikimedia.org/api/rest_v1/media/math/render/svg/cf0aefecf48d43fdedd71e318ae6129bd67be252" data-alt="{\displaystyle {\frac {1}{n}}}" data-class="mwe-math-fallback-image-inline mw-invert skin-invert"> </span></span> term. The lower bound is weaker than that obtained by stopping the series after the <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"> <math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle {\frac {1}{n^{3}}}}"><semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mrow class="MJX-TeXAtom-ORD"> <mfrac> <mn> 1 </mn> <msup> <mi> n </mi> <mrow class="MJX-TeXAtom-ORD"> <mn> 3 </mn> </mrow> </msup> </mfrac> </mrow> </mstyle> </mrow> <annotation encoding="application/x-tex"> {\displaystyle {\frac {1}{n^{3}}}} </annotation> </semantics> </math></span> <noscript> <img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/5b069e94735197bb88b1e47acf1165c341c799a0" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -2.171ex; width:3.285ex; height:5.509ex;" alt="{\displaystyle {\frac {1}{n^{3}}}}"> </noscript><span class="lazy-image-placeholder" style="width: 3.285ex;height: 5.509ex;vertical-align: -2.171ex;" data-src="https://wikimedia.org/api/rest_v1/media/math/render/svg/5b069e94735197bb88b1e47acf1165c341c799a0" data-alt="{\displaystyle {\frac {1}{n^{3}}}}" data-class="mwe-math-fallback-image-inline mw-invert skin-invert"> </span></span> term. A looser version of this bound is that <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"> <math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle {\frac {n!e^{n}}{n^{n+{\frac {1}{2}}}}}\in ({\sqrt {2\pi }},e]}"><semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mrow class="MJX-TeXAtom-ORD"> <mfrac> <mrow> <mi> n </mi> <mo> ! </mo> <msup> <mi> e </mi> <mrow class="MJX-TeXAtom-ORD"> <mi> n </mi> </mrow> </msup> </mrow> <msup> <mi> n </mi> <mrow class="MJX-TeXAtom-ORD"> <mi> n </mi> <mo> + </mo> <mrow class="MJX-TeXAtom-ORD"> <mfrac> <mn> 1 </mn> <mn> 2 </mn> </mfrac> </mrow> </mrow> </msup> </mfrac> </mrow> <mo> ∈<!-- ∈ --> </mo> <mo stretchy="false"> ( </mo> <mrow class="MJX-TeXAtom-ORD"> <msqrt> <mn> 2 </mn> <mi> π<!-- π --> </mi> </msqrt> </mrow> <mo> , </mo> <mi> e </mi> <mo stretchy="false"> ] </mo> </mstyle> </mrow> <annotation encoding="application/x-tex"> {\displaystyle {\frac {n!e^{n}}{n^{n+{\frac {1}{2}}}}}\in ({\sqrt {2\pi }},e]} </annotation> </semantics> </math></span> <noscript> <img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/809b4def5f2cd3a4f66ee3651b61f8c5d1f7e5b8" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -3.338ex; width:17.171ex; height:6.843ex;" alt="{\displaystyle {\frac {n!e^{n}}{n^{n+{\frac {1}{2}}}}}\in ({\sqrt {2\pi }},e]}"> </noscript><span class="lazy-image-placeholder" style="width: 17.171ex;height: 6.843ex;vertical-align: -3.338ex;" data-src="https://wikimedia.org/api/rest_v1/media/math/render/svg/809b4def5f2cd3a4f66ee3651b61f8c5d1f7e5b8" data-alt="{\displaystyle {\frac {n!e^{n}}{n^{n+{\frac {1}{2}}}}}\in ({\sqrt {2\pi }},e]}" data-class="mwe-math-fallback-image-inline mw-invert skin-invert"> </span></span> for all <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"> <math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle n\geq 1}"><semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi> n </mi> <mo> ≥<!-- ≥ --> </mo> <mn> 1 </mn> </mstyle> </mrow> <annotation encoding="application/x-tex"> {\displaystyle n\geq 1} </annotation> </semantics> </math></span> <noscript> <img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/d8ce9ce38d06f6bf5a3fe063118c09c2b6202bfe" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.505ex; width:5.656ex; height:2.343ex;" alt="{\displaystyle n\geq 1}"> </noscript><span class="lazy-image-placeholder" style="width: 5.656ex;height: 2.343ex;vertical-align: -0.505ex;" data-src="https://wikimedia.org/api/rest_v1/media/math/render/svg/d8ce9ce38d06f6bf5a3fe063118c09c2b6202bfe" data-alt="{\displaystyle n\geq 1}" data-class="mwe-math-fallback-image-inline mw-invert skin-invert"> </span></span>.</p> </section> <div class="mw-heading mw-heading2 section-heading" onclick="mfTempOpenSection(4)"> <span class="indicator mf-icon mf-icon-expand mf-icon--small"></span> <h2 id="Stirling's_formula_for_the_gamma_function"><span id="Stirling.27s_formula_for_the_gamma_function"></span>Stirling's formula for the gamma function</h2><span class="mw-editsection"> <a role="button" href="https://en-m-wikipedia-org.translate.goog/w/index.php?title=Stirling's_approximation&action=edit&section=6&_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-GB" title="Edit section: Stirling's formula for the gamma function" class="cdx-button cdx-button--size-large cdx-button--fake-button cdx-button--fake-button--enabled cdx-button--icon-only cdx-button--weight-quiet "> <span class="minerva-icon minerva-icon--edit"></span> <span>edit</span> </a> </span> </div> <section class="mf-section-4 collapsible-block" id="mf-section-4"> <p>For all positive integers, <span class="mwe-math-element"><span class="mwe-math-mathml-display mwe-math-mathml-a11y" style="display: none;"> <math display="block" xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle n!=\Gamma (n+1),}"><semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi> n </mi> <mo> ! </mo> <mo> = </mo> <mi mathvariant="normal"> Γ<!-- Γ --> </mi> <mo stretchy="false"> ( </mo> <mi> n </mi> <mo> + </mo> <mn> 1 </mn> <mo stretchy="false"> ) </mo> <mo> , </mo> </mstyle> </mrow> <annotation encoding="application/x-tex"> {\displaystyle n!=\Gamma (n+1),} </annotation> </semantics> </math></span> <noscript> <img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/07589a814a57c666e6403264017e580514e75bc3" class="mwe-math-fallback-image-display mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:14.447ex; height:2.843ex;" alt="{\displaystyle n!=\Gamma (n+1),}"> </noscript><span class="lazy-image-placeholder" style="width: 14.447ex;height: 2.843ex;vertical-align: -0.838ex;" data-src="https://wikimedia.org/api/rest_v1/media/math/render/svg/07589a814a57c666e6403264017e580514e75bc3" data-alt="{\displaystyle n!=\Gamma (n+1),}" data-class="mwe-math-fallback-image-display mw-invert skin-invert"> </span></span> where <span class="texhtml">Γ</span> denotes the <a href="https://en-m-wikipedia-org.translate.goog/wiki/Gamma_function?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-GB" title="Gamma function">gamma function</a>.</p> <p>However, the gamma function, unlike the factorial, is more broadly defined for all complex numbers other than non-positive integers; nevertheless, Stirling's formula may still be applied. If <span class="texhtml">Re(<i>z</i>) > 0</span>, then <span class="mwe-math-element"><span class="mwe-math-mathml-display mwe-math-mathml-a11y" style="display: none;"> <math display="block" xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \ln \Gamma (z)=z\ln z-z+{\tfrac {1}{2}}\ln {\frac {2\pi }{z}}+\int _{0}^{\infty }{\frac {2\arctan \left({\frac {t}{z}}\right)}{e^{2\pi t}-1}}\,{\rm {d}}t.}"><semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi> ln </mi> <mo> <!-- --> </mo> <mi mathvariant="normal"> Γ<!-- Γ --> </mi> <mo stretchy="false"> ( </mo> <mi> z </mi> <mo stretchy="false"> ) </mo> <mo> = </mo> <mi> z </mi> <mi> ln </mi> <mo> <!-- --> </mo> <mi> z </mi> <mo> −<!-- − --> </mo> <mi> z </mi> <mo> + </mo> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="false" scriptlevel="0"> <mfrac> <mn> 1 </mn> <mn> 2 </mn> </mfrac> </mstyle> </mrow> <mi> ln </mi> <mo> <!-- --> </mo> <mrow class="MJX-TeXAtom-ORD"> <mfrac> <mrow> <mn> 2 </mn> <mi> π<!-- π --> </mi> </mrow> <mi> z </mi> </mfrac> </mrow> <mo> + </mo> <msubsup> <mo> ∫<!-- ∫ --> </mo> <mrow class="MJX-TeXAtom-ORD"> <mn> 0 </mn> </mrow> <mrow class="MJX-TeXAtom-ORD"> <mi mathvariant="normal"> ∞<!-- ∞ --> </mi> </mrow> </msubsup> <mrow class="MJX-TeXAtom-ORD"> <mfrac> <mrow> <mn> 2 </mn> <mi> arctan </mi> <mo> <!-- --> </mo> <mrow> <mo> ( </mo> <mrow class="MJX-TeXAtom-ORD"> <mfrac> <mi> t </mi> <mi> z </mi> </mfrac> </mrow> <mo> ) </mo> </mrow> </mrow> <mrow> <msup> <mi> e </mi> <mrow class="MJX-TeXAtom-ORD"> <mn> 2 </mn> <mi> π<!-- π --> </mi> <mi> t </mi> </mrow> </msup> <mo> −<!-- − --> </mo> <mn> 1 </mn> </mrow> </mfrac> </mrow> <mspace width="thinmathspace"></mspace> <mrow class="MJX-TeXAtom-ORD"> <mrow class="MJX-TeXAtom-ORD"> <mi mathvariant="normal"> d </mi> </mrow> </mrow> <mi> t </mi> <mo> . </mo> </mstyle> </mrow> <annotation encoding="application/x-tex"> {\displaystyle \ln \Gamma (z)=z\ln z-z+{\tfrac {1}{2}}\ln {\frac {2\pi }{z}}+\int _{0}^{\infty }{\frac {2\arctan \left({\frac {t}{z}}\right)}{e^{2\pi t}-1}}\,{\rm {d}}t.} </annotation> </semantics> </math></span> <noscript> <img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/c398a644d2ccc7ffaf82be5478403b9a5baea09b" class="mwe-math-fallback-image-display mw-invert skin-invert" aria-hidden="true" style="vertical-align: -2.338ex; width:52.456ex; height:6.676ex;" alt="{\displaystyle \ln \Gamma (z)=z\ln z-z+{\tfrac {1}{2}}\ln {\frac {2\pi }{z}}+\int _{0}^{\infty }{\frac {2\arctan \left({\frac {t}{z}}\right)}{e^{2\pi t}-1}}\,{\rm {d}}t.}"> </noscript><span class="lazy-image-placeholder" style="width: 52.456ex;height: 6.676ex;vertical-align: -2.338ex;" data-src="https://wikimedia.org/api/rest_v1/media/math/render/svg/c398a644d2ccc7ffaf82be5478403b9a5baea09b" data-alt="{\displaystyle \ln \Gamma (z)=z\ln z-z+{\tfrac {1}{2}}\ln {\frac {2\pi }{z}}+\int _{0}^{\infty }{\frac {2\arctan \left({\frac {t}{z}}\right)}{e^{2\pi t}-1}}\,{\rm {d}}t.}" data-class="mwe-math-fallback-image-display mw-invert skin-invert"> </span></span></p> <p>Repeated integration by parts gives <span class="mwe-math-element"><span class="mwe-math-mathml-display mwe-math-mathml-a11y" style="display: none;"> <math display="block" xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \ln \Gamma (z)\sim z\ln z-z+{\tfrac {1}{2}}\ln {\frac {2\pi }{z}}+\sum _{n=1}^{N-1}{\frac {B_{2n}}{2n(2n-1)z^{2n-1}}},}"><semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi> ln </mi> <mo> <!-- --> </mo> <mi mathvariant="normal"> Γ<!-- Γ --> </mi> <mo stretchy="false"> ( </mo> <mi> z </mi> <mo stretchy="false"> ) </mo> <mo> ∼<!-- ∼ --> </mo> <mi> z </mi> <mi> ln </mi> <mo> <!-- --> </mo> <mi> z </mi> <mo> −<!-- − --> </mo> <mi> z </mi> <mo> + </mo> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="false" scriptlevel="0"> <mfrac> <mn> 1 </mn> <mn> 2 </mn> </mfrac> </mstyle> </mrow> <mi> ln </mi> <mo> <!-- --> </mo> <mrow class="MJX-TeXAtom-ORD"> <mfrac> <mrow> <mn> 2 </mn> <mi> π<!-- π --> </mi> </mrow> <mi> z </mi> </mfrac> </mrow> <mo> + </mo> <munderover> <mo> ∑<!-- ∑ --> </mo> <mrow class="MJX-TeXAtom-ORD"> <mi> n </mi> <mo> = </mo> <mn> 1 </mn> </mrow> <mrow class="MJX-TeXAtom-ORD"> <mi> N </mi> <mo> −<!-- − --> </mo> <mn> 1 </mn> </mrow> </munderover> <mrow class="MJX-TeXAtom-ORD"> <mfrac> <msub> <mi> B </mi> <mrow class="MJX-TeXAtom-ORD"> <mn> 2 </mn> <mi> n </mi> </mrow> </msub> <mrow> <mn> 2 </mn> <mi> n </mi> <mo stretchy="false"> ( </mo> <mn> 2 </mn> <mi> n </mi> <mo> −<!-- − --> </mo> <mn> 1 </mn> <mo stretchy="false"> ) </mo> <msup> <mi> z </mi> <mrow class="MJX-TeXAtom-ORD"> <mn> 2 </mn> <mi> n </mi> <mo> −<!-- − --> </mo> <mn> 1 </mn> </mrow> </msup> </mrow> </mfrac> </mrow> <mo> , </mo> </mstyle> </mrow> <annotation encoding="application/x-tex"> {\displaystyle \ln \Gamma (z)\sim z\ln z-z+{\tfrac {1}{2}}\ln {\frac {2\pi }{z}}+\sum _{n=1}^{N-1}{\frac {B_{2n}}{2n(2n-1)z^{2n-1}}},} </annotation> </semantics> </math></span> <noscript> <img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/8d257681480aa1bed0237cb9239f1f722a1786e7" class="mwe-math-fallback-image-display mw-invert skin-invert" aria-hidden="true" style="vertical-align: -3.005ex; width:53.564ex; height:7.343ex;" alt="{\displaystyle \ln \Gamma (z)\sim z\ln z-z+{\tfrac {1}{2}}\ln {\frac {2\pi }{z}}+\sum _{n=1}^{N-1}{\frac {B_{2n}}{2n(2n-1)z^{2n-1}}},}"> </noscript><span class="lazy-image-placeholder" style="width: 53.564ex;height: 7.343ex;vertical-align: -3.005ex;" data-src="https://wikimedia.org/api/rest_v1/media/math/render/svg/8d257681480aa1bed0237cb9239f1f722a1786e7" data-alt="{\displaystyle \ln \Gamma (z)\sim z\ln z-z+{\tfrac {1}{2}}\ln {\frac {2\pi }{z}}+\sum _{n=1}^{N-1}{\frac {B_{2n}}{2n(2n-1)z^{2n-1}}},}" data-class="mwe-math-fallback-image-display mw-invert skin-invert"> </span></span></p> <p>where <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"> <math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle B_{n}}"><semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <msub> <mi> B </mi> <mrow class="MJX-TeXAtom-ORD"> <mi> n </mi> </mrow> </msub> </mstyle> </mrow> <annotation encoding="application/x-tex"> {\displaystyle B_{n}} </annotation> </semantics> </math></span> <noscript> <img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/2f568bf6d34e97b9fdda0dc7e276d6c4501d2045" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.671ex; width:2.982ex; height:2.509ex;" alt="{\displaystyle B_{n}}"> </noscript><span class="lazy-image-placeholder" style="width: 2.982ex;height: 2.509ex;vertical-align: -0.671ex;" data-src="https://wikimedia.org/api/rest_v1/media/math/render/svg/2f568bf6d34e97b9fdda0dc7e276d6c4501d2045" data-alt="{\displaystyle B_{n}}" data-class="mwe-math-fallback-image-inline mw-invert skin-invert"> </span></span> is the <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"> <math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle n}"><semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi> n </mi> </mstyle> </mrow> <annotation encoding="application/x-tex"> {\displaystyle n} </annotation> </semantics> </math></span> <noscript> <img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/a601995d55609f2d9f5e233e36fbe9ea26011b3b" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:1.395ex; height:1.676ex;" alt="{\displaystyle n}"> </noscript><span class="lazy-image-placeholder" style="width: 1.395ex;height: 1.676ex;vertical-align: -0.338ex;" data-src="https://wikimedia.org/api/rest_v1/media/math/render/svg/a601995d55609f2d9f5e233e36fbe9ea26011b3b" data-alt="{\displaystyle n}" data-class="mwe-math-fallback-image-inline mw-invert skin-invert"> </span></span>th <a href="https://en-m-wikipedia-org.translate.goog/wiki/Bernoulli_number?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-GB" title="Bernoulli number">Bernoulli number</a> (note that the limit of the sum as <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"> <math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle N\to \infty }"><semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi> N </mi> <mo stretchy="false"> →<!-- → --> </mo> <mi mathvariant="normal"> ∞<!-- ∞ --> </mi> </mstyle> </mrow> <annotation encoding="application/x-tex"> {\displaystyle N\to \infty } </annotation> </semantics> </math></span> <noscript> <img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/e23159ea0d291e21c5709a6dd7486bed7f18febe" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:8.001ex; height:2.176ex;" alt="{\displaystyle N\to \infty }"> </noscript><span class="lazy-image-placeholder" style="width: 8.001ex;height: 2.176ex;vertical-align: -0.338ex;" data-src="https://wikimedia.org/api/rest_v1/media/math/render/svg/e23159ea0d291e21c5709a6dd7486bed7f18febe" data-alt="{\displaystyle N\to \infty }" data-class="mwe-math-fallback-image-inline mw-invert skin-invert"> </span></span> is not convergent, so this formula is just an <a href="https://en-m-wikipedia-org.translate.goog/wiki/Asymptotic_expansion?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-GB" title="Asymptotic expansion">asymptotic expansion</a>). The formula is valid for <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"> <math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle z}"><semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi> z </mi> </mstyle> </mrow> <annotation encoding="application/x-tex"> {\displaystyle z} </annotation> </semantics> </math></span> <noscript> <img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/bf368e72c009decd9b6686ee84a375632e11de98" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:1.088ex; height:1.676ex;" alt="{\displaystyle z}"> </noscript><span class="lazy-image-placeholder" style="width: 1.088ex;height: 1.676ex;vertical-align: -0.338ex;" data-src="https://wikimedia.org/api/rest_v1/media/math/render/svg/bf368e72c009decd9b6686ee84a375632e11de98" data-alt="{\displaystyle z}" data-class="mwe-math-fallback-image-inline mw-invert skin-invert"> </span></span> large enough in absolute value, when <span class="texhtml">|<span class="nowrap" style="padding-left:0.1em; padding-right:0.1em;">arg(<i>z</i>)</span>| < π − <i>ε</i></span>, where <span class="texhtml mvar" style="font-style:italic;">ε</span> is positive, with an error term of <span class="texhtml"><i>O</i>(<i>z</i><sup>−2<i>N</i>+ 1</sup>)</span>. The corresponding approximation may now be written: <span class="mwe-math-element"><span class="mwe-math-mathml-display mwe-math-mathml-a11y" style="display: none;"> <math display="block" xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \Gamma (z)={\sqrt {\frac {2\pi }{z}}}\,{\left({\frac {z}{e}}\right)}^{z}\left(1+O\left({\frac {1}{z}}\right)\right).}"><semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi mathvariant="normal"> Γ<!-- Γ --> </mi> <mo stretchy="false"> ( </mo> <mi> z </mi> <mo stretchy="false"> ) </mo> <mo> = </mo> <mrow class="MJX-TeXAtom-ORD"> <msqrt> <mfrac> <mrow> <mn> 2 </mn> <mi> π<!-- π --> </mi> </mrow> <mi> z </mi> </mfrac> </msqrt> </mrow> <mspace width="thinmathspace"></mspace> <msup> <mrow class="MJX-TeXAtom-ORD"> <mrow> <mo> ( </mo> <mrow class="MJX-TeXAtom-ORD"> <mfrac> <mi> z </mi> <mi> e </mi> </mfrac> </mrow> <mo> ) </mo> </mrow> </mrow> <mrow class="MJX-TeXAtom-ORD"> <mi> z </mi> </mrow> </msup> <mrow> <mo> ( </mo> <mrow> <mn> 1 </mn> <mo> + </mo> <mi> O </mi> <mrow> <mo> ( </mo> <mrow class="MJX-TeXAtom-ORD"> <mfrac> <mn> 1 </mn> <mi> z </mi> </mfrac> </mrow> <mo> ) </mo> </mrow> </mrow> <mo> ) </mo> </mrow> <mo> . </mo> </mstyle> </mrow> <annotation encoding="application/x-tex"> {\displaystyle \Gamma (z)={\sqrt {\frac {2\pi }{z}}}\,{\left({\frac {z}{e}}\right)}^{z}\left(1+O\left({\frac {1}{z}}\right)\right).} </annotation> </semantics> </math></span> <noscript> <img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/5ed4a7a21192f91f42e90e0f2dbc5cbc851a089a" class="mwe-math-fallback-image-display mw-invert skin-invert" aria-hidden="true" style="vertical-align: -2.505ex; width:35.617ex; height:6.343ex;" alt="{\displaystyle \Gamma (z)={\sqrt {\frac {2\pi }{z}}}\,{\left({\frac {z}{e}}\right)}^{z}\left(1+O\left({\frac {1}{z}}\right)\right).}"> </noscript><span class="lazy-image-placeholder" style="width: 35.617ex;height: 6.343ex;vertical-align: -2.505ex;" data-src="https://wikimedia.org/api/rest_v1/media/math/render/svg/5ed4a7a21192f91f42e90e0f2dbc5cbc851a089a" data-alt="{\displaystyle \Gamma (z)={\sqrt {\frac {2\pi }{z}}}\,{\left({\frac {z}{e}}\right)}^{z}\left(1+O\left({\frac {1}{z}}\right)\right).}" data-class="mwe-math-fallback-image-display mw-invert skin-invert"> </span></span></p> <p>where the expansion is identical to that of Stirling's series above for <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"> <math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle n!}"><semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi> n </mi> <mo> ! </mo> </mstyle> </mrow> <annotation encoding="application/x-tex"> {\displaystyle n!} </annotation> </semantics> </math></span> <noscript> <img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/bae971720be3cc9b8d82f4cdac89cb89877514a6" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:2.042ex; height:2.176ex;" alt="{\displaystyle n!}"> </noscript><span class="lazy-image-placeholder" style="width: 2.042ex;height: 2.176ex;vertical-align: -0.338ex;" data-src="https://wikimedia.org/api/rest_v1/media/math/render/svg/bae971720be3cc9b8d82f4cdac89cb89877514a6" data-alt="{\displaystyle n!}" data-class="mwe-math-fallback-image-inline mw-invert skin-invert"> </span></span>, except that <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"> <math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle n}"><semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi> n </mi> </mstyle> </mrow> <annotation encoding="application/x-tex"> {\displaystyle n} </annotation> </semantics> </math></span> <noscript> <img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/a601995d55609f2d9f5e233e36fbe9ea26011b3b" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:1.395ex; height:1.676ex;" alt="{\displaystyle n}"> </noscript><span class="lazy-image-placeholder" style="width: 1.395ex;height: 1.676ex;vertical-align: -0.338ex;" data-src="https://wikimedia.org/api/rest_v1/media/math/render/svg/a601995d55609f2d9f5e233e36fbe9ea26011b3b" data-alt="{\displaystyle n}" data-class="mwe-math-fallback-image-inline mw-invert skin-invert"> </span></span> is replaced with <span class="texhtml"><i>z</i> − 1</span>.<sup id="cite_ref-spiegel_10-0" class="reference"><a href="https://en-m-wikipedia-org.translate.goog/wiki/Stirling's_approximation?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-GB#cite_note-spiegel-10"><span class="cite-bracket">[</span>9<span class="cite-bracket">]</span></a></sup></p> <p>A further application of this asymptotic expansion is for complex argument <span class="texhtml mvar" style="font-style:italic;">z</span> with constant <span class="texhtml">Re(<i>z</i>)</span>. See for example the Stirling formula applied in <span class="texhtml">Im(<i>z</i>) = <i>t</i></span> of the <a href="https://en-m-wikipedia-org.translate.goog/wiki/Riemann%E2%80%93Siegel_theta_function?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-GB" title="Riemann–Siegel theta function">Riemann–Siegel theta function</a> on the straight line <span class="texhtml"><style data-mw-deduplicate="TemplateStyles:r1214402035">.mw-parser-output .sfrac{white-space:nowrap}.mw-parser-output .sfrac.tion,.mw-parser-output .sfrac .tion{display:inline-block;vertical-align:-0.5em;font-size:85%;text-align:center}.mw-parser-output .sfrac .num{display:block;line-height:1em;margin:0.0em 0.1em;border-bottom:1px solid}.mw-parser-output .sfrac .den{display:block;line-height:1em;margin:0.1em 0.1em}.mw-parser-output .sr-only{border:0;clip:rect(0,0,0,0);clip-path:polygon(0px 0px,0px 0px,0px 0px);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}</style><span class="sfrac"><span class="tion"><span class="num">1</span><span class="sr-only">/</span><span class="den">4</span></span></span> + <i>it</i></span>.</p> </section> <div class="mw-heading mw-heading2 section-heading" onclick="mfTempOpenSection(5)"> <span class="indicator mf-icon mf-icon-expand mf-icon--small"></span> <h2 id="Error_bounds">Error bounds</h2><span class="mw-editsection"> <a role="button" href="https://en-m-wikipedia-org.translate.goog/w/index.php?title=Stirling's_approximation&action=edit&section=7&_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-GB" title="Edit section: Error bounds" class="cdx-button cdx-button--size-large cdx-button--fake-button cdx-button--fake-button--enabled cdx-button--icon-only cdx-button--weight-quiet "> <span class="minerva-icon minerva-icon--edit"></span> <span>edit</span> </a> </span> </div> <section class="mf-section-5 collapsible-block" id="mf-section-5"> <p>For any positive integer <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"> <math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle N}"><semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi> N </mi> </mstyle> </mrow> <annotation encoding="application/x-tex"> {\displaystyle N} </annotation> </semantics> </math></span> <noscript> <img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/f5e3890c981ae85503089652feb48b191b57aae3" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:2.064ex; height:2.176ex;" alt="{\displaystyle N}"> </noscript><span class="lazy-image-placeholder" style="width: 2.064ex;height: 2.176ex;vertical-align: -0.338ex;" data-src="https://wikimedia.org/api/rest_v1/media/math/render/svg/f5e3890c981ae85503089652feb48b191b57aae3" data-alt="{\displaystyle N}" data-class="mwe-math-fallback-image-inline mw-invert skin-invert"> </span></span>, the following notation is introduced: <span class="mwe-math-element"><span class="mwe-math-mathml-display mwe-math-mathml-a11y" style="display: none;"> <math display="block" xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \ln \Gamma (z)=z\ln z-z+{\tfrac {1}{2}}\ln {\frac {2\pi }{z}}+\sum \limits _{n=1}^{N-1}{\frac {B_{2n}}{2n\left({2n-1}\right)z^{2n-1}}}+R_{N}(z)}"><semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi> ln </mi> <mo> <!-- --> </mo> <mi mathvariant="normal"> Γ<!-- Γ --> </mi> <mo stretchy="false"> ( </mo> <mi> z </mi> <mo stretchy="false"> ) </mo> <mo> = </mo> <mi> z </mi> <mi> ln </mi> <mo> <!-- --> </mo> <mi> z </mi> <mo> −<!-- − --> </mo> <mi> z </mi> <mo> + </mo> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="false" scriptlevel="0"> <mfrac> <mn> 1 </mn> <mn> 2 </mn> </mfrac> </mstyle> </mrow> <mi> ln </mi> <mo> <!-- --> </mo> <mrow class="MJX-TeXAtom-ORD"> <mfrac> <mrow> <mn> 2 </mn> <mi> π<!-- π --> </mi> </mrow> <mi> z </mi> </mfrac> </mrow> <mo> + </mo> <munderover> <mo movablelimits="false"> ∑<!-- ∑ --> </mo> <mrow class="MJX-TeXAtom-ORD"> <mi> n </mi> <mo> = </mo> <mn> 1 </mn> </mrow> <mrow class="MJX-TeXAtom-ORD"> <mi> N </mi> <mo> −<!-- − --> </mo> <mn> 1 </mn> </mrow> </munderover> <mrow class="MJX-TeXAtom-ORD"> <mfrac> <msub> <mi> B </mi> <mrow class="MJX-TeXAtom-ORD"> <mn> 2 </mn> <mi> n </mi> </mrow> </msub> <mrow> <mn> 2 </mn> <mi> n </mi> <mrow> <mo> ( </mo> <mrow class="MJX-TeXAtom-ORD"> <mn> 2 </mn> <mi> n </mi> <mo> −<!-- − --> </mo> <mn> 1 </mn> </mrow> <mo> ) </mo> </mrow> <msup> <mi> z </mi> <mrow class="MJX-TeXAtom-ORD"> <mn> 2 </mn> <mi> n </mi> <mo> −<!-- − --> </mo> <mn> 1 </mn> </mrow> </msup> </mrow> </mfrac> </mrow> <mo> + </mo> <msub> <mi> R </mi> <mrow class="MJX-TeXAtom-ORD"> <mi> N </mi> </mrow> </msub> <mo stretchy="false"> ( </mo> <mi> z </mi> <mo stretchy="false"> ) </mo> </mstyle> </mrow> <annotation encoding="application/x-tex"> {\displaystyle \ln \Gamma (z)=z\ln z-z+{\tfrac {1}{2}}\ln {\frac {2\pi }{z}}+\sum \limits _{n=1}^{N-1}{\frac {B_{2n}}{2n\left({2n-1}\right)z^{2n-1}}}+R_{N}(z)} </annotation> </semantics> </math></span> <noscript> <img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/19a5d992f27054d73eb99a5ab9d9f15acfbec0a3" class="mwe-math-fallback-image-display mw-invert skin-invert" aria-hidden="true" style="vertical-align: -3.005ex; width:62.885ex; height:7.343ex;" alt="{\displaystyle \ln \Gamma (z)=z\ln z-z+{\tfrac {1}{2}}\ln {\frac {2\pi }{z}}+\sum \limits _{n=1}^{N-1}{\frac {B_{2n}}{2n\left({2n-1}\right)z^{2n-1}}}+R_{N}(z)}"> </noscript><span class="lazy-image-placeholder" style="width: 62.885ex;height: 7.343ex;vertical-align: -3.005ex;" data-src="https://wikimedia.org/api/rest_v1/media/math/render/svg/19a5d992f27054d73eb99a5ab9d9f15acfbec0a3" data-alt="{\displaystyle \ln \Gamma (z)=z\ln z-z+{\tfrac {1}{2}}\ln {\frac {2\pi }{z}}+\sum \limits _{n=1}^{N-1}{\frac {B_{2n}}{2n\left({2n-1}\right)z^{2n-1}}}+R_{N}(z)}" data-class="mwe-math-fallback-image-display mw-invert skin-invert"> </span></span> and <span class="mwe-math-element"><span class="mwe-math-mathml-display mwe-math-mathml-a11y" style="display: none;"> <math display="block" xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \Gamma (z)={\sqrt {\frac {2\pi }{z}}}\left({\frac {z}{e}}\right)^{z}\left({\sum \limits _{n=0}^{N-1}{\frac {a_{n}}{z^{n}}}+{\widetilde {R}}_{N}(z)}\right).}"><semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi mathvariant="normal"> Γ<!-- Γ --> </mi> <mo stretchy="false"> ( </mo> <mi> z </mi> <mo stretchy="false"> ) </mo> <mo> = </mo> <mrow class="MJX-TeXAtom-ORD"> <msqrt> <mfrac> <mrow> <mn> 2 </mn> <mi> π<!-- π --> </mi> </mrow> <mi> z </mi> </mfrac> </msqrt> </mrow> <msup> <mrow> <mo> ( </mo> <mrow class="MJX-TeXAtom-ORD"> <mfrac> <mi> z </mi> <mi> e </mi> </mfrac> </mrow> <mo> ) </mo> </mrow> <mrow class="MJX-TeXAtom-ORD"> <mi> z </mi> </mrow> </msup> <mrow> <mo> ( </mo> <mrow class="MJX-TeXAtom-ORD"> <munderover> <mo movablelimits="false"> ∑<!-- ∑ --> </mo> <mrow class="MJX-TeXAtom-ORD"> <mi> n </mi> <mo> = </mo> <mn> 0 </mn> </mrow> <mrow class="MJX-TeXAtom-ORD"> <mi> N </mi> <mo> −<!-- − --> </mo> <mn> 1 </mn> </mrow> </munderover> <mrow class="MJX-TeXAtom-ORD"> <mfrac> <msub> <mi> a </mi> <mrow class="MJX-TeXAtom-ORD"> <mi> n </mi> </mrow> </msub> <msup> <mi> z </mi> <mrow class="MJX-TeXAtom-ORD"> <mi> n </mi> </mrow> </msup> </mfrac> </mrow> <mo> + </mo> <msub> <mrow class="MJX-TeXAtom-ORD"> <mrow class="MJX-TeXAtom-ORD"> <mover> <mi> R </mi> <mo> ~<!-- ~ --> </mo> </mover> </mrow> </mrow> <mrow class="MJX-TeXAtom-ORD"> <mi> N </mi> </mrow> </msub> <mo stretchy="false"> ( </mo> <mi> z </mi> <mo stretchy="false"> ) </mo> </mrow> <mo> ) </mo> </mrow> <mo> . </mo> </mstyle> </mrow> <annotation encoding="application/x-tex"> {\displaystyle \Gamma (z)={\sqrt {\frac {2\pi }{z}}}\left({\frac {z}{e}}\right)^{z}\left({\sum \limits _{n=0}^{N-1}{\frac {a_{n}}{z^{n}}}+{\widetilde {R}}_{N}(z)}\right).} </annotation> </semantics> </math></span> <noscript> <img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/56d62236ddd9cbfabb820fba18895c77655c433b" class="mwe-math-fallback-image-display mw-invert skin-invert" aria-hidden="true" style="vertical-align: -3.171ex; width:40.331ex; height:7.509ex;" alt="{\displaystyle \Gamma (z)={\sqrt {\frac {2\pi }{z}}}\left({\frac {z}{e}}\right)^{z}\left({\sum \limits _{n=0}^{N-1}{\frac {a_{n}}{z^{n}}}+{\widetilde {R}}_{N}(z)}\right).}"> </noscript><span class="lazy-image-placeholder" style="width: 40.331ex;height: 7.509ex;vertical-align: -3.171ex;" data-src="https://wikimedia.org/api/rest_v1/media/math/render/svg/56d62236ddd9cbfabb820fba18895c77655c433b" data-alt="{\displaystyle \Gamma (z)={\sqrt {\frac {2\pi }{z}}}\left({\frac {z}{e}}\right)^{z}\left({\sum \limits _{n=0}^{N-1}{\frac {a_{n}}{z^{n}}}+{\widetilde {R}}_{N}(z)}\right).}" data-class="mwe-math-fallback-image-display mw-invert skin-invert"> </span></span></p> <p>Then<sup id="cite_ref-schafke-sattler_11-0" class="reference"><a href="https://en-m-wikipedia-org.translate.goog/wiki/Stirling's_approximation?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-GB#cite_note-schafke-sattler-11"><span class="cite-bracket">[</span>10<span class="cite-bracket">]</span></a></sup><sup id="cite_ref-nemes15_12-0" class="reference"><a href="https://en-m-wikipedia-org.translate.goog/wiki/Stirling's_approximation?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-GB#cite_note-nemes15-12"><span class="cite-bracket">[</span>11<span class="cite-bracket">]</span></a></sup> <span class="mwe-math-element"><span class="mwe-math-mathml-display mwe-math-mathml-a11y" style="display: none;"> <math display="block" xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle {\begin{aligned}|R_{N}(z)|&\leq {\frac {|B_{2N}|}{2N(2N-1)|z|^{2N-1}}}\times {\begin{cases}1&{\text{ if }}\left|\arg z\right|\leq {\frac {\pi }{4}},\\\left|\csc(\arg z)\right|&{\text{ if }}{\frac {\pi }{4}}<\left|\arg z\right|<{\frac {\pi }{2}},\\\sec ^{2N}\left({\tfrac {\arg z}{2}}\right)&{\text{ if }}\left|\arg z\right|<\pi ,\end{cases}}\\[6pt]\left|{\widetilde {R}}_{N}(z)\right|&\leq \left({\frac {\left|a_{N}\right|}{|z|^{N}}}+{\frac {\left|a_{N+1}\right|}{|z|^{N+1}}}\right)\times {\begin{cases}1&{\text{ if }}\left|\arg z\right|\leq {\frac {\pi }{4}},\\\left|\csc(2\arg z)\right|&{\text{ if }}{\frac {\pi }{4}}<\left|\arg z\right|<{\frac {\pi }{2}}.\end{cases}}\end{aligned}}}"><semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mrow class="MJX-TeXAtom-ORD"> <mtable columnalign="right left right left right left right left right left right left" rowspacing="0.9em 0.3em" columnspacing="0em 2em 0em 2em 0em 2em 0em 2em 0em 2em 0em" displaystyle="true"> <mtr> <mtd> <mrow class="MJX-TeXAtom-ORD"> <mo stretchy="false"> | </mo> </mrow> <msub> <mi> R </mi> <mrow class="MJX-TeXAtom-ORD"> <mi> N </mi> </mrow> </msub> <mo stretchy="false"> ( </mo> <mi> z </mi> <mo stretchy="false"> ) </mo> <mrow class="MJX-TeXAtom-ORD"> <mo stretchy="false"> | </mo> </mrow> </mtd> <mtd> <mi></mi> <mo> ≤<!-- ≤ --> </mo> <mrow class="MJX-TeXAtom-ORD"> <mfrac> <mrow> <mrow class="MJX-TeXAtom-ORD"> <mo stretchy="false"> | </mo> </mrow> <msub> <mi> B </mi> <mrow class="MJX-TeXAtom-ORD"> <mn> 2 </mn> <mi> N </mi> </mrow> </msub> <mrow class="MJX-TeXAtom-ORD"> <mo stretchy="false"> | </mo> </mrow> </mrow> <mrow> <mn> 2 </mn> <mi> N </mi> <mo stretchy="false"> ( </mo> <mn> 2 </mn> <mi> N </mi> <mo> −<!-- − --> </mo> <mn> 1 </mn> <mo stretchy="false"> ) </mo> <mrow class="MJX-TeXAtom-ORD"> <mo stretchy="false"> | </mo> </mrow> <mi> z </mi> <msup> <mrow class="MJX-TeXAtom-ORD"> <mo stretchy="false"> | </mo> </mrow> <mrow class="MJX-TeXAtom-ORD"> <mn> 2 </mn> <mi> N </mi> <mo> −<!-- − --> </mo> <mn> 1 </mn> </mrow> </msup> </mrow> </mfrac> </mrow> <mo> ×<!-- × --> </mo> <mrow class="MJX-TeXAtom-ORD"> <mrow> <mo> { </mo> <mtable columnalign="left left" rowspacing=".2em" columnspacing="1em" displaystyle="false"> <mtr> <mtd> <mn> 1 </mn> </mtd> <mtd> <mrow class="MJX-TeXAtom-ORD"> <mtext> if </mtext> </mrow> <mrow> <mo> | </mo> <mrow> <mi> arg </mi> <mo> <!-- --> </mo> <mi> z </mi> </mrow> <mo> | </mo> </mrow> <mo> ≤<!-- ≤ --> </mo> <mrow class="MJX-TeXAtom-ORD"> <mfrac> <mi> π<!-- π --> </mi> <mn> 4 </mn> </mfrac> </mrow> <mo> , </mo> </mtd> </mtr> <mtr> <mtd> <mrow> <mo> | </mo> <mrow> <mi> csc </mi> <mo> <!-- --> </mo> <mo stretchy="false"> ( </mo> <mi> arg </mi> <mo> <!-- --> </mo> <mi> z </mi> <mo stretchy="false"> ) </mo> </mrow> <mo> | </mo> </mrow> </mtd> <mtd> <mrow class="MJX-TeXAtom-ORD"> <mtext> if </mtext> </mrow> <mrow class="MJX-TeXAtom-ORD"> <mfrac> <mi> π<!-- π --> </mi> <mn> 4 </mn> </mfrac> </mrow> <mo> < </mo> <mrow> <mo> | </mo> <mrow> <mi> arg </mi> <mo> <!-- --> </mo> <mi> z </mi> </mrow> <mo> | </mo> </mrow> <mo> < </mo> <mrow class="MJX-TeXAtom-ORD"> <mfrac> <mi> π<!-- π --> </mi> <mn> 2 </mn> </mfrac> </mrow> <mo> , </mo> </mtd> </mtr> <mtr> <mtd> <msup> <mi> sec </mi> <mrow class="MJX-TeXAtom-ORD"> <mn> 2 </mn> <mi> N </mi> </mrow> </msup> <mo> <!-- --> </mo> <mrow> <mo> ( </mo> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="false" scriptlevel="0"> <mfrac> <mrow> <mi> arg </mi> <mo> <!-- --> </mo> <mi> z </mi> </mrow> <mn> 2 </mn> </mfrac> </mstyle> </mrow> <mo> ) </mo> </mrow> </mtd> <mtd> <mrow class="MJX-TeXAtom-ORD"> <mtext> if </mtext> </mrow> <mrow> <mo> | </mo> <mrow> <mi> arg </mi> <mo> <!-- --> </mo> <mi> z </mi> </mrow> <mo> | </mo> </mrow> <mo> < </mo> <mi> π<!-- π --> </mi> <mo> , </mo> </mtd> </mtr> </mtable> <mo fence="true" stretchy="true" symmetric="true"></mo> </mrow> </mrow> </mtd> </mtr> <mtr> <mtd> <mrow> <mo> | </mo> <mrow> <msub> <mrow class="MJX-TeXAtom-ORD"> <mrow class="MJX-TeXAtom-ORD"> <mover> <mi> R </mi> <mo> ~<!-- ~ --> </mo> </mover> </mrow> </mrow> <mrow class="MJX-TeXAtom-ORD"> <mi> N </mi> </mrow> </msub> <mo stretchy="false"> ( </mo> <mi> z </mi> <mo stretchy="false"> ) </mo> </mrow> <mo> | </mo> </mrow> </mtd> <mtd> <mi></mi> <mo> ≤<!-- ≤ --> </mo> <mrow> <mo> ( </mo> <mrow> <mrow class="MJX-TeXAtom-ORD"> <mfrac> <mrow> <mo> | </mo> <msub> <mi> a </mi> <mrow class="MJX-TeXAtom-ORD"> <mi> N </mi> </mrow> </msub> <mo> | </mo> </mrow> <mrow> <mrow class="MJX-TeXAtom-ORD"> <mo stretchy="false"> | </mo> </mrow> <mi> z </mi> <msup> <mrow class="MJX-TeXAtom-ORD"> <mo stretchy="false"> | </mo> </mrow> <mrow class="MJX-TeXAtom-ORD"> <mi> N </mi> </mrow> </msup> </mrow> </mfrac> </mrow> <mo> + </mo> <mrow class="MJX-TeXAtom-ORD"> <mfrac> <mrow> <mo> | </mo> <msub> <mi> a </mi> <mrow class="MJX-TeXAtom-ORD"> <mi> N </mi> <mo> + </mo> <mn> 1 </mn> </mrow> </msub> <mo> | </mo> </mrow> <mrow> <mrow class="MJX-TeXAtom-ORD"> <mo stretchy="false"> | </mo> </mrow> <mi> z </mi> <msup> <mrow class="MJX-TeXAtom-ORD"> <mo stretchy="false"> | </mo> </mrow> <mrow class="MJX-TeXAtom-ORD"> <mi> N </mi> <mo> + </mo> <mn> 1 </mn> </mrow> </msup> </mrow> </mfrac> </mrow> </mrow> <mo> ) </mo> </mrow> <mo> ×<!-- × --> </mo> <mrow class="MJX-TeXAtom-ORD"> <mrow> <mo> { </mo> <mtable columnalign="left left" rowspacing=".2em" columnspacing="1em" displaystyle="false"> <mtr> <mtd> <mn> 1 </mn> </mtd> <mtd> <mrow class="MJX-TeXAtom-ORD"> <mtext> if </mtext> </mrow> <mrow> <mo> | </mo> <mrow> <mi> arg </mi> <mo> <!-- --> </mo> <mi> z </mi> </mrow> <mo> | </mo> </mrow> <mo> ≤<!-- ≤ --> </mo> <mrow class="MJX-TeXAtom-ORD"> <mfrac> <mi> π<!-- π --> </mi> <mn> 4 </mn> </mfrac> </mrow> <mo> , </mo> </mtd> </mtr> <mtr> <mtd> <mrow> <mo> | </mo> <mrow> <mi> csc </mi> <mo> <!-- --> </mo> <mo stretchy="false"> ( </mo> <mn> 2 </mn> <mi> arg </mi> <mo> <!-- --> </mo> <mi> z </mi> <mo stretchy="false"> ) </mo> </mrow> <mo> | </mo> </mrow> </mtd> <mtd> <mrow class="MJX-TeXAtom-ORD"> <mtext> if </mtext> </mrow> <mrow class="MJX-TeXAtom-ORD"> <mfrac> <mi> π<!-- π --> </mi> <mn> 4 </mn> </mfrac> </mrow> <mo> < </mo> <mrow> <mo> | </mo> <mrow> <mi> arg </mi> <mo> <!-- --> </mo> <mi> z </mi> </mrow> <mo> | </mo> </mrow> <mo> < </mo> <mrow class="MJX-TeXAtom-ORD"> <mfrac> <mi> π<!-- π --> </mi> <mn> 2 </mn> </mfrac> </mrow> <mo> . </mo> </mtd> </mtr> </mtable> <mo fence="true" stretchy="true" symmetric="true"></mo> </mrow> </mrow> </mtd> </mtr> </mtable> </mrow> </mstyle> </mrow> <annotation encoding="application/x-tex"> {\displaystyle {\begin{aligned}|R_{N}(z)|&\leq {\frac {|B_{2N}|}{2N(2N-1)|z|^{2N-1}}}\times {\begin{cases}1&{\text{ if }}\left|\arg z\right|\leq {\frac {\pi }{4}},\\\left|\csc(\arg z)\right|&{\text{ if }}{\frac {\pi }{4}}<\left|\arg z\right|<{\frac {\pi }{2}},\\\sec ^{2N}\left({\tfrac {\arg z}{2}}\right)&{\text{ if }}\left|\arg z\right|<\pi ,\end{cases}}\\[6pt]\left|{\widetilde {R}}_{N}(z)\right|&\leq \left({\frac {\left|a_{N}\right|}{|z|^{N}}}+{\frac {\left|a_{N+1}\right|}{|z|^{N+1}}}\right)\times {\begin{cases}1&{\text{ if }}\left|\arg z\right|\leq {\frac {\pi }{4}},\\\left|\csc(2\arg z)\right|&{\text{ if }}{\frac {\pi }{4}}<\left|\arg z\right|<{\frac {\pi }{2}}.\end{cases}}\end{aligned}}} </annotation> </semantics> </math></span> <noscript> <img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/49a2ef6c072d31d6b521b5e9094485cb362a6e3a" class="mwe-math-fallback-image-display mw-invert skin-invert" aria-hidden="true" style="vertical-align: -9.005ex; width:70.404ex; height:19.176ex;" alt="{\displaystyle {\begin{aligned}|R_{N}(z)|&\leq {\frac {|B_{2N}|}{2N(2N-1)|z|^{2N-1}}}\times {\begin{cases}1&{\text{ if }}\left|\arg z\right|\leq {\frac {\pi }{4}},\\\left|\csc(\arg z)\right|&{\text{ if }}{\frac {\pi }{4}}<\left|\arg z\right|<{\frac {\pi }{2}},\\\sec ^{2N}\left({\tfrac {\arg z}{2}}\right)&{\text{ if }}\left|\arg z\right|<\pi ,\end{cases}}\\[6pt]\left|{\widetilde {R}}_{N}(z)\right|&\leq \left({\frac {\left|a_{N}\right|}{|z|^{N}}}+{\frac {\left|a_{N+1}\right|}{|z|^{N+1}}}\right)\times {\begin{cases}1&{\text{ if }}\left|\arg z\right|\leq {\frac {\pi }{4}},\\\left|\csc(2\arg z)\right|&{\text{ if }}{\frac {\pi }{4}}<\left|\arg z\right|<{\frac {\pi }{2}}.\end{cases}}\end{aligned}}}"> </noscript><span class="lazy-image-placeholder" style="width: 70.404ex;height: 19.176ex;vertical-align: -9.005ex;" data-src="https://wikimedia.org/api/rest_v1/media/math/render/svg/49a2ef6c072d31d6b521b5e9094485cb362a6e3a" data-alt="{\displaystyle {\begin{aligned}|R_{N}(z)|&\leq {\frac {|B_{2N}|}{2N(2N-1)|z|^{2N-1}}}\times {\begin{cases}1&{\text{ if }}\left|\arg z\right|\leq {\frac {\pi }{4}},\\\left|\csc(\arg z)\right|&{\text{ if }}{\frac {\pi }{4}}<\left|\arg z\right|<{\frac {\pi }{2}},\\\sec ^{2N}\left({\tfrac {\arg z}{2}}\right)&{\text{ if }}\left|\arg z\right|<\pi ,\end{cases}}\\[6pt]\left|{\widetilde {R}}_{N}(z)\right|&\leq \left({\frac {\left|a_{N}\right|}{|z|^{N}}}+{\frac {\left|a_{N+1}\right|}{|z|^{N+1}}}\right)\times {\begin{cases}1&{\text{ if }}\left|\arg z\right|\leq {\frac {\pi }{4}},\\\left|\csc(2\arg z)\right|&{\text{ if }}{\frac {\pi }{4}}<\left|\arg z\right|<{\frac {\pi }{2}}.\end{cases}}\end{aligned}}}" data-class="mwe-math-fallback-image-display mw-invert skin-invert"> </span></span></p> <p>For further information and other error bounds, see the cited papers.</p> </section> <div class="mw-heading mw-heading2 section-heading" onclick="mfTempOpenSection(6)"> <span class="indicator mf-icon mf-icon-expand mf-icon--small"></span> <h2 id="A_convergent_version_of_Stirling's_formula"><span id="A_convergent_version_of_Stirling.27s_formula"></span>A convergent version of Stirling's formula</h2><span class="mw-editsection"> <a role="button" href="https://en-m-wikipedia-org.translate.goog/w/index.php?title=Stirling's_approximation&action=edit&section=8&_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-GB" title="Edit section: A convergent version of Stirling's formula" class="cdx-button cdx-button--size-large cdx-button--fake-button cdx-button--fake-button--enabled cdx-button--icon-only cdx-button--weight-quiet "> <span class="minerva-icon minerva-icon--edit"></span> <span>edit</span> </a> </span> </div> <section class="mf-section-6 collapsible-block" id="mf-section-6"> <p><a href="https://en-m-wikipedia-org.translate.goog/wiki/Thomas_Bayes?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-GB" title="Thomas Bayes">Thomas Bayes</a> showed, in a letter to <a href="https://en-m-wikipedia-org.translate.goog/wiki/John_Canton?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-GB" title="John Canton">John Canton</a> published by the <a href="https://en-m-wikipedia-org.translate.goog/wiki/Royal_Society?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-GB" title="Royal Society">Royal Society</a> in 1763, that Stirling's formula did not give a <a href="https://en-m-wikipedia-org.translate.goog/wiki/Convergent_series?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-GB" title="Convergent series">convergent series</a>.<sup id="cite_ref-bayes-canton_13-0" class="reference"><a href="https://en-m-wikipedia-org.translate.goog/wiki/Stirling's_approximation?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-GB#cite_note-bayes-canton-13"><span class="cite-bracket">[</span>12<span class="cite-bracket">]</span></a></sup> Obtaining a convergent version of Stirling's formula entails evaluating <a href="https://en-m-wikipedia-org.translate.goog/wiki/Gamma_function?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-GB#Raabe's_formula" title="Gamma function">Binet's formula</a>: <span class="mwe-math-element"><span class="mwe-math-mathml-display mwe-math-mathml-a11y" style="display: none;"> <math display="block" xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \int _{0}^{\infty }{\frac {2\arctan \left({\frac {t}{x}}\right)}{e^{2\pi t}-1}}\,{\rm {d}}t=\ln \Gamma (x)-x\ln x+x-{\tfrac {1}{2}}\ln {\frac {2\pi }{x}}.}"><semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <msubsup> <mo> ∫<!-- ∫ --> </mo> <mrow class="MJX-TeXAtom-ORD"> <mn> 0 </mn> </mrow> <mrow class="MJX-TeXAtom-ORD"> <mi mathvariant="normal"> ∞<!-- ∞ --> </mi> </mrow> </msubsup> <mrow class="MJX-TeXAtom-ORD"> <mfrac> <mrow> <mn> 2 </mn> <mi> arctan </mi> <mo> <!-- --> </mo> <mrow> <mo> ( </mo> <mrow class="MJX-TeXAtom-ORD"> <mfrac> <mi> t </mi> <mi> x </mi> </mfrac> </mrow> <mo> ) </mo> </mrow> </mrow> <mrow> <msup> <mi> e </mi> <mrow class="MJX-TeXAtom-ORD"> <mn> 2 </mn> <mi> π<!-- π --> </mi> <mi> t </mi> </mrow> </msup> <mo> −<!-- − --> </mo> <mn> 1 </mn> </mrow> </mfrac> </mrow> <mspace width="thinmathspace"></mspace> <mrow class="MJX-TeXAtom-ORD"> <mrow class="MJX-TeXAtom-ORD"> <mi mathvariant="normal"> d </mi> </mrow> </mrow> <mi> t </mi> <mo> = </mo> <mi> ln </mi> <mo> <!-- --> </mo> <mi mathvariant="normal"> Γ<!-- Γ --> </mi> <mo stretchy="false"> ( </mo> <mi> x </mi> <mo stretchy="false"> ) </mo> <mo> −<!-- − --> </mo> <mi> x </mi> <mi> ln </mi> <mo> <!-- --> </mo> <mi> x </mi> <mo> + </mo> <mi> x </mi> <mo> −<!-- − --> </mo> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="false" scriptlevel="0"> <mfrac> <mn> 1 </mn> <mn> 2 </mn> </mfrac> </mstyle> </mrow> <mi> ln </mi> <mo> <!-- --> </mo> <mrow class="MJX-TeXAtom-ORD"> <mfrac> <mrow> <mn> 2 </mn> <mi> π<!-- π --> </mi> </mrow> <mi> x </mi> </mfrac> </mrow> <mo> . </mo> </mstyle> </mrow> <annotation encoding="application/x-tex"> {\displaystyle \int _{0}^{\infty }{\frac {2\arctan \left({\frac {t}{x}}\right)}{e^{2\pi t}-1}}\,{\rm {d}}t=\ln \Gamma (x)-x\ln x+x-{\tfrac {1}{2}}\ln {\frac {2\pi }{x}}.} </annotation> </semantics> </math></span> <noscript> <img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/d912992e78260a9dbbd0ba446b96be2d2dfca212" class="mwe-math-fallback-image-display mw-invert skin-invert" aria-hidden="true" style="vertical-align: -2.338ex; width:53.593ex; height:6.676ex;" alt="{\displaystyle \int _{0}^{\infty }{\frac {2\arctan \left({\frac {t}{x}}\right)}{e^{2\pi t}-1}}\,{\rm {d}}t=\ln \Gamma (x)-x\ln x+x-{\tfrac {1}{2}}\ln {\frac {2\pi }{x}}.}"> </noscript><span class="lazy-image-placeholder" style="width: 53.593ex;height: 6.676ex;vertical-align: -2.338ex;" data-src="https://wikimedia.org/api/rest_v1/media/math/render/svg/d912992e78260a9dbbd0ba446b96be2d2dfca212" data-alt="{\displaystyle \int _{0}^{\infty }{\frac {2\arctan \left({\frac {t}{x}}\right)}{e^{2\pi t}-1}}\,{\rm {d}}t=\ln \Gamma (x)-x\ln x+x-{\tfrac {1}{2}}\ln {\frac {2\pi }{x}}.}" data-class="mwe-math-fallback-image-display mw-invert skin-invert"> </span></span></p> <p>One way to do this is by means of a convergent series of inverted <a href="https://en-m-wikipedia-org.translate.goog/wiki/Rising_factorial?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-GB" class="mw-redirect" title="Rising factorial">rising factorials</a>. If <span class="mwe-math-element"><span class="mwe-math-mathml-display mwe-math-mathml-a11y" style="display: none;"> <math display="block" xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle z^{\bar {n}}=z(z+1)\cdots (z+n-1),}"><semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <msup> <mi> z </mi> <mrow class="MJX-TeXAtom-ORD"> <mrow class="MJX-TeXAtom-ORD"> <mover> <mi> n </mi> <mo stretchy="false"> ¯<!-- ¯ --> </mo> </mover> </mrow> </mrow> </msup> <mo> = </mo> <mi> z </mi> <mo stretchy="false"> ( </mo> <mi> z </mi> <mo> + </mo> <mn> 1 </mn> <mo stretchy="false"> ) </mo> <mo> ⋯<!-- ⋯ --> </mo> <mo stretchy="false"> ( </mo> <mi> z </mi> <mo> + </mo> <mi> n </mi> <mo> −<!-- − --> </mo> <mn> 1 </mn> <mo stretchy="false"> ) </mo> <mo> , </mo> </mstyle> </mrow> <annotation encoding="application/x-tex"> {\displaystyle z^{\bar {n}}=z(z+1)\cdots (z+n-1),} </annotation> </semantics> </math></span> <noscript> <img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/5b8f38ab7b86f762cedbb9395458a1afb36b0578" class="mwe-math-fallback-image-display mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:28.675ex; height:3.343ex;" alt="{\displaystyle z^{\bar {n}}=z(z+1)\cdots (z+n-1),}"> </noscript><span class="lazy-image-placeholder" style="width: 28.675ex;height: 3.343ex;vertical-align: -0.838ex;" data-src="https://wikimedia.org/api/rest_v1/media/math/render/svg/5b8f38ab7b86f762cedbb9395458a1afb36b0578" data-alt="{\displaystyle z^{\bar {n}}=z(z+1)\cdots (z+n-1),}" data-class="mwe-math-fallback-image-display mw-invert skin-invert"> </span></span> then <span class="mwe-math-element"><span class="mwe-math-mathml-display mwe-math-mathml-a11y" style="display: none;"> <math display="block" xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \int _{0}^{\infty }{\frac {2\arctan \left({\frac {t}{x}}\right)}{e^{2\pi t}-1}}\,{\rm {d}}t=\sum _{n=1}^{\infty }{\frac {c_{n}}{(x+1)^{\bar {n}}}},}"><semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <msubsup> <mo> ∫<!-- ∫ --> </mo> <mrow class="MJX-TeXAtom-ORD"> <mn> 0 </mn> </mrow> <mrow class="MJX-TeXAtom-ORD"> <mi mathvariant="normal"> ∞<!-- ∞ --> </mi> </mrow> </msubsup> <mrow class="MJX-TeXAtom-ORD"> <mfrac> <mrow> <mn> 2 </mn> <mi> arctan </mi> <mo> <!-- --> </mo> <mrow> <mo> ( </mo> <mrow class="MJX-TeXAtom-ORD"> <mfrac> <mi> t </mi> <mi> x </mi> </mfrac> </mrow> <mo> ) </mo> </mrow> </mrow> <mrow> <msup> <mi> e </mi> <mrow class="MJX-TeXAtom-ORD"> <mn> 2 </mn> <mi> π<!-- π --> </mi> <mi> t </mi> </mrow> </msup> <mo> −<!-- − --> </mo> <mn> 1 </mn> </mrow> </mfrac> </mrow> <mspace width="thinmathspace"></mspace> <mrow class="MJX-TeXAtom-ORD"> <mrow class="MJX-TeXAtom-ORD"> <mi mathvariant="normal"> d </mi> </mrow> </mrow> <mi> t </mi> <mo> = </mo> <munderover> <mo> ∑<!-- ∑ --> </mo> <mrow class="MJX-TeXAtom-ORD"> <mi> n </mi> <mo> = </mo> <mn> 1 </mn> </mrow> <mrow class="MJX-TeXAtom-ORD"> <mi mathvariant="normal"> ∞<!-- ∞ --> </mi> </mrow> </munderover> <mrow class="MJX-TeXAtom-ORD"> <mfrac> <msub> <mi> c </mi> <mrow class="MJX-TeXAtom-ORD"> <mi> n </mi> </mrow> </msub> <mrow> <mo stretchy="false"> ( </mo> <mi> x </mi> <mo> + </mo> <mn> 1 </mn> <msup> <mo stretchy="false"> ) </mo> <mrow class="MJX-TeXAtom-ORD"> <mrow class="MJX-TeXAtom-ORD"> <mover> <mi> n </mi> <mo stretchy="false"> ¯<!-- ¯ --> </mo> </mover> </mrow> </mrow> </msup> </mrow> </mfrac> </mrow> <mo> , </mo> </mstyle> </mrow> <annotation encoding="application/x-tex"> {\displaystyle \int _{0}^{\infty }{\frac {2\arctan \left({\frac {t}{x}}\right)}{e^{2\pi t}-1}}\,{\rm {d}}t=\sum _{n=1}^{\infty }{\frac {c_{n}}{(x+1)^{\bar {n}}}},} </annotation> </semantics> </math></span> <noscript> <img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/ad3f584996c74270de2e6681eee0f6bf2f07ef91" class="mwe-math-fallback-image-display mw-invert skin-invert" aria-hidden="true" style="vertical-align: -3.005ex; width:36.688ex; height:7.343ex;" alt="{\displaystyle \int _{0}^{\infty }{\frac {2\arctan \left({\frac {t}{x}}\right)}{e^{2\pi t}-1}}\,{\rm {d}}t=\sum _{n=1}^{\infty }{\frac {c_{n}}{(x+1)^{\bar {n}}}},}"> </noscript><span class="lazy-image-placeholder" style="width: 36.688ex;height: 7.343ex;vertical-align: -3.005ex;" data-src="https://wikimedia.org/api/rest_v1/media/math/render/svg/ad3f584996c74270de2e6681eee0f6bf2f07ef91" data-alt="{\displaystyle \int _{0}^{\infty }{\frac {2\arctan \left({\frac {t}{x}}\right)}{e^{2\pi t}-1}}\,{\rm {d}}t=\sum _{n=1}^{\infty }{\frac {c_{n}}{(x+1)^{\bar {n}}}},}" data-class="mwe-math-fallback-image-display mw-invert skin-invert"> </span></span> where <span class="mwe-math-element"><span class="mwe-math-mathml-display mwe-math-mathml-a11y" style="display: none;"> <math display="block" xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle c_{n}={\frac {1}{n}}\int _{0}^{1}x^{\bar {n}}\left(x-{\tfrac {1}{2}}\right)\,{\rm {d}}x={\frac {1}{2n}}\sum _{k=1}^{n}{\frac {k|s(n,k)|}{(k+1)(k+2)}},}"><semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <msub> <mi> c </mi> <mrow class="MJX-TeXAtom-ORD"> <mi> n </mi> </mrow> </msub> <mo> = </mo> <mrow class="MJX-TeXAtom-ORD"> <mfrac> <mn> 1 </mn> <mi> n </mi> </mfrac> </mrow> <msubsup> <mo> ∫<!-- ∫ --> </mo> <mrow class="MJX-TeXAtom-ORD"> <mn> 0 </mn> </mrow> <mrow class="MJX-TeXAtom-ORD"> <mn> 1 </mn> </mrow> </msubsup> <msup> <mi> x </mi> <mrow class="MJX-TeXAtom-ORD"> <mrow class="MJX-TeXAtom-ORD"> <mover> <mi> n </mi> <mo stretchy="false"> ¯<!-- ¯ --> </mo> </mover> </mrow> </mrow> </msup> <mrow> <mo> ( </mo> <mrow> <mi> x </mi> <mo> −<!-- − --> </mo> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="false" scriptlevel="0"> <mfrac> <mn> 1 </mn> <mn> 2 </mn> </mfrac> </mstyle> </mrow> </mrow> <mo> ) </mo> </mrow> <mspace width="thinmathspace"></mspace> <mrow class="MJX-TeXAtom-ORD"> <mrow class="MJX-TeXAtom-ORD"> <mi mathvariant="normal"> d </mi> </mrow> </mrow> <mi> x </mi> <mo> = </mo> <mrow class="MJX-TeXAtom-ORD"> <mfrac> <mn> 1 </mn> <mrow> <mn> 2 </mn> <mi> n </mi> </mrow> </mfrac> </mrow> <munderover> <mo> ∑<!-- ∑ --> </mo> <mrow class="MJX-TeXAtom-ORD"> <mi> k </mi> <mo> = </mo> <mn> 1 </mn> </mrow> <mrow class="MJX-TeXAtom-ORD"> <mi> n </mi> </mrow> </munderover> <mrow class="MJX-TeXAtom-ORD"> <mfrac> <mrow> <mi> k </mi> <mrow class="MJX-TeXAtom-ORD"> <mo stretchy="false"> | </mo> </mrow> <mi> s </mi> <mo stretchy="false"> ( </mo> <mi> n </mi> <mo> , </mo> <mi> k </mi> <mo stretchy="false"> ) </mo> <mrow class="MJX-TeXAtom-ORD"> <mo stretchy="false"> | </mo> </mrow> </mrow> <mrow> <mo stretchy="false"> ( </mo> <mi> k </mi> <mo> + </mo> <mn> 1 </mn> <mo stretchy="false"> ) </mo> <mo stretchy="false"> ( </mo> <mi> k </mi> <mo> + </mo> <mn> 2 </mn> <mo stretchy="false"> ) </mo> </mrow> </mfrac> </mrow> <mo> , </mo> </mstyle> </mrow> <annotation encoding="application/x-tex"> {\displaystyle c_{n}={\frac {1}{n}}\int _{0}^{1}x^{\bar {n}}\left(x-{\tfrac {1}{2}}\right)\,{\rm {d}}x={\frac {1}{2n}}\sum _{k=1}^{n}{\frac {k|s(n,k)|}{(k+1)(k+2)}},} </annotation> </semantics> </math></span> <noscript> <img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/7bcdb1c8323f6e91e60b7038b1fb3e6be337fd11" class="mwe-math-fallback-image-display mw-invert skin-invert" aria-hidden="true" style="vertical-align: -3.005ex; width:52.288ex; height:6.843ex;" alt="{\displaystyle c_{n}={\frac {1}{n}}\int _{0}^{1}x^{\bar {n}}\left(x-{\tfrac {1}{2}}\right)\,{\rm {d}}x={\frac {1}{2n}}\sum _{k=1}^{n}{\frac {k|s(n,k)|}{(k+1)(k+2)}},}"> </noscript><span class="lazy-image-placeholder" style="width: 52.288ex;height: 6.843ex;vertical-align: -3.005ex;" data-src="https://wikimedia.org/api/rest_v1/media/math/render/svg/7bcdb1c8323f6e91e60b7038b1fb3e6be337fd11" data-alt="{\displaystyle c_{n}={\frac {1}{n}}\int _{0}^{1}x^{\bar {n}}\left(x-{\tfrac {1}{2}}\right)\,{\rm {d}}x={\frac {1}{2n}}\sum _{k=1}^{n}{\frac {k|s(n,k)|}{(k+1)(k+2)}},}" data-class="mwe-math-fallback-image-display mw-invert skin-invert"> </span></span> where <span class="texhtml"><i>s</i>(<i>n</i>, <i>k</i>)</span> denotes the <a href="https://en-m-wikipedia-org.translate.goog/wiki/Stirling_numbers_of_the_first_kind?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-GB" title="Stirling numbers of the first kind">Stirling numbers of the first kind</a>. From this one obtains a version of Stirling's series <span class="mwe-math-element"><span class="mwe-math-mathml-display mwe-math-mathml-a11y" style="display: none;"> <math display="block" xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle {\begin{aligned}\ln \Gamma (x)&=x\ln x-x+{\tfrac {1}{2}}\ln {\frac {2\pi }{x}}+{\frac {1}{12(x+1)}}+{\frac {1}{12(x+1)(x+2)}}+\\&\quad +{\frac {59}{360(x+1)(x+2)(x+3)}}+{\frac {29}{60(x+1)(x+2)(x+3)(x+4)}}+\cdots ,\end{aligned}}}"><semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mrow class="MJX-TeXAtom-ORD"> <mtable columnalign="right left right left right left right left right left right left" rowspacing="3pt" columnspacing="0em 2em 0em 2em 0em 2em 0em 2em 0em 2em 0em" displaystyle="true"> <mtr> <mtd> <mi> ln </mi> <mo> <!-- --> </mo> <mi mathvariant="normal"> Γ<!-- Γ --> </mi> <mo stretchy="false"> ( </mo> <mi> x </mi> <mo stretchy="false"> ) </mo> </mtd> <mtd> <mi></mi> <mo> = </mo> <mi> x </mi> <mi> ln </mi> <mo> <!-- --> </mo> <mi> x </mi> <mo> −<!-- − --> </mo> <mi> x </mi> <mo> + </mo> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="false" scriptlevel="0"> <mfrac> <mn> 1 </mn> <mn> 2 </mn> </mfrac> </mstyle> </mrow> <mi> ln </mi> <mo> <!-- --> </mo> <mrow class="MJX-TeXAtom-ORD"> <mfrac> <mrow> <mn> 2 </mn> <mi> π<!-- π --> </mi> </mrow> <mi> x </mi> </mfrac> </mrow> <mo> + </mo> <mrow class="MJX-TeXAtom-ORD"> <mfrac> <mn> 1 </mn> <mrow> <mn> 12 </mn> <mo stretchy="false"> ( </mo> <mi> x </mi> <mo> + </mo> <mn> 1 </mn> <mo stretchy="false"> ) </mo> </mrow> </mfrac> </mrow> <mo> + </mo> <mrow class="MJX-TeXAtom-ORD"> <mfrac> <mn> 1 </mn> <mrow> <mn> 12 </mn> <mo stretchy="false"> ( </mo> <mi> x </mi> <mo> + </mo> <mn> 1 </mn> <mo stretchy="false"> ) </mo> <mo stretchy="false"> ( </mo> <mi> x </mi> <mo> + </mo> <mn> 2 </mn> <mo stretchy="false"> ) </mo> </mrow> </mfrac> </mrow> <mo> + </mo> </mtd> </mtr> <mtr> <mtd></mtd> <mtd> <mi></mi> <mspace width="1em"></mspace> <mo> + </mo> <mrow class="MJX-TeXAtom-ORD"> <mfrac> <mn> 59 </mn> <mrow> <mn> 360 </mn> <mo stretchy="false"> ( </mo> <mi> x </mi> <mo> + </mo> <mn> 1 </mn> <mo stretchy="false"> ) </mo> <mo stretchy="false"> ( </mo> <mi> x </mi> <mo> + </mo> <mn> 2 </mn> <mo stretchy="false"> ) </mo> <mo stretchy="false"> ( </mo> <mi> x </mi> <mo> + </mo> <mn> 3 </mn> <mo stretchy="false"> ) </mo> </mrow> </mfrac> </mrow> <mo> + </mo> <mrow class="MJX-TeXAtom-ORD"> <mfrac> <mn> 29 </mn> <mrow> <mn> 60 </mn> <mo stretchy="false"> ( </mo> <mi> x </mi> <mo> + </mo> <mn> 1 </mn> <mo stretchy="false"> ) </mo> <mo stretchy="false"> ( </mo> <mi> x </mi> <mo> + </mo> <mn> 2 </mn> <mo stretchy="false"> ) </mo> <mo stretchy="false"> ( </mo> <mi> x </mi> <mo> + </mo> <mn> 3 </mn> <mo stretchy="false"> ) </mo> <mo stretchy="false"> ( </mo> <mi> x </mi> <mo> + </mo> <mn> 4 </mn> <mo stretchy="false"> ) </mo> </mrow> </mfrac> </mrow> <mo> + </mo> <mo> ⋯<!-- ⋯ --> </mo> <mo> , </mo> </mtd> </mtr> </mtable> </mrow> </mstyle> </mrow> <annotation encoding="application/x-tex"> {\displaystyle {\begin{aligned}\ln \Gamma (x)&=x\ln x-x+{\tfrac {1}{2}}\ln {\frac {2\pi }{x}}+{\frac {1}{12(x+1)}}+{\frac {1}{12(x+1)(x+2)}}+\\&\quad +{\frac {59}{360(x+1)(x+2)(x+3)}}+{\frac {29}{60(x+1)(x+2)(x+3)(x+4)}}+\cdots ,\end{aligned}}} </annotation> </semantics> </math></span> <noscript> <img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/e92480dc9ee30c76420a560f402a4e660d5c3c93" class="mwe-math-fallback-image-display mw-invert skin-invert" aria-hidden="true" style="vertical-align: -5.505ex; width:79.748ex; height:12.176ex;" alt="{\displaystyle {\begin{aligned}\ln \Gamma (x)&=x\ln x-x+{\tfrac {1}{2}}\ln {\frac {2\pi }{x}}+{\frac {1}{12(x+1)}}+{\frac {1}{12(x+1)(x+2)}}+\\&\quad +{\frac {59}{360(x+1)(x+2)(x+3)}}+{\frac {29}{60(x+1)(x+2)(x+3)(x+4)}}+\cdots ,\end{aligned}}}"> </noscript><span class="lazy-image-placeholder" style="width: 79.748ex;height: 12.176ex;vertical-align: -5.505ex;" data-src="https://wikimedia.org/api/rest_v1/media/math/render/svg/e92480dc9ee30c76420a560f402a4e660d5c3c93" data-alt="{\displaystyle {\begin{aligned}\ln \Gamma (x)&=x\ln x-x+{\tfrac {1}{2}}\ln {\frac {2\pi }{x}}+{\frac {1}{12(x+1)}}+{\frac {1}{12(x+1)(x+2)}}+\\&\quad +{\frac {59}{360(x+1)(x+2)(x+3)}}+{\frac {29}{60(x+1)(x+2)(x+3)(x+4)}}+\cdots ,\end{aligned}}}" data-class="mwe-math-fallback-image-display mw-invert skin-invert"> </span></span> which converges when <span class="texhtml">Re(<i>x</i>) > 0</span>. Stirling's formula may also be given in convergent form as<sup id="cite_ref-14" class="reference"><a href="https://en-m-wikipedia-org.translate.goog/wiki/Stirling's_approximation?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-GB#cite_note-14"><span class="cite-bracket">[</span>13<span class="cite-bracket">]</span></a></sup> <span class="mwe-math-element"><span class="mwe-math-mathml-display mwe-math-mathml-a11y" style="display: none;"> <math display="block" xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \Gamma (x)={\sqrt {2\pi }}x^{x-{\frac {1}{2}}}e^{-x+\mu (x)}}"><semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi mathvariant="normal"> Γ<!-- Γ --> </mi> <mo stretchy="false"> ( </mo> <mi> x </mi> <mo stretchy="false"> ) </mo> <mo> = </mo> <mrow class="MJX-TeXAtom-ORD"> <msqrt> <mn> 2 </mn> <mi> π<!-- π --> </mi> </msqrt> </mrow> <msup> <mi> x </mi> <mrow class="MJX-TeXAtom-ORD"> <mi> x </mi> <mo> −<!-- − --> </mo> <mrow class="MJX-TeXAtom-ORD"> <mfrac> <mn> 1 </mn> <mn> 2 </mn> </mfrac> </mrow> </mrow> </msup> <msup> <mi> e </mi> <mrow class="MJX-TeXAtom-ORD"> <mo> −<!-- − --> </mo> <mi> x </mi> <mo> + </mo> <mi> μ<!-- μ --> </mi> <mo stretchy="false"> ( </mo> <mi> x </mi> <mo stretchy="false"> ) </mo> </mrow> </msup> </mstyle> </mrow> <annotation encoding="application/x-tex"> {\displaystyle \Gamma (x)={\sqrt {2\pi }}x^{x-{\frac {1}{2}}}e^{-x+\mu (x)}} </annotation> </semantics> </math></span> <noscript> <img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/22fb124c11382df1c29111d531098cdfd56654fe" class="mwe-math-fallback-image-display mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:25.429ex; height:4.009ex;" alt="{\displaystyle \Gamma (x)={\sqrt {2\pi }}x^{x-{\frac {1}{2}}}e^{-x+\mu (x)}}"> </noscript><span class="lazy-image-placeholder" style="width: 25.429ex;height: 4.009ex;vertical-align: -0.838ex;" data-src="https://wikimedia.org/api/rest_v1/media/math/render/svg/22fb124c11382df1c29111d531098cdfd56654fe" data-alt="{\displaystyle \Gamma (x)={\sqrt {2\pi }}x^{x-{\frac {1}{2}}}e^{-x+\mu (x)}}" data-class="mwe-math-fallback-image-display mw-invert skin-invert"> </span></span> where <span class="mwe-math-element"><span class="mwe-math-mathml-display mwe-math-mathml-a11y" style="display: none;"> <math display="block" xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \mu \left(x\right)=\sum _{n=0}^{\infty }\left(\left(x+n+{\frac {1}{2}}\right)\ln \left(1+{\frac {1}{x+n}}\right)-1\right).}"><semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi> μ<!-- μ --> </mi> <mrow> <mo> ( </mo> <mi> x </mi> <mo> ) </mo> </mrow> <mo> = </mo> <munderover> <mo> ∑<!-- ∑ --> </mo> <mrow class="MJX-TeXAtom-ORD"> <mi> n </mi> <mo> = </mo> <mn> 0 </mn> </mrow> <mrow class="MJX-TeXAtom-ORD"> <mi mathvariant="normal"> ∞<!-- ∞ --> </mi> </mrow> </munderover> <mrow> <mo> ( </mo> <mrow> <mrow> <mo> ( </mo> <mrow> <mi> x </mi> <mo> + </mo> <mi> n </mi> <mo> + </mo> <mrow class="MJX-TeXAtom-ORD"> <mfrac> <mn> 1 </mn> <mn> 2 </mn> </mfrac> </mrow> </mrow> <mo> ) </mo> </mrow> <mi> ln </mi> <mo> <!-- --> </mo> <mrow> <mo> ( </mo> <mrow> <mn> 1 </mn> <mo> + </mo> <mrow class="MJX-TeXAtom-ORD"> <mfrac> <mn> 1 </mn> <mrow> <mi> x </mi> <mo> + </mo> <mi> n </mi> </mrow> </mfrac> </mrow> </mrow> <mo> ) </mo> </mrow> <mo> −<!-- − --> </mo> <mn> 1 </mn> </mrow> <mo> ) </mo> </mrow> <mo> . </mo> </mstyle> </mrow> <annotation encoding="application/x-tex"> {\displaystyle \mu \left(x\right)=\sum _{n=0}^{\infty }\left(\left(x+n+{\frac {1}{2}}\right)\ln \left(1+{\frac {1}{x+n}}\right)-1\right).} </annotation> </semantics> </math></span> <noscript> <img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/0972561e44aa7b84fd9cb35f77abbecd8049b731" class="mwe-math-fallback-image-display mw-invert skin-invert" aria-hidden="true" style="vertical-align: -3.005ex; width:50.203ex; height:6.843ex;" alt="{\displaystyle \mu \left(x\right)=\sum _{n=0}^{\infty }\left(\left(x+n+{\frac {1}{2}}\right)\ln \left(1+{\frac {1}{x+n}}\right)-1\right).}"> </noscript><span class="lazy-image-placeholder" style="width: 50.203ex;height: 6.843ex;vertical-align: -3.005ex;" data-src="https://wikimedia.org/api/rest_v1/media/math/render/svg/0972561e44aa7b84fd9cb35f77abbecd8049b731" data-alt="{\displaystyle \mu \left(x\right)=\sum _{n=0}^{\infty }\left(\left(x+n+{\frac {1}{2}}\right)\ln \left(1+{\frac {1}{x+n}}\right)-1\right).}" data-class="mwe-math-fallback-image-display mw-invert skin-invert"> </span></span></p> </section> <div class="mw-heading mw-heading2 section-heading" onclick="mfTempOpenSection(7)"> <span class="indicator mf-icon mf-icon-expand mf-icon--small"></span> <h2 id="Versions_suitable_for_calculators">Versions suitable for calculators</h2><span class="mw-editsection"> <a role="button" href="https://en-m-wikipedia-org.translate.goog/w/index.php?title=Stirling's_approximation&action=edit&section=9&_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-GB" title="Edit section: Versions suitable for calculators" class="cdx-button cdx-button--size-large cdx-button--fake-button cdx-button--fake-button--enabled cdx-button--icon-only cdx-button--weight-quiet "> <span class="minerva-icon minerva-icon--edit"></span> <span>edit</span> </a> </span> </div> <section class="mf-section-7 collapsible-block" id="mf-section-7"> <p>The approximation <span class="mwe-math-element"><span class="mwe-math-mathml-display mwe-math-mathml-a11y" style="display: none;"> <math display="block" xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \Gamma (z)\approx {\sqrt {\frac {2\pi }{z}}}\left({\frac {z}{e}}{\sqrt {z\sinh {\frac {1}{z}}+{\frac {1}{810z^{6}}}}}\right)^{z}}"><semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi mathvariant="normal"> Γ<!-- Γ --> </mi> <mo stretchy="false"> ( </mo> <mi> z </mi> <mo stretchy="false"> ) </mo> <mo> ≈<!-- ≈ --> </mo> <mrow class="MJX-TeXAtom-ORD"> <msqrt> <mfrac> <mrow> <mn> 2 </mn> <mi> π<!-- π --> </mi> </mrow> <mi> z </mi> </mfrac> </msqrt> </mrow> <msup> <mrow> <mo> ( </mo> <mrow> <mrow class="MJX-TeXAtom-ORD"> <mfrac> <mi> z </mi> <mi> e </mi> </mfrac> </mrow> <mrow class="MJX-TeXAtom-ORD"> <msqrt> <mi> z </mi> <mi> sinh </mi> <mo> <!-- --> </mo> <mrow class="MJX-TeXAtom-ORD"> <mfrac> <mn> 1 </mn> <mi> z </mi> </mfrac> </mrow> <mo> + </mo> <mrow class="MJX-TeXAtom-ORD"> <mfrac> <mn> 1 </mn> <mrow> <mn> 810 </mn> <msup> <mi> z </mi> <mrow class="MJX-TeXAtom-ORD"> <mn> 6 </mn> </mrow> </msup> </mrow> </mfrac> </mrow> </msqrt> </mrow> </mrow> <mo> ) </mo> </mrow> <mrow class="MJX-TeXAtom-ORD"> <mi> z </mi> </mrow> </msup> </mstyle> </mrow> <annotation encoding="application/x-tex"> {\displaystyle \Gamma (z)\approx {\sqrt {\frac {2\pi }{z}}}\left({\frac {z}{e}}{\sqrt {z\sinh {\frac {1}{z}}+{\frac {1}{810z^{6}}}}}\right)^{z}} </annotation> </semantics> </math></span> <noscript> <img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/8117fdf62ad1e1991e255eefde12ec06ab4ce6eb" class="mwe-math-fallback-image-display mw-invert skin-invert" aria-hidden="true" style="vertical-align: -2.505ex; width:39.091ex; height:6.343ex;" alt="{\displaystyle \Gamma (z)\approx {\sqrt {\frac {2\pi }{z}}}\left({\frac {z}{e}}{\sqrt {z\sinh {\frac {1}{z}}+{\frac {1}{810z^{6}}}}}\right)^{z}}"> </noscript><span class="lazy-image-placeholder" style="width: 39.091ex;height: 6.343ex;vertical-align: -2.505ex;" data-src="https://wikimedia.org/api/rest_v1/media/math/render/svg/8117fdf62ad1e1991e255eefde12ec06ab4ce6eb" data-alt="{\displaystyle \Gamma (z)\approx {\sqrt {\frac {2\pi }{z}}}\left({\frac {z}{e}}{\sqrt {z\sinh {\frac {1}{z}}+{\frac {1}{810z^{6}}}}}\right)^{z}}" data-class="mwe-math-fallback-image-display mw-invert skin-invert"> </span></span> and its equivalent form <span class="mwe-math-element"><span class="mwe-math-mathml-display mwe-math-mathml-a11y" style="display: none;"> <math display="block" xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle 2\ln \Gamma (z)\approx \ln(2\pi )-\ln z+z\left(2\ln z+\ln \left(z\sinh {\frac {1}{z}}+{\frac {1}{810z^{6}}}\right)-2\right)}"><semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mn> 2 </mn> <mi> ln </mi> <mo> <!-- --> </mo> <mi mathvariant="normal"> Γ<!-- Γ --> </mi> <mo stretchy="false"> ( </mo> <mi> z </mi> <mo stretchy="false"> ) </mo> <mo> ≈<!-- ≈ --> </mo> <mi> ln </mi> <mo> <!-- --> </mo> <mo stretchy="false"> ( </mo> <mn> 2 </mn> <mi> π<!-- π --> </mi> <mo stretchy="false"> ) </mo> <mo> −<!-- − --> </mo> <mi> ln </mi> <mo> <!-- --> </mo> <mi> z </mi> <mo> + </mo> <mi> z </mi> <mrow> <mo> ( </mo> <mrow> <mn> 2 </mn> <mi> ln </mi> <mo> <!-- --> </mo> <mi> z </mi> <mo> + </mo> <mi> ln </mi> <mo> <!-- --> </mo> <mrow> <mo> ( </mo> <mrow> <mi> z </mi> <mi> sinh </mi> <mo> <!-- --> </mo> <mrow class="MJX-TeXAtom-ORD"> <mfrac> <mn> 1 </mn> <mi> z </mi> </mfrac> </mrow> <mo> + </mo> <mrow class="MJX-TeXAtom-ORD"> <mfrac> <mn> 1 </mn> <mrow> <mn> 810 </mn> <msup> <mi> z </mi> <mrow class="MJX-TeXAtom-ORD"> <mn> 6 </mn> </mrow> </msup> </mrow> </mfrac> </mrow> </mrow> <mo> ) </mo> </mrow> <mo> −<!-- − --> </mo> <mn> 2 </mn> </mrow> <mo> ) </mo> </mrow> </mstyle> </mrow> <annotation encoding="application/x-tex"> {\displaystyle 2\ln \Gamma (z)\approx \ln(2\pi )-\ln z+z\left(2\ln z+\ln \left(z\sinh {\frac {1}{z}}+{\frac {1}{810z^{6}}}\right)-2\right)} </annotation> </semantics> </math></span> <noscript> <img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/b70f63ef14c40546863b26a0635f6a8cd199992a" class="mwe-math-fallback-image-display mw-invert skin-invert" aria-hidden="true" style="vertical-align: -2.505ex; width:66.045ex; height:6.176ex;" alt="{\displaystyle 2\ln \Gamma (z)\approx \ln(2\pi )-\ln z+z\left(2\ln z+\ln \left(z\sinh {\frac {1}{z}}+{\frac {1}{810z^{6}}}\right)-2\right)}"> </noscript><span class="lazy-image-placeholder" style="width: 66.045ex;height: 6.176ex;vertical-align: -2.505ex;" data-src="https://wikimedia.org/api/rest_v1/media/math/render/svg/b70f63ef14c40546863b26a0635f6a8cd199992a" data-alt="{\displaystyle 2\ln \Gamma (z)\approx \ln(2\pi )-\ln z+z\left(2\ln z+\ln \left(z\sinh {\frac {1}{z}}+{\frac {1}{810z^{6}}}\right)-2\right)}" data-class="mwe-math-fallback-image-display mw-invert skin-invert"> </span></span> can be obtained by rearranging Stirling's extended formula and observing a coincidence between the resultant <a href="https://en-m-wikipedia-org.translate.goog/wiki/Power_series?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-GB" title="Power series">power series</a> and the <a href="https://en-m-wikipedia-org.translate.goog/wiki/Taylor_series?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-GB" title="Taylor series">Taylor series</a> expansion of the <a href="https://en-m-wikipedia-org.translate.goog/wiki/Hyperbolic_sine?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-GB" class="mw-redirect" title="Hyperbolic sine">hyperbolic sine</a> function. This approximation is good to more than 8 decimal digits for <span class="texhtml mvar" style="font-style:italic;">z</span> with a real part greater than 8. Robert H. Windschitl suggested it in 2002 for computing the gamma function with fair accuracy on calculators with limited program or register memory.<sup id="cite_ref-toth_15-0" class="reference"><a href="https://en-m-wikipedia-org.translate.goog/wiki/Stirling's_approximation?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-GB#cite_note-toth-15"><span class="cite-bracket">[</span>14<span class="cite-bracket">]</span></a></sup></p> <p>Gergő Nemes proposed in 2007 an approximation which gives the same number of exact digits as the Windschitl approximation but is much simpler:<sup id="cite_ref-Nemes2010_16-0" class="reference"><a href="https://en-m-wikipedia-org.translate.goog/wiki/Stirling's_approximation?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-GB#cite_note-Nemes2010-16"><span class="cite-bracket">[</span>15<span class="cite-bracket">]</span></a></sup> <span class="mwe-math-element"><span class="mwe-math-mathml-display mwe-math-mathml-a11y" style="display: none;"> <math display="block" xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \Gamma (z)\approx {\sqrt {\frac {2\pi }{z}}}\left({\frac {1}{e}}\left(z+{\frac {1}{12z-{\frac {1}{10z}}}}\right)\right)^{z},}"><semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi mathvariant="normal"> Γ<!-- Γ --> </mi> <mo stretchy="false"> ( </mo> <mi> z </mi> <mo stretchy="false"> ) </mo> <mo> ≈<!-- ≈ --> </mo> <mrow class="MJX-TeXAtom-ORD"> <msqrt> <mfrac> <mrow> <mn> 2 </mn> <mi> π<!-- π --> </mi> </mrow> <mi> z </mi> </mfrac> </msqrt> </mrow> <msup> <mrow> <mo> ( </mo> <mrow> <mrow class="MJX-TeXAtom-ORD"> <mfrac> <mn> 1 </mn> <mi> e </mi> </mfrac> </mrow> <mrow> <mo> ( </mo> <mrow> <mi> z </mi> <mo> + </mo> <mrow class="MJX-TeXAtom-ORD"> <mfrac> <mn> 1 </mn> <mrow> <mn> 12 </mn> <mi> z </mi> <mo> −<!-- − --> </mo> <mrow class="MJX-TeXAtom-ORD"> <mfrac> <mn> 1 </mn> <mrow> <mn> 10 </mn> <mi> z </mi> </mrow> </mfrac> </mrow> </mrow> </mfrac> </mrow> </mrow> <mo> ) </mo> </mrow> </mrow> <mo> ) </mo> </mrow> <mrow class="MJX-TeXAtom-ORD"> <mi> z </mi> </mrow> </msup> <mo> , </mo> </mstyle> </mrow> <annotation encoding="application/x-tex"> {\displaystyle \Gamma (z)\approx {\sqrt {\frac {2\pi }{z}}}\left({\frac {1}{e}}\left(z+{\frac {1}{12z-{\frac {1}{10z}}}}\right)\right)^{z},} </annotation> </semantics> </math></span> <noscript> <img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/7bf6a375a8346a2ff56722096601b85a4347863c" class="mwe-math-fallback-image-display mw-invert skin-invert" aria-hidden="true" style="vertical-align: -3.505ex; width:38.767ex; height:7.843ex;" alt="{\displaystyle \Gamma (z)\approx {\sqrt {\frac {2\pi }{z}}}\left({\frac {1}{e}}\left(z+{\frac {1}{12z-{\frac {1}{10z}}}}\right)\right)^{z},}"> </noscript><span class="lazy-image-placeholder" style="width: 38.767ex;height: 7.843ex;vertical-align: -3.505ex;" data-src="https://wikimedia.org/api/rest_v1/media/math/render/svg/7bf6a375a8346a2ff56722096601b85a4347863c" data-alt="{\displaystyle \Gamma (z)\approx {\sqrt {\frac {2\pi }{z}}}\left({\frac {1}{e}}\left(z+{\frac {1}{12z-{\frac {1}{10z}}}}\right)\right)^{z},}" data-class="mwe-math-fallback-image-display mw-invert skin-invert"> </span></span> or equivalently, <span class="mwe-math-element"><span class="mwe-math-mathml-display mwe-math-mathml-a11y" style="display: none;"> <math display="block" xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \ln \Gamma (z)\approx {\tfrac {1}{2}}\left(\ln(2\pi )-\ln z\right)+z\left(\ln \left(z+{\frac {1}{12z-{\frac {1}{10z}}}}\right)-1\right).}"><semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi> ln </mi> <mo> <!-- --> </mo> <mi mathvariant="normal"> Γ<!-- Γ --> </mi> <mo stretchy="false"> ( </mo> <mi> z </mi> <mo stretchy="false"> ) </mo> <mo> ≈<!-- ≈ --> </mo> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="false" scriptlevel="0"> <mfrac> <mn> 1 </mn> <mn> 2 </mn> </mfrac> </mstyle> </mrow> <mrow> <mo> ( </mo> <mrow> <mi> ln </mi> <mo> <!-- --> </mo> <mo stretchy="false"> ( </mo> <mn> 2 </mn> <mi> π<!-- π --> </mi> <mo stretchy="false"> ) </mo> <mo> −<!-- − --> </mo> <mi> ln </mi> <mo> <!-- --> </mo> <mi> z </mi> </mrow> <mo> ) </mo> </mrow> <mo> + </mo> <mi> z </mi> <mrow> <mo> ( </mo> <mrow> <mi> ln </mi> <mo> <!-- --> </mo> <mrow> <mo> ( </mo> <mrow> <mi> z </mi> <mo> + </mo> <mrow class="MJX-TeXAtom-ORD"> <mfrac> <mn> 1 </mn> <mrow> <mn> 12 </mn> <mi> z </mi> <mo> −<!-- − --> </mo> <mrow class="MJX-TeXAtom-ORD"> <mfrac> <mn> 1 </mn> <mrow> <mn> 10 </mn> <mi> z </mi> </mrow> </mfrac> </mrow> </mrow> </mfrac> </mrow> </mrow> <mo> ) </mo> </mrow> <mo> −<!-- − --> </mo> <mn> 1 </mn> </mrow> <mo> ) </mo> </mrow> <mo> . </mo> </mstyle> </mrow> <annotation encoding="application/x-tex"> {\displaystyle \ln \Gamma (z)\approx {\tfrac {1}{2}}\left(\ln(2\pi )-\ln z\right)+z\left(\ln \left(z+{\frac {1}{12z-{\frac {1}{10z}}}}\right)-1\right).} </annotation> </semantics> </math></span> <noscript> <img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/7f05deb7cc6fb2336e1a3b2e62b68e7334251b0a" class="mwe-math-fallback-image-display mw-invert skin-invert" aria-hidden="true" style="vertical-align: -3.505ex; width:59.05ex; height:7.843ex;" alt="{\displaystyle \ln \Gamma (z)\approx {\tfrac {1}{2}}\left(\ln(2\pi )-\ln z\right)+z\left(\ln \left(z+{\frac {1}{12z-{\frac {1}{10z}}}}\right)-1\right).}"> </noscript><span class="lazy-image-placeholder" style="width: 59.05ex;height: 7.843ex;vertical-align: -3.505ex;" data-src="https://wikimedia.org/api/rest_v1/media/math/render/svg/7f05deb7cc6fb2336e1a3b2e62b68e7334251b0a" data-alt="{\displaystyle \ln \Gamma (z)\approx {\tfrac {1}{2}}\left(\ln(2\pi )-\ln z\right)+z\left(\ln \left(z+{\frac {1}{12z-{\frac {1}{10z}}}}\right)-1\right).}" data-class="mwe-math-fallback-image-display mw-invert skin-invert"> </span></span></p> <p>An alternative approximation for the gamma function stated by <a href="https://en-m-wikipedia-org.translate.goog/wiki/Srinivasa_Ramanujan?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-GB" title="Srinivasa Ramanujan">Srinivasa Ramanujan</a> in <a href="https://en-m-wikipedia-org.translate.goog/wiki/Ramanujan%27s_lost_notebook?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-GB" title="Ramanujan's lost notebook">Ramanujan's lost notebook</a><sup id="cite_ref-17" class="reference"><a href="https://en-m-wikipedia-org.translate.goog/wiki/Stirling's_approximation?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-GB#cite_note-17"><span class="cite-bracket">[</span>16<span class="cite-bracket">]</span></a></sup> is <span class="mwe-math-element"><span class="mwe-math-mathml-display mwe-math-mathml-a11y" style="display: none;"> <math display="block" xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \Gamma (1+x)\approx {\sqrt {\pi }}\left({\frac {x}{e}}\right)^{x}\left(8x^{3}+4x^{2}+x+{\frac {1}{30}}\right)^{\frac {1}{6}}}"><semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi mathvariant="normal"> Γ<!-- Γ --> </mi> <mo stretchy="false"> ( </mo> <mn> 1 </mn> <mo> + </mo> <mi> x </mi> <mo stretchy="false"> ) </mo> <mo> ≈<!-- ≈ --> </mo> <mrow class="MJX-TeXAtom-ORD"> <msqrt> <mi> π<!-- π --> </mi> </msqrt> </mrow> <msup> <mrow> <mo> ( </mo> <mrow class="MJX-TeXAtom-ORD"> <mfrac> <mi> x </mi> <mi> e </mi> </mfrac> </mrow> <mo> ) </mo> </mrow> <mrow class="MJX-TeXAtom-ORD"> <mi> x </mi> </mrow> </msup> <msup> <mrow> <mo> ( </mo> <mrow> <mn> 8 </mn> <msup> <mi> x </mi> <mrow class="MJX-TeXAtom-ORD"> <mn> 3 </mn> </mrow> </msup> <mo> + </mo> <mn> 4 </mn> <msup> <mi> x </mi> <mrow class="MJX-TeXAtom-ORD"> <mn> 2 </mn> </mrow> </msup> <mo> + </mo> <mi> x </mi> <mo> + </mo> <mrow class="MJX-TeXAtom-ORD"> <mfrac> <mn> 1 </mn> <mn> 30 </mn> </mfrac> </mrow> </mrow> <mo> ) </mo> </mrow> <mrow class="MJX-TeXAtom-ORD"> <mfrac> <mn> 1 </mn> <mn> 6 </mn> </mfrac> </mrow> </msup> </mstyle> </mrow> <annotation encoding="application/x-tex"> {\displaystyle \Gamma (1+x)\approx {\sqrt {\pi }}\left({\frac {x}{e}}\right)^{x}\left(8x^{3}+4x^{2}+x+{\frac {1}{30}}\right)^{\frac {1}{6}}} </annotation> </semantics> </math></span> <noscript> <img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/e5a63e515690cf06b6bd412329fe7c1a625b74ea" class="mwe-math-fallback-image-display mw-invert skin-invert" aria-hidden="true" style="vertical-align: -2.505ex; width:46.336ex; height:7.176ex;" alt="{\displaystyle \Gamma (1+x)\approx {\sqrt {\pi }}\left({\frac {x}{e}}\right)^{x}\left(8x^{3}+4x^{2}+x+{\frac {1}{30}}\right)^{\frac {1}{6}}}"> </noscript><span class="lazy-image-placeholder" style="width: 46.336ex;height: 7.176ex;vertical-align: -2.505ex;" data-src="https://wikimedia.org/api/rest_v1/media/math/render/svg/e5a63e515690cf06b6bd412329fe7c1a625b74ea" data-alt="{\displaystyle \Gamma (1+x)\approx {\sqrt {\pi }}\left({\frac {x}{e}}\right)^{x}\left(8x^{3}+4x^{2}+x+{\frac {1}{30}}\right)^{\frac {1}{6}}}" data-class="mwe-math-fallback-image-display mw-invert skin-invert"> </span></span> for <span class="texhtml"><i>x</i> ≥ 0</span>. The equivalent approximation for <span class="texhtml">ln <i>n</i>!</span> has an asymptotic error of <span class="texhtml"> <link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r1214402035"><span class="sfrac"><span class="tion"><span class="num">1</span><span class="sr-only">/</span><span class="den">1400<i>n</i><sup>3</sup></span></span></span></span> and is given by <span class="mwe-math-element"><span class="mwe-math-mathml-display mwe-math-mathml-a11y" style="display: none;"> <math display="block" xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \ln n!\approx n\ln n-n+{\tfrac {1}{6}}\ln(8n^{3}+4n^{2}+n+{\tfrac {1}{30}})+{\tfrac {1}{2}}\ln \pi .}"><semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi> ln </mi> <mo> <!-- --> </mo> <mi> n </mi> <mo> ! </mo> <mo> ≈<!-- ≈ --> </mo> <mi> n </mi> <mi> ln </mi> <mo> <!-- --> </mo> <mi> n </mi> <mo> −<!-- − --> </mo> <mi> n </mi> <mo> + </mo> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="false" scriptlevel="0"> <mfrac> <mn> 1 </mn> <mn> 6 </mn> </mfrac> </mstyle> </mrow> <mi> ln </mi> <mo> <!-- --> </mo> <mo stretchy="false"> ( </mo> <mn> 8 </mn> <msup> <mi> n </mi> <mrow class="MJX-TeXAtom-ORD"> <mn> 3 </mn> </mrow> </msup> <mo> + </mo> <mn> 4 </mn> <msup> <mi> n </mi> <mrow class="MJX-TeXAtom-ORD"> <mn> 2 </mn> </mrow> </msup> <mo> + </mo> <mi> n </mi> <mo> + </mo> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="false" scriptlevel="0"> <mfrac> <mn> 1 </mn> <mn> 30 </mn> </mfrac> </mstyle> </mrow> <mo stretchy="false"> ) </mo> <mo> + </mo> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="false" scriptlevel="0"> <mfrac> <mn> 1 </mn> <mn> 2 </mn> </mfrac> </mstyle> </mrow> <mi> ln </mi> <mo> <!-- --> </mo> <mi> π<!-- π --> </mi> <mo> . </mo> </mstyle> </mrow> <annotation encoding="application/x-tex"> {\displaystyle \ln n!\approx n\ln n-n+{\tfrac {1}{6}}\ln(8n^{3}+4n^{2}+n+{\tfrac {1}{30}})+{\tfrac {1}{2}}\ln \pi .} </annotation> </semantics> </math></span> <noscript> <img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/2c561b7b2741bd7253fc53b352eb1c1b07967fd5" class="mwe-math-fallback-image-display mw-invert skin-invert" aria-hidden="true" style="vertical-align: -1.338ex; width:54.649ex; height:3.676ex;" alt="{\displaystyle \ln n!\approx n\ln n-n+{\tfrac {1}{6}}\ln(8n^{3}+4n^{2}+n+{\tfrac {1}{30}})+{\tfrac {1}{2}}\ln \pi .}"> </noscript><span class="lazy-image-placeholder" style="width: 54.649ex;height: 3.676ex;vertical-align: -1.338ex;" data-src="https://wikimedia.org/api/rest_v1/media/math/render/svg/2c561b7b2741bd7253fc53b352eb1c1b07967fd5" data-alt="{\displaystyle \ln n!\approx n\ln n-n+{\tfrac {1}{6}}\ln(8n^{3}+4n^{2}+n+{\tfrac {1}{30}})+{\tfrac {1}{2}}\ln \pi .}" data-class="mwe-math-fallback-image-display mw-invert skin-invert"> </span></span></p> <p>The approximation may be made precise by giving paired upper and lower bounds; one such inequality is<sup id="cite_ref-E.A.Karatsuba_18-0" class="reference"><a href="https://en-m-wikipedia-org.translate.goog/wiki/Stirling's_approximation?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-GB#cite_note-E.A.Karatsuba-18"><span class="cite-bracket">[</span>17<span class="cite-bracket">]</span></a></sup><sup id="cite_ref-Mortici2011-1_19-0" class="reference"><a href="https://en-m-wikipedia-org.translate.goog/wiki/Stirling's_approximation?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-GB#cite_note-Mortici2011-1-19"><span class="cite-bracket">[</span>18<span class="cite-bracket">]</span></a></sup><sup id="cite_ref-Mortici2011-2_20-0" class="reference"><a href="https://en-m-wikipedia-org.translate.goog/wiki/Stirling's_approximation?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-GB#cite_note-Mortici2011-2-20"><span class="cite-bracket">[</span>19<span class="cite-bracket">]</span></a></sup><sup id="cite_ref-Mortici2011-3_21-0" class="reference"><a href="https://en-m-wikipedia-org.translate.goog/wiki/Stirling's_approximation?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-GB#cite_note-Mortici2011-3-21"><span class="cite-bracket">[</span>20<span class="cite-bracket">]</span></a></sup> <span class="mwe-math-element"><span class="mwe-math-mathml-display mwe-math-mathml-a11y" style="display: none;"> <math display="block" xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle {\sqrt {\pi }}\left({\frac {x}{e}}\right)^{x}\left(8x^{3}+4x^{2}+x+{\frac {1}{100}}\right)^{1/6}<\Gamma (1+x)<{\sqrt {\pi }}\left({\frac {x}{e}}\right)^{x}\left(8x^{3}+4x^{2}+x+{\frac {1}{30}}\right)^{1/6}.}"><semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mrow class="MJX-TeXAtom-ORD"> <msqrt> <mi> π<!-- π --> </mi> </msqrt> </mrow> <msup> <mrow> <mo> ( </mo> <mrow class="MJX-TeXAtom-ORD"> <mfrac> <mi> x </mi> <mi> e </mi> </mfrac> </mrow> <mo> ) </mo> </mrow> <mrow class="MJX-TeXAtom-ORD"> <mi> x </mi> </mrow> </msup> <msup> <mrow> <mo> ( </mo> <mrow> <mn> 8 </mn> <msup> <mi> x </mi> <mrow class="MJX-TeXAtom-ORD"> <mn> 3 </mn> </mrow> </msup> <mo> + </mo> <mn> 4 </mn> <msup> <mi> x </mi> <mrow class="MJX-TeXAtom-ORD"> <mn> 2 </mn> </mrow> </msup> <mo> + </mo> <mi> x </mi> <mo> + </mo> <mrow class="MJX-TeXAtom-ORD"> <mfrac> <mn> 1 </mn> <mn> 100 </mn> </mfrac> </mrow> </mrow> <mo> ) </mo> </mrow> <mrow class="MJX-TeXAtom-ORD"> <mn> 1 </mn> <mrow class="MJX-TeXAtom-ORD"> <mo> / </mo> </mrow> <mn> 6 </mn> </mrow> </msup> <mo> < </mo> <mi mathvariant="normal"> Γ<!-- Γ --> </mi> <mo stretchy="false"> ( </mo> <mn> 1 </mn> <mo> + </mo> <mi> x </mi> <mo stretchy="false"> ) </mo> <mo> < </mo> <mrow class="MJX-TeXAtom-ORD"> <msqrt> <mi> π<!-- π --> </mi> </msqrt> </mrow> <msup> <mrow> <mo> ( </mo> <mrow class="MJX-TeXAtom-ORD"> <mfrac> <mi> x </mi> <mi> e </mi> </mfrac> </mrow> <mo> ) </mo> </mrow> <mrow class="MJX-TeXAtom-ORD"> <mi> x </mi> </mrow> </msup> <msup> <mrow> <mo> ( </mo> <mrow> <mn> 8 </mn> <msup> <mi> x </mi> <mrow class="MJX-TeXAtom-ORD"> <mn> 3 </mn> </mrow> </msup> <mo> + </mo> <mn> 4 </mn> <msup> <mi> x </mi> <mrow class="MJX-TeXAtom-ORD"> <mn> 2 </mn> </mrow> </msup> <mo> + </mo> <mi> x </mi> <mo> + </mo> <mrow class="MJX-TeXAtom-ORD"> <mfrac> <mn> 1 </mn> <mn> 30 </mn> </mfrac> </mrow> </mrow> <mo> ) </mo> </mrow> <mrow class="MJX-TeXAtom-ORD"> <mn> 1 </mn> <mrow class="MJX-TeXAtom-ORD"> <mo> / </mo> </mrow> <mn> 6 </mn> </mrow> </msup> <mo> . </mo> </mstyle> </mrow> <annotation encoding="application/x-tex"> {\displaystyle {\sqrt {\pi }}\left({\frac {x}{e}}\right)^{x}\left(8x^{3}+4x^{2}+x+{\frac {1}{100}}\right)^{1/6}<\Gamma (1+x)<{\sqrt {\pi }}\left({\frac {x}{e}}\right)^{x}\left(8x^{3}+4x^{2}+x+{\frac {1}{30}}\right)^{1/6}.} </annotation> </semantics> </math></span> <noscript> <img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/70abbc9761518df503553faca29aac924e88cdb4" class="mwe-math-fallback-image-display mw-invert skin-invert" aria-hidden="true" style="vertical-align: -2.505ex; width:87.812ex; height:6.676ex;" alt="{\displaystyle {\sqrt {\pi }}\left({\frac {x}{e}}\right)^{x}\left(8x^{3}+4x^{2}+x+{\frac {1}{100}}\right)^{1/6}<\Gamma (1+x)<{\sqrt {\pi }}\left({\frac {x}{e}}\right)^{x}\left(8x^{3}+4x^{2}+x+{\frac {1}{30}}\right)^{1/6}.}"> </noscript><span class="lazy-image-placeholder" style="width: 87.812ex;height: 6.676ex;vertical-align: -2.505ex;" data-src="https://wikimedia.org/api/rest_v1/media/math/render/svg/70abbc9761518df503553faca29aac924e88cdb4" data-alt="{\displaystyle {\sqrt {\pi }}\left({\frac {x}{e}}\right)^{x}\left(8x^{3}+4x^{2}+x+{\frac {1}{100}}\right)^{1/6}<\Gamma (1+x)<{\sqrt {\pi }}\left({\frac {x}{e}}\right)^{x}\left(8x^{3}+4x^{2}+x+{\frac {1}{30}}\right)^{1/6}.}" data-class="mwe-math-fallback-image-display mw-invert skin-invert"> </span></span></p> </section> <div class="mw-heading mw-heading2 section-heading" onclick="mfTempOpenSection(8)"> <span class="indicator mf-icon mf-icon-expand mf-icon--small"></span> <h2 id="History">History</h2><span class="mw-editsection"> <a role="button" href="https://en-m-wikipedia-org.translate.goog/w/index.php?title=Stirling's_approximation&action=edit&section=10&_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-GB" title="Edit section: History" class="cdx-button cdx-button--size-large cdx-button--fake-button cdx-button--fake-button--enabled cdx-button--icon-only cdx-button--weight-quiet "> <span class="minerva-icon minerva-icon--edit"></span> <span>edit</span> </a> </span> </div> <section class="mf-section-8 collapsible-block" id="mf-section-8"> <p>The formula was first discovered by <a href="https://en-m-wikipedia-org.translate.goog/wiki/Abraham_de_Moivre?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-GB" title="Abraham de Moivre">Abraham de Moivre</a><sup id="cite_ref-LeCam1986_2-1" class="reference"><a href="https://en-m-wikipedia-org.translate.goog/wiki/Stirling's_approximation?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-GB#cite_note-LeCam1986-2"><span class="cite-bracket">[</span>2<span class="cite-bracket">]</span></a></sup> in the form <span class="mwe-math-element"><span class="mwe-math-mathml-display mwe-math-mathml-a11y" style="display: none;"> <math display="block" xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle n!\sim [{\rm {constant}}]\cdot n^{n+{\frac {1}{2}}}e^{-n}.}"><semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi> n </mi> <mo> ! </mo> <mo> ∼<!-- ∼ --> </mo> <mo stretchy="false"> [ </mo> <mrow class="MJX-TeXAtom-ORD"> <mrow class="MJX-TeXAtom-ORD"> <mi mathvariant="normal"> c </mi> <mi mathvariant="normal"> o </mi> <mi mathvariant="normal"> n </mi> <mi mathvariant="normal"> s </mi> <mi mathvariant="normal"> t </mi> <mi mathvariant="normal"> a </mi> <mi mathvariant="normal"> n </mi> <mi mathvariant="normal"> t </mi> </mrow> </mrow> <mo stretchy="false"> ] </mo> <mo> ⋅<!-- ⋅ --> </mo> <msup> <mi> n </mi> <mrow class="MJX-TeXAtom-ORD"> <mi> n </mi> <mo> + </mo> <mrow class="MJX-TeXAtom-ORD"> <mfrac> <mn> 1 </mn> <mn> 2 </mn> </mfrac> </mrow> </mrow> </msup> <msup> <mi> e </mi> <mrow class="MJX-TeXAtom-ORD"> <mo> −<!-- − --> </mo> <mi> n </mi> </mrow> </msup> <mo> . </mo> </mstyle> </mrow> <annotation encoding="application/x-tex"> {\displaystyle n!\sim [{\rm {constant}}]\cdot n^{n+{\frac {1}{2}}}e^{-n}.} </annotation> </semantics> </math></span> <noscript> <img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/9a51109a2de3b04535d0b8065ec095be411bab47" class="mwe-math-fallback-image-display mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:26.403ex; height:4.009ex;" alt="{\displaystyle n!\sim [{\rm {constant}}]\cdot n^{n+{\frac {1}{2}}}e^{-n}.}"> </noscript><span class="lazy-image-placeholder" style="width: 26.403ex;height: 4.009ex;vertical-align: -0.838ex;" data-src="https://wikimedia.org/api/rest_v1/media/math/render/svg/9a51109a2de3b04535d0b8065ec095be411bab47" data-alt="{\displaystyle n!\sim [{\rm {constant}}]\cdot n^{n+{\frac {1}{2}}}e^{-n}.}" data-class="mwe-math-fallback-image-display mw-invert skin-invert"> </span></span></p> <p>De Moivre gave an approximate rational-number expression for the natural logarithm of the constant. Stirling's contribution consisted of showing that the constant is precisely <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"> <math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle {\sqrt {2\pi }}}"><semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mrow class="MJX-TeXAtom-ORD"> <msqrt> <mn> 2 </mn> <mi> π<!-- π --> </mi> </msqrt> </mrow> </mstyle> </mrow> <annotation encoding="application/x-tex"> {\displaystyle {\sqrt {2\pi }}} </annotation> </semantics> </math></span> <noscript> <img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/7a9b009153bbbb3273a7e7279cb6b084fd650a80" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.671ex; width:4.43ex; height:3.009ex;" alt="{\displaystyle {\sqrt {2\pi }}}"> </noscript><span class="lazy-image-placeholder" style="width: 4.43ex;height: 3.009ex;vertical-align: -0.671ex;" data-src="https://wikimedia.org/api/rest_v1/media/math/render/svg/7a9b009153bbbb3273a7e7279cb6b084fd650a80" data-alt="{\displaystyle {\sqrt {2\pi }}}" data-class="mwe-math-fallback-image-inline mw-invert skin-invert"> </span></span>.<sup id="cite_ref-Pearson1924_3-1" class="reference"><a href="https://en-m-wikipedia-org.translate.goog/wiki/Stirling's_approximation?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-GB#cite_note-Pearson1924-3"><span class="cite-bracket">[</span>3<span class="cite-bracket">]</span></a></sup></p> </section> <div class="mw-heading mw-heading2 section-heading" onclick="mfTempOpenSection(9)"> <span class="indicator mf-icon mf-icon-expand mf-icon--small"></span> <h2 id="See_also">See also</h2><span class="mw-editsection"> <a role="button" href="https://en-m-wikipedia-org.translate.goog/w/index.php?title=Stirling's_approximation&action=edit&section=11&_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-GB" title="Edit section: See also" class="cdx-button cdx-button--size-large cdx-button--fake-button cdx-button--fake-button--enabled cdx-button--icon-only cdx-button--weight-quiet "> <span class="minerva-icon minerva-icon--edit"></span> <span>edit</span> </a> </span> </div> <section class="mf-section-9 collapsible-block" id="mf-section-9"> <ul> <li><a href="https://en-m-wikipedia-org.translate.goog/wiki/Lanczos_approximation?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-GB" title="Lanczos approximation">Lanczos approximation</a></li> <li><a href="https://en-m-wikipedia-org.translate.goog/wiki/Spouge%27s_approximation?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-GB" title="Spouge's approximation">Spouge's approximation</a></li> </ul> </section> <div class="mw-heading mw-heading2 section-heading" onclick="mfTempOpenSection(10)"> <span class="indicator mf-icon mf-icon-expand mf-icon--small"></span> <h2 id="References">References</h2><span class="mw-editsection"> <a role="button" href="https://en-m-wikipedia-org.translate.goog/w/index.php?title=Stirling's_approximation&action=edit&section=12&_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-GB" title="Edit section: References" class="cdx-button cdx-button--size-large cdx-button--fake-button cdx-button--fake-button--enabled cdx-button--icon-only cdx-button--weight-quiet "> <span class="minerva-icon minerva-icon--edit"></span> <span>edit</span> </a> </span> </div> <section class="mf-section-10 collapsible-block" id="mf-section-10"> <style data-mw-deduplicate="TemplateStyles:r1239543626">.mw-parser-output .reflist{margin-bottom:0.5em;list-style-type:decimal}@media screen{.mw-parser-output .reflist{font-size:90%}}.mw-parser-output .reflist .references{font-size:100%;margin-bottom:0;list-style-type:inherit}.mw-parser-output .reflist-columns-2{column-width:30em}.mw-parser-output .reflist-columns-3{column-width:25em}.mw-parser-output .reflist-columns{margin-top:0.3em}.mw-parser-output .reflist-columns ol{margin-top:0}.mw-parser-output .reflist-columns li{page-break-inside:avoid;break-inside:avoid-column}.mw-parser-output .reflist-upper-alpha{list-style-type:upper-alpha}.mw-parser-output .reflist-upper-roman{list-style-type:upper-roman}.mw-parser-output .reflist-lower-alpha{list-style-type:lower-alpha}.mw-parser-output .reflist-lower-greek{list-style-type:lower-greek}.mw-parser-output .reflist-lower-roman{list-style-type:lower-roman}</style> <div class="reflist"> <div class="mw-references-wrap mw-references-columns"> <ol class="references"> <li id="cite_note-dutka-1"><span class="mw-cite-backlink"><b><a href="https://en-m-wikipedia-org.translate.goog/wiki/Stirling's_approximation?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-GB#cite_ref-dutka_1-0">^</a></b></span> <span class="reference-text"><style data-mw-deduplicate="TemplateStyles:r1238218222">.mw-parser-output cite.citation{font-style:inherit;word-wrap:break-word}.mw-parser-output .citation q{quotes:"\"""\"""'""'"}.mw-parser-output .citation:target{background-color:rgba(0,127,255,0.133)}.mw-parser-output .id-lock-free.id-lock-free a{background:url("//upload.wikimedia.org/wikipedia/commons/6/65/Lock-green.svg")right 0.1em center/9px no-repeat}.mw-parser-output .id-lock-limited.id-lock-limited a,.mw-parser-output .id-lock-registration.id-lock-registration a{background:url("//upload.wikimedia.org/wikipedia/commons/d/d6/Lock-gray-alt-2.svg")right 0.1em center/9px no-repeat}.mw-parser-output .id-lock-subscription.id-lock-subscription a{background:url("//upload.wikimedia.org/wikipedia/commons/a/aa/Lock-red-alt-2.svg")right 0.1em center/9px no-repeat}.mw-parser-output .cs1-ws-icon a{background:url("//upload.wikimedia.org/wikipedia/commons/4/4c/Wikisource-logo.svg")right 0.1em center/12px no-repeat}body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .id-lock-free a,body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .id-lock-limited a,body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .id-lock-registration a,body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .id-lock-subscription a,body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .cs1-ws-icon a{background-size:contain;padding:0 1em 0 0}.mw-parser-output .cs1-code{color:inherit;background:inherit;border:none;padding:inherit}.mw-parser-output .cs1-hidden-error{display:none;color:var(--color-error,#d33)}.mw-parser-output .cs1-visible-error{color:var(--color-error,#d33)}.mw-parser-output .cs1-maint{display:none;color:#085;margin-left:0.3em}.mw-parser-output .cs1-kern-left{padding-left:0.2em}.mw-parser-output .cs1-kern-right{padding-right:0.2em}.mw-parser-output .citation .mw-selflink{font-weight:inherit}@media screen{.mw-parser-output .cs1-format{font-size:95%}html.skin-theme-clientpref-night .mw-parser-output .cs1-maint{color:#18911f}}@media screen and (prefers-color-scheme:dark){html.skin-theme-clientpref-os .mw-parser-output .cs1-maint{color:#18911f}}</style><cite id="CITEREFDutka1991" class="citation cs2">Dutka, Jacques (1991), "The early history of the factorial function", <i><a href="https://en-m-wikipedia-org.translate.goog/wiki/Archive_for_History_of_Exact_Sciences?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-GB" title="Archive for History of Exact Sciences">Archive for History of Exact Sciences</a></i>, <b>43</b> (3): 225–249, <a href="https://en-m-wikipedia-org.translate.goog/wiki/Doi_(identifier)?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-GB" class="mw-redirect" title="Doi (identifier)">doi</a>:<a rel="nofollow" class="external text" href="https://translate.google.com/website?sl=auto&tl=en&hl=en-GB&u=https://doi.org/10.1007%252FBF00389433">10.1007/BF00389433</a>, <a href="https://en-m-wikipedia-org.translate.goog/wiki/S2CID_(identifier)?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-GB" class="mw-redirect" title="S2CID (identifier)">S2CID</a> <a rel="nofollow" class="external text" href="https://translate.google.com/website?sl=auto&tl=en&hl=en-GB&u=https://api.semanticscholar.org/CorpusID:122237769">122237769</a></cite><span title="ctx_ver=Z39.88-2004&rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Ajournal&rft.genre=article&rft.jtitle=Archive+for+History+of+Exact+Sciences&rft.atitle=The+early+history+of+the+factorial+function&rft.volume=43&rft.issue=3&rft.pages=225-249&rft.date=1991&rft_id=info%3Adoi%2F10.1007%2FBF00389433&rft_id=https%3A%2F%2Fapi.semanticscholar.org%2FCorpusID%3A122237769%23id-name%3DS2CID&rft.aulast=Dutka&rft.aufirst=Jacques&rfr_id=info%3Asid%2Fen.wikipedia.org%3AStirling%27s+approximation" class="Z3988"></span></span></li> <li id="cite_note-LeCam1986-2"><span class="mw-cite-backlink">^ <a href="https://en-m-wikipedia-org.translate.goog/wiki/Stirling's_approximation?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-GB#cite_ref-LeCam1986_2-0"><sup><i><b>a</b></i></sup></a> <a href="https://en-m-wikipedia-org.translate.goog/wiki/Stirling's_approximation?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-GB#cite_ref-LeCam1986_2-1"><sup><i><b>b</b></i></sup></a></span> <span class="reference-text"> <link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r1238218222"><cite id="CITEREFLe_Cam1986" class="citation cs2"><a href="https://en-m-wikipedia-org.translate.goog/wiki/Lucien_Le_Cam?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-GB" title="Lucien Le Cam">Le Cam, L.</a> (1986), "The central limit theorem around 1935", <i>Statistical Science</i>, <b>1</b> (1): 78–96, <a href="https://en-m-wikipedia-org.translate.goog/wiki/Doi_(identifier)?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-GB" class="mw-redirect" title="Doi (identifier)">doi</a>:<span class="id-lock-free" title="Freely accessible"><a rel="nofollow" class="external text" href="https://translate.google.com/website?sl=auto&tl=en&hl=en-GB&u=https://doi.org/10.1214%252Fss%252F1177013818">10.1214/ss/1177013818</a></span>, <a href="https://en-m-wikipedia-org.translate.goog/wiki/JSTOR_(identifier)?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-GB" class="mw-redirect" title="JSTOR (identifier)">JSTOR</a> <a rel="nofollow" class="external text" href="https://translate.google.com/website?sl=auto&tl=en&hl=en-GB&u=https://www.jstor.org/stable/2245503">2245503</a>, <a href="https://en-m-wikipedia-org.translate.goog/wiki/MR_(identifier)?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-GB" class="mw-redirect" title="MR (identifier)">MR</a> <a rel="nofollow" class="external text" href="https://translate.google.com/website?sl=auto&tl=en&hl=en-GB&u=https://mathscinet.ams.org/mathscinet-getitem?mr%3D0833276">0833276</a></cite><span title="ctx_ver=Z39.88-2004&rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Ajournal&rft.genre=article&rft.jtitle=Statistical+Science&rft.atitle=The+central+limit+theorem+around+1935&rft.volume=1&rft.issue=1&rft.pages=78-96&rft.date=1986&rft_id=https%3A%2F%2Fmathscinet.ams.org%2Fmathscinet-getitem%3Fmr%3D833276%23id-name%3DMR&rft_id=https%3A%2F%2Fwww.jstor.org%2Fstable%2F2245503%23id-name%3DJSTOR&rft_id=info%3Adoi%2F10.1214%2Fss%2F1177013818&rft.aulast=Le+Cam&rft.aufirst=L.&rfr_id=info%3Asid%2Fen.wikipedia.org%3AStirling%27s+approximation" class="Z3988"></span>; see p. 81, "The result, obtained using a formula originally proved by de Moivre but now called Stirling's formula, occurs in his 'Doctrine of Chances' of 1733."</span></li> <li id="cite_note-Pearson1924-3"><span class="mw-cite-backlink">^ <a href="https://en-m-wikipedia-org.translate.goog/wiki/Stirling's_approximation?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-GB#cite_ref-Pearson1924_3-0"><sup><i><b>a</b></i></sup></a> <a href="https://en-m-wikipedia-org.translate.goog/wiki/Stirling's_approximation?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-GB#cite_ref-Pearson1924_3-1"><sup><i><b>b</b></i></sup></a></span> <span class="reference-text"> <link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r1238218222"><cite id="CITEREFPearson1924" class="citation cs2">Pearson, Karl (1924), "Historical note on the origin of the normal curve of errors", <i>Biometrika</i>, <b>16</b> (3/4): 402–404 [p. 403], <a href="https://en-m-wikipedia-org.translate.goog/wiki/Doi_(identifier)?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-GB" class="mw-redirect" title="Doi (identifier)">doi</a>:<a rel="nofollow" class="external text" href="https://translate.google.com/website?sl=auto&tl=en&hl=en-GB&u=https://doi.org/10.2307%252F2331714">10.2307/2331714</a>, <a href="https://en-m-wikipedia-org.translate.goog/wiki/JSTOR_(identifier)?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-GB" class="mw-redirect" title="JSTOR (identifier)">JSTOR</a> <a rel="nofollow" class="external text" href="https://translate.google.com/website?sl=auto&tl=en&hl=en-GB&u=https://www.jstor.org/stable/2331714">2331714</a>, <q>I consider that the fact that Stirling showed that De Moivre's arithmetical constant was <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"> <math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle {\sqrt {2\pi }}}"><semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mrow class="MJX-TeXAtom-ORD"> <msqrt> <mn> 2 </mn> <mi> π<!-- π --> </mi> </msqrt> </mrow> </mstyle> </mrow> <annotation encoding="application/x-tex"> {\displaystyle {\sqrt {2\pi }}} </annotation> </semantics> </math></span> <noscript> <img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/7a9b009153bbbb3273a7e7279cb6b084fd650a80" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.671ex; width:4.43ex; height:3.009ex;" alt="{\displaystyle {\sqrt {2\pi }}}"> </noscript><span class="lazy-image-placeholder" style="width: 4.43ex;height: 3.009ex;vertical-align: -0.671ex;" data-src="https://wikimedia.org/api/rest_v1/media/math/render/svg/7a9b009153bbbb3273a7e7279cb6b084fd650a80" data-alt="{\displaystyle {\sqrt {2\pi }}}" data-class="mwe-math-fallback-image-inline mw-invert skin-invert"> </span></span> does not entitle him to claim the theorem, [...]</q></cite><span title="ctx_ver=Z39.88-2004&rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Ajournal&rft.genre=article&rft.jtitle=Biometrika&rft.atitle=Historical+note+on+the+origin+of+the+normal+curve+of+errors&rft.volume=16&rft.issue=3%2F4&rft.pages=402-404+p.+403&rft.date=1924&rft_id=info%3Adoi%2F10.2307%2F2331714&rft_id=https%3A%2F%2Fwww.jstor.org%2Fstable%2F2331714%23id-name%3DJSTOR&rft.aulast=Pearson&rft.aufirst=Karl&rfr_id=info%3Asid%2Fen.wikipedia.org%3AStirling%27s+approximation" class="Z3988"></span></span></li> <li id="cite_note-flajolet-sedgewick-5"><span class="mw-cite-backlink"><b><a href="https://en-m-wikipedia-org.translate.goog/wiki/Stirling's_approximation?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-GB#cite_ref-flajolet-sedgewick_5-0">^</a></b></span> <span class="reference-text"> <link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r1238218222"><cite id="CITEREFFlajoletSedgewick2009" class="citation cs2">Flajolet, Philippe; Sedgewick, Robert (2009), <a href="https://en-m-wikipedia-org.translate.goog/wiki/Analytic_Combinatorics?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-GB" class="mw-redirect" title="Analytic Combinatorics"><i>Analytic Combinatorics</i></a>, Cambridge, UK: Cambridge University Press, p. 555, <a href="https://en-m-wikipedia-org.translate.goog/wiki/Doi_(identifier)?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-GB" class="mw-redirect" title="Doi (identifier)">doi</a>:<a rel="nofollow" class="external text" href="https://translate.google.com/website?sl=auto&tl=en&hl=en-GB&u=https://doi.org/10.1017%252FCBO9780511801655">10.1017/CBO9780511801655</a>, <a href="https://en-m-wikipedia-org.translate.goog/wiki/ISBN_(identifier)?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-GB" class="mw-redirect" title="ISBN (identifier)">ISBN</a> <a href="https://en-m-wikipedia-org.translate.goog/wiki/Special:BookSources/978-0-521-89806-5?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-GB" title="Special:BookSources/978-0-521-89806-5"><bdi>978-0-521-89806-5</bdi></a>, <a href="https://en-m-wikipedia-org.translate.goog/wiki/MR_(identifier)?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-GB" class="mw-redirect" title="MR (identifier)">MR</a> <a rel="nofollow" class="external text" href="https://translate.google.com/website?sl=auto&tl=en&hl=en-GB&u=https://mathscinet.ams.org/mathscinet-getitem?mr%3D2483235">2483235</a>, <a href="https://en-m-wikipedia-org.translate.goog/wiki/S2CID_(identifier)?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-GB" class="mw-redirect" title="S2CID (identifier)">S2CID</a> <a rel="nofollow" class="external text" href="https://translate.google.com/website?sl=auto&tl=en&hl=en-GB&u=https://api.semanticscholar.org/CorpusID:27509971">27509971</a></cite><span title="ctx_ver=Z39.88-2004&rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Abook&rft.genre=book&rft.btitle=Analytic+Combinatorics&rft.place=Cambridge%2C+UK&rft.pages=555&rft.pub=Cambridge+University+Press&rft.date=2009&rft_id=info%3Adoi%2F10.1017%2FCBO9780511801655&rft_id=https%3A%2F%2Fmathscinet.ams.org%2Fmathscinet-getitem%3Fmr%3D2483235%23id-name%3DMR&rft_id=https%3A%2F%2Fapi.semanticscholar.org%2FCorpusID%3A27509971%23id-name%3DS2CID&rft.isbn=978-0-521-89806-5&rft.aulast=Flajolet&rft.aufirst=Philippe&rft.au=Sedgewick%2C+Robert&rfr_id=info%3Asid%2Fen.wikipedia.org%3AStirling%27s+approximation" class="Z3988"></span></span></li> <li id="cite_note-nist-6"><span class="mw-cite-backlink"><b><a href="https://en-m-wikipedia-org.translate.goog/wiki/Stirling's_approximation?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-GB#cite_ref-nist_6-0">^</a></b></span> <span class="reference-text"> <link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r1238218222"><cite id="CITEREFOlverOlde_DaalhuisLozierSchneider" class="citation cs2">Olver, F. W. J.; Olde Daalhuis, A. B.; Lozier, D. W.; Schneider, B. I.; Boisvert, R. F.; Clark, C. W.; Miller, B. R. & Saunders, B. V., <a rel="nofollow" class="external text" href="https://translate.google.com/website?sl=auto&tl=en&hl=en-GB&u=http://dlmf.nist.gov/5.11">"5.11 Gamma function properties: Asymptotic Expansions"</a>, <i>NIST Digital Library of Mathematical Functions</i>, Release 1.0.13 of 2016-09-16</cite><span title="ctx_ver=Z39.88-2004&rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Abook&rft.genre=bookitem&rft.atitle=5.11+Gamma+function+properties%3A+Asymptotic+Expansions&rft.btitle=NIST+Digital+Library+of+Mathematical+Functions&rft.series=Release+1.0.13+of+2016-09-16&rft.aulast=Olver&rft.aufirst=F.+W.+J.&rft.au=Olde+Daalhuis%2C+A.+B.&rft.au=Lozier%2C+D.+W.&rft.au=Schneider%2C+B.+I.&rft.au=Boisvert%2C+R.+F.&rft.au=Clark%2C+C.+W.&rft.au=Miller%2C+B.+R.&rft.au=Saunders%2C+B.+V.&rft_id=http%3A%2F%2Fdlmf.nist.gov%2F5.11&rfr_id=info%3Asid%2Fen.wikipedia.org%3AStirling%27s+approximation" class="Z3988"></span></span></li> <li id="cite_note-Nemes2010-2-7"><span class="mw-cite-backlink"><b><a href="https://en-m-wikipedia-org.translate.goog/wiki/Stirling's_approximation?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-GB#cite_ref-Nemes2010-2_7-0">^</a></b></span> <span class="reference-text"> <link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r1238218222"><cite id="CITEREFNemes2010" class="citation cs2">Nemes, Gergő (2010), "On the coefficients of the asymptotic expansion of <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"> <math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle n!}"><semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi> n </mi> <mo> ! </mo> </mstyle> </mrow> <annotation encoding="application/x-tex"> {\displaystyle n!} </annotation> </semantics> </math></span> <noscript> <img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/bae971720be3cc9b8d82f4cdac89cb89877514a6" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:2.042ex; height:2.176ex;" alt="{\displaystyle n!}"> </noscript><span class="lazy-image-placeholder" style="width: 2.042ex;height: 2.176ex;vertical-align: -0.338ex;" data-src="https://wikimedia.org/api/rest_v1/media/math/render/svg/bae971720be3cc9b8d82f4cdac89cb89877514a6" data-alt="{\displaystyle n!}" data-class="mwe-math-fallback-image-inline mw-invert skin-invert"> </span></span>", <i>Journal of Integer Sequences</i>, <b>13</b> (6): 5</cite><span title="ctx_ver=Z39.88-2004&rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Ajournal&rft.genre=article&rft.jtitle=Journal+of+Integer+Sequences&rft.atitle=On+the+coefficients+of+the+asymptotic+expansion+of+MATH+RENDER+ERROR&rft.volume=13&rft.issue=6&rft.pages=5&rft.date=2010&rft.aulast=Nemes&rft.aufirst=Gerg%C5%91&rfr_id=info%3Asid%2Fen.wikipedia.org%3AStirling%27s+approximation" class="Z3988"></span></span></li> <li id="cite_note-8"><span class="mw-cite-backlink"><b><a href="https://en-m-wikipedia-org.translate.goog/wiki/Stirling's_approximation?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-GB#cite_ref-8">^</a></b></span> <span class="reference-text"> <link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r1238218222"><cite id="CITEREFBenderOrszag2009" class="citation book cs1">Bender, Carl M.; Orszag, Steven A. (2009). <i>Advanced mathematical methods for scientists and engineers. 1: Asymptotic methods and perturbation theory</i> (Nachdr. ed.). New York, NY: Springer. <a href="https://en-m-wikipedia-org.translate.goog/wiki/ISBN_(identifier)?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-GB" class="mw-redirect" title="ISBN (identifier)">ISBN</a> <a href="https://en-m-wikipedia-org.translate.goog/wiki/Special:BookSources/978-0-387-98931-0?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-GB" title="Special:BookSources/978-0-387-98931-0"><bdi>978-0-387-98931-0</bdi></a>.</cite><span title="ctx_ver=Z39.88-2004&rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Abook&rft.genre=book&rft.btitle=Advanced+mathematical+methods+for+scientists+and+engineers.+1%3A+Asymptotic+methods+and+perturbation+theory&rft.place=New+York%2C+NY&rft.edition=Nachdr.&rft.pub=Springer&rft.date=2009&rft.isbn=978-0-387-98931-0&rft.aulast=Bender&rft.aufirst=Carl+M.&rft.au=Orszag%2C+Steven+A.&rfr_id=info%3Asid%2Fen.wikipedia.org%3AStirling%27s+approximation" class="Z3988"></span></span></li> <li id="cite_note-Robbins1955-9"><span class="mw-cite-backlink"><b><a href="https://en-m-wikipedia-org.translate.goog/wiki/Stirling's_approximation?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-GB#cite_ref-Robbins1955_9-0">^</a></b></span> <span class="reference-text"> <link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r1238218222"><cite id="CITEREFRobbins1955" class="citation cs2">Robbins, Herbert (1955), "A Remark on Stirling's Formula", <i>The American Mathematical Monthly</i>, <b>62</b> (1): 26–29, <a href="https://en-m-wikipedia-org.translate.goog/wiki/Doi_(identifier)?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-GB" class="mw-redirect" title="Doi (identifier)">doi</a>:<a rel="nofollow" class="external text" href="https://translate.google.com/website?sl=auto&tl=en&hl=en-GB&u=https://doi.org/10.2307%252F2308012">10.2307/2308012</a>, <a href="https://en-m-wikipedia-org.translate.goog/wiki/JSTOR_(identifier)?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-GB" class="mw-redirect" title="JSTOR (identifier)">JSTOR</a> <a rel="nofollow" class="external text" href="https://translate.google.com/website?sl=auto&tl=en&hl=en-GB&u=https://www.jstor.org/stable/2308012">2308012</a></cite><span title="ctx_ver=Z39.88-2004&rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Ajournal&rft.genre=article&rft.jtitle=The+American+Mathematical+Monthly&rft.atitle=A+Remark+on+Stirling%27s+Formula&rft.volume=62&rft.issue=1&rft.pages=26-29&rft.date=1955&rft_id=info%3Adoi%2F10.2307%2F2308012&rft_id=https%3A%2F%2Fwww.jstor.org%2Fstable%2F2308012%23id-name%3DJSTOR&rft.aulast=Robbins&rft.aufirst=Herbert&rfr_id=info%3Asid%2Fen.wikipedia.org%3AStirling%27s+approximation" class="Z3988"></span></span></li> <li id="cite_note-spiegel-10"><span class="mw-cite-backlink"><b><a href="https://en-m-wikipedia-org.translate.goog/wiki/Stirling's_approximation?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-GB#cite_ref-spiegel_10-0">^</a></b></span> <span class="reference-text"> <link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r1238218222"><cite id="CITEREFSpiegel1999" class="citation cs2">Spiegel, M. R. (1999), <i>Mathematical handbook of formulas and tables</i>, McGraw-Hill, p. 148</cite><span title="ctx_ver=Z39.88-2004&rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Abook&rft.genre=book&rft.btitle=Mathematical+handbook+of+formulas+and+tables&rft.pages=148&rft.pub=McGraw-Hill&rft.date=1999&rft.aulast=Spiegel&rft.aufirst=M.+R.&rfr_id=info%3Asid%2Fen.wikipedia.org%3AStirling%27s+approximation" class="Z3988"></span></span></li> <li id="cite_note-schafke-sattler-11"><span class="mw-cite-backlink"><b><a href="https://en-m-wikipedia-org.translate.goog/wiki/Stirling's_approximation?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-GB#cite_ref-schafke-sattler_11-0">^</a></b></span> <span class="reference-text"> <link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r1238218222"><cite id="CITEREFSchäfkeSattler1990" class="citation cs2">Schäfke, F. W.; Sattler, A. (1990), "Restgliedabschätzungen für die Stirlingsche Reihe", <i>Note di Matematica</i>, <b>10</b> (suppl. 2): 453–470, <a href="https://en-m-wikipedia-org.translate.goog/wiki/MR_(identifier)?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-GB" class="mw-redirect" title="MR (identifier)">MR</a> <a rel="nofollow" class="external text" href="https://translate.google.com/website?sl=auto&tl=en&hl=en-GB&u=https://mathscinet.ams.org/mathscinet-getitem?mr%3D1221957">1221957</a></cite><span title="ctx_ver=Z39.88-2004&rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Ajournal&rft.genre=article&rft.jtitle=Note+di+Matematica&rft.atitle=Restgliedabsch%C3%A4tzungen+f%C3%BCr+die+Stirlingsche+Reihe&rft.volume=10&rft.issue=suppl.+2&rft.pages=453-470&rft.date=1990&rft_id=https%3A%2F%2Fmathscinet.ams.org%2Fmathscinet-getitem%3Fmr%3D1221957%23id-name%3DMR&rft.aulast=Sch%C3%A4fke&rft.aufirst=F.+W.&rft.au=Sattler%2C+A.&rfr_id=info%3Asid%2Fen.wikipedia.org%3AStirling%27s+approximation" class="Z3988"></span></span></li> <li id="cite_note-nemes15-12"><span class="mw-cite-backlink"><b><a href="https://en-m-wikipedia-org.translate.goog/wiki/Stirling's_approximation?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-GB#cite_ref-nemes15_12-0">^</a></b></span> <span class="reference-text">G. Nemes, Error bounds and exponential improvements for the asymptotic expansions of the gamma function and its reciprocal, <i>Proc. Roy. Soc. Edinburgh Sect. A</i> <b>145</b> (2015), 571–596.</span></li> <li id="cite_note-bayes-canton-13"><span class="mw-cite-backlink"><b><a href="https://en-m-wikipedia-org.translate.goog/wiki/Stirling's_approximation?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-GB#cite_ref-bayes-canton_13-0">^</a></b></span> <span class="reference-text"> <link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r1238218222"><cite id="CITEREFBayes1763" class="citation cs2">Bayes, Thomas (24 November 1763), <a rel="nofollow" class="external text" href="https://translate.google.com/website?sl=auto&tl=en&hl=en-GB&u=http://www.york.ac.uk/depts/maths/histstat/letter.pdf">"A letter from the late Reverend Mr. Thomas Bayes, F. R. S. to John Canton, M. A. and F. R. S."</a> <span class="cs1-format">(PDF)</span>, <i>Philosophical Transactions of the Royal Society of London, Series I</i>, <b>53</b>: 269, <a href="https://en-m-wikipedia-org.translate.goog/wiki/Bibcode_(identifier)?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-GB" class="mw-redirect" title="Bibcode (identifier)">Bibcode</a>:<a rel="nofollow" class="external text" href="https://translate.google.com/website?sl=auto&tl=en&hl=en-GB&u=https://ui.adsabs.harvard.edu/abs/1763RSPT...53..269B">1763RSPT...53..269B</a>, <a rel="nofollow" class="external text" href="https://translate.google.com/website?sl=auto&tl=en&hl=en-GB&u=https://web.archive.org/web/20120128050439/http://www.york.ac.uk/depts/maths/histstat/letter.pdf">archived</a> <span class="cs1-format">(PDF)</span> from the original on 2012-01-28<span class="reference-accessdate">, retrieved <span class="nowrap">2012-03-01</span></span></cite><span title="ctx_ver=Z39.88-2004&rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Ajournal&rft.genre=article&rft.jtitle=Philosophical+Transactions+of+the+Royal+Society+of+London%2C+Series+I&rft.atitle=A+letter+from+the+late+Reverend+Mr.+Thomas+Bayes%2C+F.+R.+S.+to+John+Canton%2C+M.+A.+and+F.+R.+S.&rft.volume=53&rft.pages=269&rft.date=1763-11-24&rft_id=info%3Abibcode%2F1763RSPT...53..269B&rft.aulast=Bayes&rft.aufirst=Thomas&rft_id=http%3A%2F%2Fwww.york.ac.uk%2Fdepts%2Fmaths%2Fhiststat%2Fletter.pdf&rfr_id=info%3Asid%2Fen.wikipedia.org%3AStirling%27s+approximation" class="Z3988"></span></span></li> <li id="cite_note-14"><span class="mw-cite-backlink"><b><a href="https://en-m-wikipedia-org.translate.goog/wiki/Stirling's_approximation?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-GB#cite_ref-14">^</a></b></span> <span class="reference-text"> <link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r1238218222"><cite id="CITEREFArtin2015" class="citation book cs1">Artin, Emil (2015). <i>The Gamma Function</i>. Dover. p. 24.</cite><span title="ctx_ver=Z39.88-2004&rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Abook&rft.genre=book&rft.btitle=The+Gamma+Function&rft.pages=24&rft.pub=Dover&rft.date=2015&rft.aulast=Artin&rft.aufirst=Emil&rfr_id=info%3Asid%2Fen.wikipedia.org%3AStirling%27s+approximation" class="Z3988"></span></span></li> <li id="cite_note-toth-15"><span class="mw-cite-backlink"><b><a href="https://en-m-wikipedia-org.translate.goog/wiki/Stirling's_approximation?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-GB#cite_ref-toth_15-0">^</a></b></span> <span class="reference-text"><a rel="nofollow" class="external text" href="https://translate.google.com/website?sl=auto&tl=en&hl=en-GB&u=http://www.rskey.org/gamma.htm">Toth, V. T. <i>Programmable Calculators: Calculators and the Gamma Function</i> (2006)</a> <a rel="nofollow" class="external text" href="https://translate.google.com/website?sl=auto&tl=en&hl=en-GB&u=https://web.archive.org/web/20051231063913/http://www.rskey.org/gamma.htm">Archived</a> 2005-12-31 at the <a href="https://en-m-wikipedia-org.translate.goog/wiki/Wayback_Machine?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-GB" title="Wayback Machine">Wayback Machine</a>.</span></li> <li id="cite_note-Nemes2010-16"><span class="mw-cite-backlink"><b><a href="https://en-m-wikipedia-org.translate.goog/wiki/Stirling's_approximation?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-GB#cite_ref-Nemes2010_16-0">^</a></b></span> <span class="reference-text"> <link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r1238218222"><cite id="CITEREFNemes2010" class="citation cs2">Nemes, Gergő (2010), "New asymptotic expansion for the Gamma function", <i>Archiv der Mathematik</i>, <b>95</b> (2): 161–169, <a href="https://en-m-wikipedia-org.translate.goog/wiki/Doi_(identifier)?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-GB" class="mw-redirect" title="Doi (identifier)">doi</a>:<a rel="nofollow" class="external text" href="https://translate.google.com/website?sl=auto&tl=en&hl=en-GB&u=https://doi.org/10.1007%252Fs00013-010-0146-9">10.1007/s00013-010-0146-9</a>, <a href="https://en-m-wikipedia-org.translate.goog/wiki/S2CID_(identifier)?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-GB" class="mw-redirect" title="S2CID (identifier)">S2CID</a> <a rel="nofollow" class="external text" href="https://translate.google.com/website?sl=auto&tl=en&hl=en-GB&u=https://api.semanticscholar.org/CorpusID:121820640">121820640</a></cite><span title="ctx_ver=Z39.88-2004&rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Ajournal&rft.genre=article&rft.jtitle=Archiv+der+Mathematik&rft.atitle=New+asymptotic+expansion+for+the+Gamma+function&rft.volume=95&rft.issue=2&rft.pages=161-169&rft.date=2010&rft_id=info%3Adoi%2F10.1007%2Fs00013-010-0146-9&rft_id=https%3A%2F%2Fapi.semanticscholar.org%2FCorpusID%3A121820640%23id-name%3DS2CID&rft.aulast=Nemes&rft.aufirst=Gerg%C5%91&rfr_id=info%3Asid%2Fen.wikipedia.org%3AStirling%27s+approximation" class="Z3988"></span></span></li> <li id="cite_note-17"><span class="mw-cite-backlink"><b><a href="https://en-m-wikipedia-org.translate.goog/wiki/Stirling's_approximation?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-GB#cite_ref-17">^</a></b></span> <span class="reference-text"> <link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r1238218222"><cite id="CITEREFRamanujan1920" class="citation cs2"><a href="https://en-m-wikipedia-org.translate.goog/wiki/Srinivasa_Ramanujan?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-GB" title="Srinivasa Ramanujan">Ramanujan, Srinivasa</a> (14 August 1920), <a rel="nofollow" class="external text" href="https://translate.google.com/website?sl=auto&tl=en&hl=en-GB&u=https://archive.org/details/lost-notebook/page/n337/"><i>Lost Notebook and Other Unpublished Papers</i></a>, p. 339 – via Internet Archive</cite><span title="ctx_ver=Z39.88-2004&rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Abook&rft.genre=book&rft.btitle=Lost+Notebook+and+Other+Unpublished+Papers&rft.pages=339&rft.date=1920-08-14&rft.aulast=Ramanujan&rft.aufirst=Srinivasa&rft_id=https%3A%2F%2Farchive.org%2Fdetails%2Flost-notebook%2Fpage%2Fn337%2F&rfr_id=info%3Asid%2Fen.wikipedia.org%3AStirling%27s+approximation" class="Z3988"></span></span></li> <li id="cite_note-E.A.Karatsuba-18"><span class="mw-cite-backlink"><b><a href="https://en-m-wikipedia-org.translate.goog/wiki/Stirling's_approximation?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-GB#cite_ref-E.A.Karatsuba_18-0">^</a></b></span> <span class="reference-text"> <link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r1238218222"><cite id="CITEREFKaratsuba2001" class="citation cs2">Karatsuba, Ekatherina A. (2001), "On the asymptotic representation of the Euler gamma function by Ramanujan", <i>Journal of Computational and Applied Mathematics</i>, <b>135</b> (2): 225–240, <a href="https://en-m-wikipedia-org.translate.goog/wiki/Bibcode_(identifier)?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-GB" class="mw-redirect" title="Bibcode (identifier)">Bibcode</a>:<a rel="nofollow" class="external text" href="https://translate.google.com/website?sl=auto&tl=en&hl=en-GB&u=https://ui.adsabs.harvard.edu/abs/2001JCoAM.135..225K">2001JCoAM.135..225K</a>, <a href="https://en-m-wikipedia-org.translate.goog/wiki/Doi_(identifier)?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-GB" class="mw-redirect" title="Doi (identifier)">doi</a>:<span class="id-lock-free" title="Freely accessible"><a rel="nofollow" class="external text" href="https://translate.google.com/website?sl=auto&tl=en&hl=en-GB&u=https://doi.org/10.1016%252FS0377-0427%252800%252900586-0">10.1016/S0377-0427(00)00586-0</a></span>, <a href="https://en-m-wikipedia-org.translate.goog/wiki/MR_(identifier)?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-GB" class="mw-redirect" title="MR (identifier)">MR</a> <a rel="nofollow" class="external text" href="https://translate.google.com/website?sl=auto&tl=en&hl=en-GB&u=https://mathscinet.ams.org/mathscinet-getitem?mr%3D1850542">1850542</a></cite><span title="ctx_ver=Z39.88-2004&rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Ajournal&rft.genre=article&rft.jtitle=Journal+of+Computational+and+Applied+Mathematics&rft.atitle=On+the+asymptotic+representation+of+the+Euler+gamma+function+by+Ramanujan&rft.volume=135&rft.issue=2&rft.pages=225-240&rft.date=2001&rft_id=https%3A%2F%2Fmathscinet.ams.org%2Fmathscinet-getitem%3Fmr%3D1850542%23id-name%3DMR&rft_id=info%3Adoi%2F10.1016%2FS0377-0427%2800%2900586-0&rft_id=info%3Abibcode%2F2001JCoAM.135..225K&rft.aulast=Karatsuba&rft.aufirst=Ekatherina+A.&rfr_id=info%3Asid%2Fen.wikipedia.org%3AStirling%27s+approximation" class="Z3988"></span></span></li> <li id="cite_note-Mortici2011-1-19"><span class="mw-cite-backlink"><b><a href="https://en-m-wikipedia-org.translate.goog/wiki/Stirling's_approximation?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-GB#cite_ref-Mortici2011-1_19-0">^</a></b></span> <span class="reference-text"> <link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r1238218222"><cite id="CITEREFMortici2011" class="citation cs2">Mortici, Cristinel (2011), "Ramanujan's estimate for the gamma function via monotonicity arguments", <i>Ramanujan J.</i>, <b>25</b> (2): 149–154, <a href="https://en-m-wikipedia-org.translate.goog/wiki/Doi_(identifier)?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-GB" class="mw-redirect" title="Doi (identifier)">doi</a>:<a rel="nofollow" class="external text" href="https://translate.google.com/website?sl=auto&tl=en&hl=en-GB&u=https://doi.org/10.1007%252Fs11139-010-9265-y">10.1007/s11139-010-9265-y</a>, <a href="https://en-m-wikipedia-org.translate.goog/wiki/S2CID_(identifier)?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-GB" class="mw-redirect" title="S2CID (identifier)">S2CID</a> <a rel="nofollow" class="external text" href="https://translate.google.com/website?sl=auto&tl=en&hl=en-GB&u=https://api.semanticscholar.org/CorpusID:119530041">119530041</a></cite><span title="ctx_ver=Z39.88-2004&rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Ajournal&rft.genre=article&rft.jtitle=Ramanujan+J.&rft.atitle=Ramanujan%27s+estimate+for+the+gamma+function+via+monotonicity+arguments&rft.volume=25&rft.issue=2&rft.pages=149-154&rft.date=2011&rft_id=info%3Adoi%2F10.1007%2Fs11139-010-9265-y&rft_id=https%3A%2F%2Fapi.semanticscholar.org%2FCorpusID%3A119530041%23id-name%3DS2CID&rft.aulast=Mortici&rft.aufirst=Cristinel&rfr_id=info%3Asid%2Fen.wikipedia.org%3AStirling%27s+approximation" class="Z3988"></span></span></li> <li id="cite_note-Mortici2011-2-20"><span class="mw-cite-backlink"><b><a href="https://en-m-wikipedia-org.translate.goog/wiki/Stirling's_approximation?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-GB#cite_ref-Mortici2011-2_20-0">^</a></b></span> <span class="reference-text"> <link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r1238218222"><cite id="CITEREFMortici2011" class="citation cs2">Mortici, Cristinel (2011), "Improved asymptotic formulas for the gamma function", <i>Comput. Math. Appl.</i>, <b>61</b> (11): 3364–3369, <a href="https://en-m-wikipedia-org.translate.goog/wiki/Doi_(identifier)?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-GB" class="mw-redirect" title="Doi (identifier)">doi</a>:<a rel="nofollow" class="external text" href="https://translate.google.com/website?sl=auto&tl=en&hl=en-GB&u=https://doi.org/10.1016%252Fj.camwa.2011.04.036">10.1016/j.camwa.2011.04.036</a></cite><span title="ctx_ver=Z39.88-2004&rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Ajournal&rft.genre=article&rft.jtitle=Comput.+Math.+Appl.&rft.atitle=Improved+asymptotic+formulas+for+the+gamma+function&rft.volume=61&rft.issue=11&rft.pages=3364-3369&rft.date=2011&rft_id=info%3Adoi%2F10.1016%2Fj.camwa.2011.04.036&rft.aulast=Mortici&rft.aufirst=Cristinel&rfr_id=info%3Asid%2Fen.wikipedia.org%3AStirling%27s+approximation" class="Z3988"></span>.</span></li> <li id="cite_note-Mortici2011-3-21"><span class="mw-cite-backlink"><b><a href="https://en-m-wikipedia-org.translate.goog/wiki/Stirling's_approximation?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-GB#cite_ref-Mortici2011-3_21-0">^</a></b></span> <span class="reference-text"> <link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r1238218222"><cite id="CITEREFMortici2011" class="citation cs2">Mortici, Cristinel (2011), "On Ramanujan's large argument formula for the gamma function", <i>Ramanujan J.</i>, <b>26</b> (2): 185–192, <a href="https://en-m-wikipedia-org.translate.goog/wiki/Doi_(identifier)?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-GB" class="mw-redirect" title="Doi (identifier)">doi</a>:<a rel="nofollow" class="external text" href="https://translate.google.com/website?sl=auto&tl=en&hl=en-GB&u=https://doi.org/10.1007%252Fs11139-010-9281-y">10.1007/s11139-010-9281-y</a>, <a href="https://en-m-wikipedia-org.translate.goog/wiki/S2CID_(identifier)?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-GB" class="mw-redirect" title="S2CID (identifier)">S2CID</a> <a rel="nofollow" class="external text" href="https://translate.google.com/website?sl=auto&tl=en&hl=en-GB&u=https://api.semanticscholar.org/CorpusID:120371952">120371952</a></cite><span title="ctx_ver=Z39.88-2004&rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Ajournal&rft.genre=article&rft.jtitle=Ramanujan+J.&rft.atitle=On+Ramanujan%27s+large+argument+formula+for+the+gamma+function&rft.volume=26&rft.issue=2&rft.pages=185-192&rft.date=2011&rft_id=info%3Adoi%2F10.1007%2Fs11139-010-9281-y&rft_id=https%3A%2F%2Fapi.semanticscholar.org%2FCorpusID%3A120371952%23id-name%3DS2CID&rft.aulast=Mortici&rft.aufirst=Cristinel&rfr_id=info%3Asid%2Fen.wikipedia.org%3AStirling%27s+approximation" class="Z3988"></span>.</span></li> </ol> </div> </div> </section> <div class="mw-heading mw-heading2 section-heading" onclick="mfTempOpenSection(11)"> <span class="indicator mf-icon mf-icon-expand mf-icon--small"></span> <h2 id="Further_reading">Further reading</h2><span class="mw-editsection"> <a role="button" href="https://en-m-wikipedia-org.translate.goog/w/index.php?title=Stirling's_approximation&action=edit&section=13&_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-GB" title="Edit section: Further reading" class="cdx-button cdx-button--size-large cdx-button--fake-button cdx-button--fake-button--enabled cdx-button--icon-only cdx-button--weight-quiet "> <span class="minerva-icon minerva-icon--edit"></span> <span>edit</span> </a> </span> </div> <section class="mf-section-11 collapsible-block" id="mf-section-11"> <ul> <li> <link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r1238218222"><cite id="CITEREFAbramowitzStegun2002" class="citation cs2">Abramowitz, M. & Stegun, I. (2002), <a href="https://en-m-wikipedia-org.translate.goog/wiki/Abramowitz_and_Stegun?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-GB" title="Abramowitz and Stegun"><i>Handbook of Mathematical Functions</i></a></cite><span title="ctx_ver=Z39.88-2004&rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Abook&rft.genre=book&rft.btitle=Handbook+of+Mathematical+Functions&rft.date=2002&rft.aulast=Abramowitz&rft.aufirst=M.&rft.au=Stegun%2C+I.&rfr_id=info%3Asid%2Fen.wikipedia.org%3AStirling%27s+approximation" class="Z3988"></span></li> <li> <link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r1238218222"><cite id="CITEREFParisKaminski2001" class="citation cs2">Paris, R. B. & Kaminski, D. (2001), <span class="id-lock-registration" title="Free registration required"><a rel="nofollow" class="external text" href="https://translate.google.com/website?sl=auto&tl=en&hl=en-GB&u=https://archive.org/details/asymptoticsmelli0000pari"><i>Asymptotics and Mellin–Barnes Integrals</i></a></span>, New York: Cambridge University Press, <a href="https://en-m-wikipedia-org.translate.goog/wiki/ISBN_(identifier)?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-GB" class="mw-redirect" title="ISBN (identifier)">ISBN</a> <a href="https://en-m-wikipedia-org.translate.goog/wiki/Special:BookSources/978-0-521-79001-7?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-GB" title="Special:BookSources/978-0-521-79001-7"><bdi>978-0-521-79001-7</bdi></a></cite><span title="ctx_ver=Z39.88-2004&rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Abook&rft.genre=book&rft.btitle=Asymptotics+and+Mellin%E2%80%93Barnes+Integrals&rft.place=New+York&rft.pub=Cambridge+University+Press&rft.date=2001&rft.isbn=978-0-521-79001-7&rft.aulast=Paris&rft.aufirst=R.+B.&rft.au=Kaminski%2C+D.&rft_id=https%3A%2F%2Farchive.org%2Fdetails%2Fasymptoticsmelli0000pari&rfr_id=info%3Asid%2Fen.wikipedia.org%3AStirling%27s+approximation" class="Z3988"></span></li> <li> <link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r1238218222"><cite id="CITEREFWhittakerWatson1996" class="citation cs2">Whittaker, E. T. & Watson, G. N. (1996), <i>A Course in Modern Analysis</i> (4th ed.), New York: Cambridge University Press, <a href="https://en-m-wikipedia-org.translate.goog/wiki/ISBN_(identifier)?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-GB" class="mw-redirect" title="ISBN (identifier)">ISBN</a> <a href="https://en-m-wikipedia-org.translate.goog/wiki/Special:BookSources/978-0-521-58807-2?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-GB" title="Special:BookSources/978-0-521-58807-2"><bdi>978-0-521-58807-2</bdi></a></cite><span title="ctx_ver=Z39.88-2004&rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Abook&rft.genre=book&rft.btitle=A+Course+in+Modern+Analysis&rft.place=New+York&rft.edition=4th&rft.pub=Cambridge+University+Press&rft.date=1996&rft.isbn=978-0-521-58807-2&rft.aulast=Whittaker&rft.aufirst=E.+T.&rft.au=Watson%2C+G.+N.&rfr_id=info%3Asid%2Fen.wikipedia.org%3AStirling%27s+approximation" class="Z3988"></span></li> <li> <link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r1238218222"><cite id="CITEREFRomik2000" class="citation cs2">Romik, Dan (2000), "Stirling's approximation for <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"> <math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle n!}"><semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi> n </mi> <mo> ! </mo> </mstyle> </mrow> <annotation encoding="application/x-tex"> {\displaystyle n!} </annotation> </semantics> </math></span> <noscript> <img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/bae971720be3cc9b8d82f4cdac89cb89877514a6" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:2.042ex; height:2.176ex;" alt="{\displaystyle n!}"> </noscript><span class="lazy-image-placeholder" style="width: 2.042ex;height: 2.176ex;vertical-align: -0.338ex;" data-src="https://wikimedia.org/api/rest_v1/media/math/render/svg/bae971720be3cc9b8d82f4cdac89cb89877514a6" data-alt="{\displaystyle n!}" data-class="mwe-math-fallback-image-inline mw-invert skin-invert"> </span></span>: the ultimate short proof?", <i><a href="https://en-m-wikipedia-org.translate.goog/wiki/The_American_Mathematical_Monthly?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-GB" title="The American Mathematical Monthly">The American Mathematical Monthly</a></i>, <b>107</b> (6): 556–557, <a href="https://en-m-wikipedia-org.translate.goog/wiki/Doi_(identifier)?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-GB" class="mw-redirect" title="Doi (identifier)">doi</a>:<a rel="nofollow" class="external text" href="https://translate.google.com/website?sl=auto&tl=en&hl=en-GB&u=https://doi.org/10.2307%252F2589351">10.2307/2589351</a>, <a href="https://en-m-wikipedia-org.translate.goog/wiki/JSTOR_(identifier)?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-GB" class="mw-redirect" title="JSTOR (identifier)">JSTOR</a> <a rel="nofollow" class="external text" href="https://translate.google.com/website?sl=auto&tl=en&hl=en-GB&u=https://www.jstor.org/stable/2589351">2589351</a>, <a href="https://en-m-wikipedia-org.translate.goog/wiki/MR_(identifier)?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-GB" class="mw-redirect" title="MR (identifier)">MR</a> <a rel="nofollow" class="external text" href="https://translate.google.com/website?sl=auto&tl=en&hl=en-GB&u=https://mathscinet.ams.org/mathscinet-getitem?mr%3D1767064">1767064</a></cite><span title="ctx_ver=Z39.88-2004&rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Ajournal&rft.genre=article&rft.jtitle=The+American+Mathematical+Monthly&rft.atitle=Stirling%27s+approximation+for+MATH+RENDER+ERROR%3A+the+ultimate+short+proof%3F&rft.volume=107&rft.issue=6&rft.pages=556-557&rft.date=2000&rft_id=https%3A%2F%2Fmathscinet.ams.org%2Fmathscinet-getitem%3Fmr%3D1767064%23id-name%3DMR&rft_id=https%3A%2F%2Fwww.jstor.org%2Fstable%2F2589351%23id-name%3DJSTOR&rft_id=info%3Adoi%2F10.2307%2F2589351&rft.aulast=Romik&rft.aufirst=Dan&rfr_id=info%3Asid%2Fen.wikipedia.org%3AStirling%27s+approximation" class="Z3988"></span></li> <li> <link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r1238218222"><cite id="CITEREFLi2006" class="citation cs2">Li, Yuan-Chuan (July 2006), <a rel="nofollow" class="external text" href="https://translate.google.com/website?sl=auto&tl=en&hl=en-GB&u=https://projecteuclid.org/euclid.rae/1184700051">"A note on an identity of the gamma function and Stirling's formula"</a>, <i>Real Analysis Exchange</i>, <b>32</b> (1): 267–271, <a href="https://en-m-wikipedia-org.translate.goog/wiki/MR_(identifier)?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-GB" class="mw-redirect" title="MR (identifier)">MR</a> <a rel="nofollow" class="external text" href="https://translate.google.com/website?sl=auto&tl=en&hl=en-GB&u=https://mathscinet.ams.org/mathscinet-getitem?mr%3D2329236">2329236</a></cite><span title="ctx_ver=Z39.88-2004&rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Ajournal&rft.genre=article&rft.jtitle=Real+Analysis+Exchange&rft.atitle=A+note+on+an+identity+of+the+gamma+function+and+Stirling%27s+formula&rft.volume=32&rft.issue=1&rft.pages=267-271&rft.date=2006-07&rft_id=https%3A%2F%2Fmathscinet.ams.org%2Fmathscinet-getitem%3Fmr%3D2329236%23id-name%3DMR&rft.aulast=Li&rft.aufirst=Yuan-Chuan&rft_id=https%3A%2F%2Fprojecteuclid.org%2Feuclid.rae%2F1184700051&rfr_id=info%3Asid%2Fen.wikipedia.org%3AStirling%27s+approximation" class="Z3988"></span></li> </ul> <div class="mw-references-wrap"> <ol class="references"> <li id="cite_note-mathematica-program-4"><span class="mw-cite-backlink"><b><a href="https://en-m-wikipedia-org.translate.goog/wiki/Stirling's_approximation?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-GB#cite_ref-mathematica-program_4-0">^</a></b></span> <span class="reference-text">For example, a program in Mathematica: <div class="mw-highlight mw-highlight-lang-mathematica mw-content-ltr" dir="ltr"> <pre><span></span><span class="n">series</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">tau</span><span class="w"> </span><span class="o">-</span><span class="w"> </span><span class="n">tau</span><span class="o">^</span><span class="mi">2</span><span class="o">/</span><span class="mi">6</span><span class="w"> </span><span class="o">+</span><span class="w"> </span><span class="n">tau</span><span class="o">^</span><span class="mi">3</span><span class="o">/</span><span class="mi">36</span><span class="w"> </span><span class="o">+</span><span class="w"> </span><span class="n">tau</span><span class="o">^</span><span class="mi">4</span><span class="o">*</span><span class="n">a</span><span class="w"> </span><span class="o">+</span><span class="w"> </span><span class="n">tau</span><span class="o">^</span><span class="mi">5</span><span class="o">*</span><span class="n">b</span><span class="p">;</span> <span class="c">(*pick the right a,b to make the series equal 0 at higher orders*)</span> <span class="n">Series</span><span class="p">[</span><span class="n">tau</span><span class="o">^</span><span class="mi">2</span><span class="o">/</span><span class="mi">2</span><span class="w"> </span><span class="o">+</span><span class="w"> </span><span class="mi">1</span><span class="w"> </span><span class="o">+</span><span class="w"> </span><span class="n">t</span><span class="w"> </span><span class="o">-</span><span class="w"> </span><span class="n">Exp</span><span class="p">[</span><span class="n">t</span><span class="p">]</span><span class="w"> </span><span class="o">/.</span><span class="w"> </span><span class="n">t</span><span class="w"> </span><span class="o">-></span><span class="w"> </span><span class="n">series</span><span class="p">,</span><span class="w"> </span><span class="p">{</span><span class="n">tau</span><span class="p">,</span><span class="w"> </span><span class="mi">0</span><span class="p">,</span><span class="w"> </span><span class="mi">8</span><span class="p">}]</span> <span class="c">(*now do the integral*)</span> <span class="n">integral</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">Integrate</span><span class="p">[</span><span class="n">Exp</span><span class="p">[</span><span class="o">-</span><span class="n">x</span><span class="o">*</span><span class="n">tau</span><span class="o">^</span><span class="mi">2</span><span class="o">/</span><span class="mi">2</span><span class="p">]</span><span class="w"> </span><span class="o">*</span><span class="w"> </span><span class="n">D</span><span class="p">[</span><span class="n">series</span><span class="w"> </span><span class="o">/.</span><span class="w"> </span><span class="n">a</span><span class="w"> </span><span class="o">-></span><span class="w"> </span><span class="mi">0</span><span class="w"> </span><span class="o">/.</span><span class="w"> </span><span class="n">b</span><span class="w"> </span><span class="o">-></span><span class="w"> </span><span class="mi">0</span><span class="p">,</span><span class="w"> </span><span class="n">tau</span><span class="p">],</span><span class="w"> </span><span class="p">{</span><span class="n">tau</span><span class="p">,</span><span class="w"> </span><span class="o">-</span><span class="n">Infinity</span><span class="p">,</span><span class="w"> </span><span class="n">Infinity</span><span class="p">}];</span> <span class="n">Simplify</span><span class="p">[</span><span class="n">integral</span><span class="o">/</span><span class="n">Sqrt</span><span class="p">[</span><span class="mi">2</span><span class="o">*</span><span class="n">Pi</span><span class="p">]</span><span class="o">*</span><span class="n">Sqrt</span><span class="p">[</span><span class="n">x</span><span class="p">]]</span> </pre> </div></span></li> </ol> </div> <link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r1239543626"> <div class="reflist reflist-lower-alpha"> </div> </section> <div class="mw-heading mw-heading2 section-heading" onclick="mfTempOpenSection(12)"> <span class="indicator mf-icon mf-icon-expand mf-icon--small"></span> <h2 id="External_links">External links</h2><span class="mw-editsection"> <a role="button" href="https://en-m-wikipedia-org.translate.goog/w/index.php?title=Stirling's_approximation&action=edit&section=14&_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-GB" title="Edit section: External links" class="cdx-button cdx-button--size-large cdx-button--fake-button cdx-button--fake-button--enabled cdx-button--icon-only cdx-button--weight-quiet "> <span class="minerva-icon minerva-icon--edit"></span> <span>edit</span> </a> </span> </div> <section class="mf-section-12 collapsible-block" id="mf-section-12"> <style data-mw-deduplicate="TemplateStyles:r1235681985">.mw-parser-output .side-box{margin:4px 0;box-sizing:border-box;border:1px solid #aaa;font-size:88%;line-height:1.25em;background-color:var(--background-color-interactive-subtle,#f8f9fa);display:flow-root}.mw-parser-output .side-box-abovebelow,.mw-parser-output .side-box-text{padding:0.25em 0.9em}.mw-parser-output .side-box-image{padding:2px 0 2px 0.9em;text-align:center}.mw-parser-output .side-box-imageright{padding:2px 0.9em 2px 0;text-align:center}@media(min-width:500px){.mw-parser-output .side-box-flex{display:flex;align-items:center}.mw-parser-output .side-box-text{flex:1;min-width:0}}@media(min-width:720px){.mw-parser-output .side-box{width:238px}.mw-parser-output .side-box-right{clear:right;float:right;margin-left:1em}.mw-parser-output .side-box-left{margin-right:1em}}</style> <style data-mw-deduplicate="TemplateStyles:r1237033735">@media print{body.ns-0 .mw-parser-output .sistersitebox{display:none!important}}@media screen{html.skin-theme-clientpref-night .mw-parser-output .sistersitebox img[src*="Wiktionary-logo-en-v2.svg"]{background-color:white}}@media screen and (prefers-color-scheme:dark){html.skin-theme-clientpref-os .mw-parser-output .sistersitebox img[src*="Wiktionary-logo-en-v2.svg"]{background-color:white}}</style> <div class="side-box side-box-right plainlinks sistersitebox"> <style data-mw-deduplicate="TemplateStyles:r1126788409">.mw-parser-output .plainlist ol,.mw-parser-output .plainlist ul{line-height:inherit;list-style:none;margin:0;padding:0}.mw-parser-output .plainlist ol li,.mw-parser-output .plainlist ul li{margin-bottom:0}</style> <div class="side-box-flex"> <div class="side-box-image"> <span class="noviewer" typeof="mw:File"><span> <noscript> <img alt="" src="//upload.wikimedia.org/wikipedia/en/thumb/4/4a/Commons-logo.svg/30px-Commons-logo.svg.png" decoding="async" width="30" height="40" class="mw-file-element" data-file-width="1024" data-file-height="1376"> </noscript><span class="lazy-image-placeholder" style="width: 30px;height: 40px;" data-src="//upload.wikimedia.org/wikipedia/en/thumb/4/4a/Commons-logo.svg/30px-Commons-logo.svg.png" data-alt="" data-width="30" data-height="40" data-srcset="//upload.wikimedia.org/wikipedia/en/thumb/4/4a/Commons-logo.svg/45px-Commons-logo.svg.png 1.5x, //upload.wikimedia.org/wikipedia/en/thumb/4/4a/Commons-logo.svg/59px-Commons-logo.svg.png 2x" data-class="mw-file-element"> </span></span></span> </div> <div class="side-box-text plainlist"> Wikimedia Commons has media related to <span style="font-weight: bold; font-style: italic;"><a href="https://translate.google.com/website?sl=auto&tl=en&hl=en-GB&u=https://commons.wikimedia.org/wiki/Category:Stirling%2527s_approximation" class="extiw" title="commons:Category:Stirling's approximation">Stirling's approximation</a></span>. </div> </div> </div> <ul> <li> <link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r1238218222"><cite class="citation cs2"><a rel="nofollow" class="external text" href="https://translate.google.com/website?sl=auto&tl=en&hl=en-GB&u=https://www.encyclopediaofmath.org/index.php?title%3DStirling_formula">"Stirling_formula"</a>, <i><a href="https://en-m-wikipedia-org.translate.goog/wiki/Encyclopedia_of_Mathematics?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-GB" title="Encyclopedia of Mathematics">Encyclopedia of Mathematics</a></i>, <a href="https://en-m-wikipedia-org.translate.goog/wiki/European_Mathematical_Society?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-GB" title="European Mathematical Society">EMS Press</a>, 2001 [1994]</cite><span title="ctx_ver=Z39.88-2004&rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Abook&rft.genre=bookitem&rft.atitle=Stirling_formula&rft.btitle=Encyclopedia+of+Mathematics&rft.pub=EMS+Press&rft.date=2001&rft_id=https%3A%2F%2Fwww.encyclopediaofmath.org%2Findex.php%3Ftitle%3DStirling_formula&rfr_id=info%3Asid%2Fen.wikipedia.org%3AStirling%27s+approximation" class="Z3988"></span></li> <li><a rel="nofollow" class="external text" href="https://translate.google.com/website?sl=auto&tl=en&hl=en-GB&u=http://www.luschny.de/math/factorial/approx/SimpleCases.html">Peter Luschny, <i>Approximation formulas for the factorial function n!</i></a></li> <li><span class="citation mathworld" id="Reference-Mathworld-Stirling's_Approximation"> <link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r1238218222"><cite id="CITEREFWeisstein" class="citation web cs2"><a href="https://en-m-wikipedia-org.translate.goog/wiki/Eric_W._Weisstein?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-GB" title="Eric W. Weisstein">Weisstein, Eric W.</a>, <a rel="nofollow" class="external text" href="https://translate.google.com/website?sl=auto&tl=en&hl=en-GB&u=https://mathworld.wolfram.com/StirlingsApproximation.html">"Stirling's Approximation"</a>, <i><a href="https://en-m-wikipedia-org.translate.goog/wiki/MathWorld?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-GB" title="MathWorld">MathWorld</a></i></cite><span title="ctx_ver=Z39.88-2004&rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Ajournal&rft.genre=unknown&rft.jtitle=MathWorld&rft.atitle=Stirling%27s+Approximation&rft.au=Weisstein%2C+Eric+W.&rft_id=https%3A%2F%2Fmathworld.wolfram.com%2FStirlingsApproximation.html&rfr_id=info%3Asid%2Fen.wikipedia.org%3AStirling%27s+approximation" class="Z3988"></span></span></li> <li><a rel="nofollow" class="external text" href="https://translate.google.com/website?sl=auto&tl=en&hl=en-GB&u=https://planetmath.org/StirlingsApproximation">Stirling's approximation</a> at <a href="https://en-m-wikipedia-org.translate.goog/wiki/PlanetMath?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-GB" title="PlanetMath">PlanetMath</a>.</li> </ul> <div class="navbox-styles"> <style data-mw-deduplicate="TemplateStyles:r1129693374">.mw-parser-output .hlist dl,.mw-parser-output .hlist ol,.mw-parser-output .hlist ul{margin:0;padding:0}.mw-parser-output .hlist dd,.mw-parser-output .hlist dt,.mw-parser-output .hlist li{margin:0;display:inline}.mw-parser-output .hlist.inline,.mw-parser-output .hlist.inline dl,.mw-parser-output .hlist.inline ol,.mw-parser-output .hlist.inline ul,.mw-parser-output .hlist dl dl,.mw-parser-output .hlist dl ol,.mw-parser-output .hlist dl ul,.mw-parser-output .hlist ol dl,.mw-parser-output .hlist ol ol,.mw-parser-output .hlist ol ul,.mw-parser-output .hlist ul dl,.mw-parser-output .hlist ul ol,.mw-parser-output .hlist ul ul{display:inline}.mw-parser-output .hlist .mw-empty-li{display:none}.mw-parser-output .hlist dt::after{content:": "}.mw-parser-output .hlist dd::after,.mw-parser-output .hlist li::after{content:" · ";font-weight:bold}.mw-parser-output .hlist dd:last-child::after,.mw-parser-output .hlist dt:last-child::after,.mw-parser-output .hlist li:last-child::after{content:none}.mw-parser-output .hlist dd dd:first-child::before,.mw-parser-output .hlist dd dt:first-child::before,.mw-parser-output .hlist dd li:first-child::before,.mw-parser-output .hlist dt dd:first-child::before,.mw-parser-output .hlist dt dt:first-child::before,.mw-parser-output .hlist dt li:first-child::before,.mw-parser-output .hlist li dd:first-child::before,.mw-parser-output .hlist li dt:first-child::before,.mw-parser-output .hlist li li:first-child::before{content:" (";font-weight:normal}.mw-parser-output .hlist dd dd:last-child::after,.mw-parser-output .hlist dd dt:last-child::after,.mw-parser-output .hlist dd li:last-child::after,.mw-parser-output .hlist dt dd:last-child::after,.mw-parser-output .hlist dt dt:last-child::after,.mw-parser-output .hlist dt li:last-child::after,.mw-parser-output .hlist li dd:last-child::after,.mw-parser-output .hlist li dt:last-child::after,.mw-parser-output .hlist li li:last-child::after{content:")";font-weight:normal}.mw-parser-output .hlist ol{counter-reset:listitem}.mw-parser-output .hlist ol>li{counter-increment:listitem}.mw-parser-output .hlist ol>li::before{content:" "counter(listitem)"\a0 "}.mw-parser-output .hlist dd ol>li:first-child::before,.mw-parser-output .hlist dt ol>li:first-child::before,.mw-parser-output .hlist li ol>li:first-child::before{content:" ("counter(listitem)"\a0 "}</style> <style data-mw-deduplicate="TemplateStyles:r1236075235">.mw-parser-output .navbox{box-sizing:border-box;border:1px solid #a2a9b1;width:100%;clear:both;font-size:88%;text-align:center;padding:1px;margin:1em auto 0}.mw-parser-output .navbox .navbox{margin-top:0}.mw-parser-output .navbox+.navbox,.mw-parser-output .navbox+.navbox-styles+.navbox{margin-top:-1px}.mw-parser-output .navbox-inner,.mw-parser-output .navbox-subgroup{width:100%}.mw-parser-output .navbox-group,.mw-parser-output .navbox-title,.mw-parser-output .navbox-abovebelow{padding:0.25em 1em;line-height:1.5em;text-align:center}.mw-parser-output .navbox-group{white-space:nowrap;text-align:right}.mw-parser-output .navbox,.mw-parser-output .navbox-subgroup{background-color:#fdfdfd}.mw-parser-output .navbox-list{line-height:1.5em;border-color:#fdfdfd}.mw-parser-output .navbox-list-with-group{text-align:left;border-left-width:2px;border-left-style:solid}.mw-parser-output tr+tr>.navbox-abovebelow,.mw-parser-output tr+tr>.navbox-group,.mw-parser-output tr+tr>.navbox-image,.mw-parser-output tr+tr>.navbox-list{border-top:2px solid #fdfdfd}.mw-parser-output .navbox-title{background-color:#ccf}.mw-parser-output .navbox-abovebelow,.mw-parser-output .navbox-group,.mw-parser-output .navbox-subgroup .navbox-title{background-color:#ddf}.mw-parser-output .navbox-subgroup .navbox-group,.mw-parser-output .navbox-subgroup .navbox-abovebelow{background-color:#e6e6ff}.mw-parser-output .navbox-even{background-color:#f7f7f7}.mw-parser-output .navbox-odd{background-color:transparent}.mw-parser-output .navbox .hlist td dl,.mw-parser-output .navbox .hlist td ol,.mw-parser-output .navbox .hlist td ul,.mw-parser-output .navbox td.hlist dl,.mw-parser-output .navbox td.hlist ol,.mw-parser-output .navbox td.hlist ul{padding:0.125em 0}.mw-parser-output .navbox .navbar{display:block;font-size:100%}.mw-parser-output .navbox-title .navbar{float:left;text-align:left;margin-right:0.5em}body.skin--responsive .mw-parser-output .navbox-image img{max-width:none!important}@media print{body.ns-0 .mw-parser-output .navbox{display:none!important}}</style> </div><!-- NewPP limit report Parsed by mw‐web.codfw.main‐f69cdc8f6‐dxng5 Cached time: 20241122140754 Cache expiry: 2592000 Reduced expiry: false Complications: [vary‐revision‐sha1, show‐toc] CPU time usage: 0.765 seconds Real time usage: 0.998 seconds Preprocessor visited node count: 7598/1000000 Post‐expand include size: 89914/2097152 bytes Template argument size: 4526/2097152 bytes Highest expansion depth: 14/100 Expensive parser function count: 2/500 Unstrip recursion depth: 1/20 Unstrip post‐expand size: 103089/5000000 bytes Lua time usage: 0.366/10.000 seconds Lua memory usage: 5588549/52428800 bytes Number of Wikibase entities loaded: 0/400 --> <!-- Transclusion expansion time report (%,ms,calls,template) 100.00% 702.091 1 -total 33.53% 235.423 2 Template:Reflist 26.88% 188.742 21 Template:Citation 13.62% 95.641 2 Template:Navbox 13.43% 94.316 1 Template:Calculus_topics 13.09% 91.898 1 Template:Short_description 12.08% 84.837 13 Template:R 10.55% 74.078 19 Template:R/ref 9.04% 63.485 2 Template:Pagetype 8.78% 61.629 20 Template:Math --> <!-- Saved in parser cache with key enwiki:pcache:idhash:151783-0!canonical and timestamp 20241122140754 and revision id 1243032138. Rendering was triggered because: page-view --> </section> </div><!-- MobileFormatter took 0.057 seconds --><!--esi <esi:include src="/esitest-fa8a495983347898/content" /> --> <noscript> <img src="https://login.m.wikimedia.org/wiki/Special:CentralAutoLogin/start?type=1x1&mobile=1" alt="" width="1" height="1" style="border: none; position: absolute;"> </noscript> <div class="printfooter" data-nosnippet=""> Retrieved from "<a dir="ltr" href="https://translate.google.com/website?sl=auto&tl=en&hl=en-GB&u=https://en.wikipedia.org/w/index.php?title%3DStirling%2527s_approximation%26oldid%3D1243032138">https://en.wikipedia.org/w/index.php?title=Stirling%27s_approximation&oldid=1243032138</a>" </div> </div> </div> <div class="post-content" id="page-secondary-actions"> </div> </main> <footer class="mw-footer minerva-footer" role="contentinfo"><a class="last-modified-bar" href="https://en-m-wikipedia-org.translate.goog/w/index.php?title=Stirling's_approximation&action=history&_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-GB"> <div class="post-content last-modified-bar__content"><span class="minerva-icon minerva-icon-size-medium minerva-icon--modified-history"></span> <span class="last-modified-bar__text modified-enhancement" data-user-name="130.102.13.215" data-user-gender="unknown" data-timestamp="1724988265"> <span>Last edited on 30 August 2024, at 03:24</span> </span> <span class="minerva-icon minerva-icon-size-small minerva-icon--expand"></span> </div></a> <div class="post-content footer-content"> <div id="mw-data-after-content"> <div class="read-more-container"></div> </div> <div id="p-lang"> <h4>Languages</h4> <section> <ul id="p-variants" class="minerva-languages"></ul> <ul class="minerva-languages"> <li class="interlanguage-link interwiki-ar mw-list-item"><a href="https://translate.google.com/website?sl=auto&tl=en&hl=en-GB&u=https://ar.wikipedia.org/wiki/%25D8%25AA%25D9%2582%25D8%25B1%25D9%258A%25D8%25A8_%25D8%25B3%25D8%25AA%25D9%258A%25D8%25B1%25D9%2584%25D9%258A%25D9%2586%25D8%25BA" title="تقريب ستيرلينغ – Arabic" lang="ar" hreflang="ar" data-title="تقريب ستيرلينغ" data-language-autonym="العربية" data-language-local-name="Arabic" class="interlanguage-link-target"><span>العربية</span></a></li> <li class="interlanguage-link interwiki-bn mw-list-item"><a href="https://translate.google.com/website?sl=auto&tl=en&hl=en-GB&u=https://bn.wikipedia.org/wiki/%25E0%25A6%25B8%25E0%25A7%258D%25E0%25A6%259F%25E0%25A6%25BE%25E0%25A6%25B0%25E0%25A7%258D%25E0%25A6%25B2%25E0%25A6%25BF%25E0%25A6%2582-%25E0%25A6%258F%25E0%25A6%25B0_%25E0%25A6%2585%25E0%25A6%25A8%25E0%25A7%2581%25E0%25A6%25AE%25E0%25A6%25BE%25E0%25A6%25A8" title="স্টার্লিং-এর অনুমান – Bangla" lang="bn" hreflang="bn" data-title="স্টার্লিং-এর অনুমান" data-language-autonym="বাংলা" data-language-local-name="Bangla" class="interlanguage-link-target"><span>বাংলা</span></a></li> <li class="interlanguage-link interwiki-be mw-list-item"><a href="https://translate.google.com/website?sl=auto&tl=en&hl=en-GB&u=https://be.wikipedia.org/wiki/%25D0%25A4%25D0%25BE%25D1%2580%25D0%25BC%25D1%2583%25D0%25BB%25D0%25B0_%25D0%25A1%25D1%2582%25D1%258B%25D1%2580%25D0%25BB%25D1%2596%25D0%25BD%25D0%25B3%25D0%25B0" title="Формула Стырлінга – Belarusian" lang="be" hreflang="be" data-title="Формула Стырлінга" data-language-autonym="Беларуская" data-language-local-name="Belarusian" class="interlanguage-link-target"><span>Беларуская</span></a></li> <li class="interlanguage-link interwiki-bg mw-list-item"><a href="https://translate.google.com/website?sl=auto&tl=en&hl=en-GB&u=https://bg.wikipedia.org/wiki/%25D0%25A4%25D0%25BE%25D1%2580%25D0%25BC%25D1%2583%25D0%25BB%25D0%25B0_%25D0%25BD%25D0%25B0_%25D0%25A1%25D1%2582%25D1%258A%25D1%2580%25D0%25BB%25D0%25B8%25D0%25BD%25D0%25B3" title="Формула на Стърлинг – Bulgarian" lang="bg" hreflang="bg" data-title="Формула на Стърлинг" data-language-autonym="Български" data-language-local-name="Bulgarian" class="interlanguage-link-target"><span>Български</span></a></li> <li class="interlanguage-link interwiki-ca mw-list-item"><a href="https://translate.google.com/website?sl=auto&tl=en&hl=en-GB&u=https://ca.wikipedia.org/wiki/F%25C3%25B3rmula_de_Stirling" title="Fórmula de Stirling – Catalan" lang="ca" hreflang="ca" data-title="Fórmula de Stirling" data-language-autonym="Català" data-language-local-name="Catalan" class="interlanguage-link-target"><span>Català</span></a></li> <li class="interlanguage-link interwiki-cs mw-list-item"><a href="https://translate.google.com/website?sl=auto&tl=en&hl=en-GB&u=https://cs.wikipedia.org/wiki/Stirling%25C5%25AFv_vzorec" title="Stirlingův vzorec – Czech" lang="cs" hreflang="cs" data-title="Stirlingův vzorec" data-language-autonym="Čeština" data-language-local-name="Czech" class="interlanguage-link-target"><span>Čeština</span></a></li> <li class="interlanguage-link interwiki-de mw-list-item"><a href="https://translate.google.com/website?sl=auto&tl=en&hl=en-GB&u=https://de.wikipedia.org/wiki/Stirlingformel" title="Stirlingformel – German" lang="de" hreflang="de" data-title="Stirlingformel" data-language-autonym="Deutsch" data-language-local-name="German" class="interlanguage-link-target"><span>Deutsch</span></a></li> <li class="interlanguage-link interwiki-el mw-list-item"><a href="https://translate.google.com/website?sl=auto&tl=en&hl=en-GB&u=https://el.wikipedia.org/wiki/%25CE%25A4%25CF%258D%25CF%2580%25CE%25BF%25CF%2582_%25CE%25A3%25CF%2584%25CE%25AF%25CF%2581%25CE%25BB%25CE%25B9%25CE%25BD%25CE%25B3%25CE%25BA" title="Τύπος Στίρλινγκ – Greek" lang="el" hreflang="el" data-title="Τύπος Στίρλινγκ" data-language-autonym="Ελληνικά" data-language-local-name="Greek" class="interlanguage-link-target"><span>Ελληνικά</span></a></li> <li class="interlanguage-link interwiki-es mw-list-item"><a href="https://translate.google.com/website?sl=auto&tl=en&hl=en-GB&u=https://es.wikipedia.org/wiki/F%25C3%25B3rmula_de_Stirling" title="Fórmula de Stirling – Spanish" lang="es" hreflang="es" data-title="Fórmula de Stirling" data-language-autonym="Español" data-language-local-name="Spanish" class="interlanguage-link-target"><span>Español</span></a></li> <li class="interlanguage-link interwiki-eu mw-list-item"><a href="https://translate.google.com/website?sl=auto&tl=en&hl=en-GB&u=https://eu.wikipedia.org/wiki/Stirlingen_hurbilketa" title="Stirlingen hurbilketa – Basque" lang="eu" hreflang="eu" data-title="Stirlingen hurbilketa" data-language-autonym="Euskara" data-language-local-name="Basque" class="interlanguage-link-target"><span>Euskara</span></a></li> <li class="interlanguage-link interwiki-fa mw-list-item"><a href="https://translate.google.com/website?sl=auto&tl=en&hl=en-GB&u=https://fa.wikipedia.org/wiki/%25D8%25AA%25D9%2582%25D8%25B1%25DB%258C%25D8%25A8_%25D8%25A7%25D8%25B3%25D8%25AA%25D8%25B1%25D9%2584%25DB%258C%25D9%2586%25DA%25AF" title="تقریب استرلینگ – Persian" lang="fa" hreflang="fa" data-title="تقریب استرلینگ" data-language-autonym="فارسی" data-language-local-name="Persian" class="interlanguage-link-target"><span>فارسی</span></a></li> <li class="interlanguage-link interwiki-fr mw-list-item"><a href="https://translate.google.com/website?sl=auto&tl=en&hl=en-GB&u=https://fr.wikipedia.org/wiki/Formule_de_Stirling" title="Formule de Stirling – French" lang="fr" hreflang="fr" data-title="Formule de Stirling" data-language-autonym="Français" data-language-local-name="French" class="interlanguage-link-target"><span>Français</span></a></li> <li class="interlanguage-link interwiki-gl mw-list-item"><a href="https://translate.google.com/website?sl=auto&tl=en&hl=en-GB&u=https://gl.wikipedia.org/wiki/F%25C3%25B3rmula_de_Stirling" title="Fórmula de Stirling – Galician" lang="gl" hreflang="gl" data-title="Fórmula de Stirling" data-language-autonym="Galego" data-language-local-name="Galician" class="interlanguage-link-target"><span>Galego</span></a></li> <li class="interlanguage-link interwiki-ko mw-list-item"><a href="https://translate.google.com/website?sl=auto&tl=en&hl=en-GB&u=https://ko.wikipedia.org/wiki/%25EC%258A%25A4%25ED%2584%25B8%25EB%25A7%2581_%25EA%25B7%25BC%25EC%2582%25AC" title="스털링 근사 – Korean" lang="ko" hreflang="ko" data-title="스털링 근사" data-language-autonym="한국어" data-language-local-name="Korean" class="interlanguage-link-target"><span>한국어</span></a></li> <li class="interlanguage-link interwiki-it mw-list-item"><a href="https://translate.google.com/website?sl=auto&tl=en&hl=en-GB&u=https://it.wikipedia.org/wiki/Approssimazione_di_Stirling" title="Approssimazione di Stirling – Italian" lang="it" hreflang="it" data-title="Approssimazione di Stirling" data-language-autonym="Italiano" data-language-local-name="Italian" class="interlanguage-link-target"><span>Italiano</span></a></li> <li class="interlanguage-link interwiki-he mw-list-item"><a href="https://translate.google.com/website?sl=auto&tl=en&hl=en-GB&u=https://he.wikipedia.org/wiki/%25D7%25A0%25D7%2595%25D7%25A1%25D7%2597%25D7%25AA_%25D7%25A1%25D7%2598%25D7%2599%25D7%25A8%25D7%259C%25D7%2599%25D7%25A0%25D7%2592" title="נוסחת סטירלינג – Hebrew" lang="he" hreflang="he" data-title="נוסחת סטירלינג" data-language-autonym="עברית" data-language-local-name="Hebrew" class="interlanguage-link-target"><span>עברית</span></a></li> <li class="interlanguage-link interwiki-kk mw-list-item"><a href="https://translate.google.com/website?sl=auto&tl=en&hl=en-GB&u=https://kk.wikipedia.org/wiki/%25D0%25A1%25D1%2582%25D0%25B8%25D1%2580%25D0%25BB%25D0%25B8%25D0%25BD%25D0%25B3_%25D1%2584%25D0%25BE%25D1%2580%25D0%25BC%25D1%2583%25D0%25BB%25D0%25B0%25D1%2581%25D1%258B" title="Стирлинг формуласы – Kazakh" lang="kk" hreflang="kk" data-title="Стирлинг формуласы" data-language-autonym="Қазақша" data-language-local-name="Kazakh" class="interlanguage-link-target"><span>Қазақша</span></a></li> <li class="interlanguage-link interwiki-lt mw-list-item"><a href="https://translate.google.com/website?sl=auto&tl=en&hl=en-GB&u=https://lt.wikipedia.org/wiki/Stirlingo_formul%25C4%2597" title="Stirlingo formulė – Lithuanian" lang="lt" hreflang="lt" data-title="Stirlingo formulė" data-language-autonym="Lietuvių" data-language-local-name="Lithuanian" class="interlanguage-link-target"><span>Lietuvių</span></a></li> <li class="interlanguage-link interwiki-hu mw-list-item"><a href="https://translate.google.com/website?sl=auto&tl=en&hl=en-GB&u=https://hu.wikipedia.org/wiki/Stirling-formula" title="Stirling-formula – Hungarian" lang="hu" hreflang="hu" data-title="Stirling-formula" data-language-autonym="Magyar" data-language-local-name="Hungarian" class="interlanguage-link-target"><span>Magyar</span></a></li> <li class="interlanguage-link interwiki-mn mw-list-item"><a href="https://translate.google.com/website?sl=auto&tl=en&hl=en-GB&u=https://mn.wikipedia.org/wiki/%25D0%25A1%25D1%2582%25D0%25B8%25D1%2580%25D0%25BB%25D0%25B8%25D0%25BD%25D0%25B3%25D0%25B8%25D0%25B9%25D0%25BD_%25D1%2582%25D0%25BE%25D0%25BC%25D1%258A%25D1%2591%25D0%25BE" title="Стирлингийн томъёо – Mongolian" lang="mn" hreflang="mn" data-title="Стирлингийн томъёо" data-language-autonym="Монгол" data-language-local-name="Mongolian" class="interlanguage-link-target"><span>Монгол</span></a></li> <li class="interlanguage-link interwiki-nl mw-list-item"><a href="https://translate.google.com/website?sl=auto&tl=en&hl=en-GB&u=https://nl.wikipedia.org/wiki/Formule_van_Stirling" title="Formule van Stirling – Dutch" lang="nl" hreflang="nl" data-title="Formule van Stirling" data-language-autonym="Nederlands" data-language-local-name="Dutch" class="interlanguage-link-target"><span>Nederlands</span></a></li> <li class="interlanguage-link interwiki-ja mw-list-item"><a href="https://translate.google.com/website?sl=auto&tl=en&hl=en-GB&u=https://ja.wikipedia.org/wiki/%25E3%2582%25B9%25E3%2582%25BF%25E3%2583%25BC%25E3%2583%25AA%25E3%2583%25B3%25E3%2582%25B0%25E3%2581%25AE%25E8%25BF%2591%25E4%25BC%25BC" title="スターリングの近似 – Japanese" lang="ja" hreflang="ja" data-title="スターリングの近似" data-language-autonym="日本語" data-language-local-name="Japanese" class="interlanguage-link-target"><span>日本語</span></a></li> <li class="interlanguage-link interwiki-no mw-list-item"><a href="https://translate.google.com/website?sl=auto&tl=en&hl=en-GB&u=https://no.wikipedia.org/wiki/Stirlings_formel" title="Stirlings formel – Norwegian Bokmål" lang="nb" hreflang="nb" data-title="Stirlings formel" data-language-autonym="Norsk bokmål" data-language-local-name="Norwegian Bokmål" class="interlanguage-link-target"><span>Norsk bokmål</span></a></li> <li class="interlanguage-link interwiki-pl mw-list-item"><a href="https://translate.google.com/website?sl=auto&tl=en&hl=en-GB&u=https://pl.wikipedia.org/wiki/Wz%25C3%25B3r_Stirlinga" title="Wzór Stirlinga – Polish" lang="pl" hreflang="pl" data-title="Wzór Stirlinga" data-language-autonym="Polski" data-language-local-name="Polish" class="interlanguage-link-target"><span>Polski</span></a></li> <li class="interlanguage-link interwiki-pt mw-list-item"><a href="https://translate.google.com/website?sl=auto&tl=en&hl=en-GB&u=https://pt.wikipedia.org/wiki/F%25C3%25B3rmula_de_Stirling" title="Fórmula de Stirling – Portuguese" lang="pt" hreflang="pt" data-title="Fórmula de Stirling" data-language-autonym="Português" data-language-local-name="Portuguese" class="interlanguage-link-target"><span>Português</span></a></li> <li class="interlanguage-link interwiki-ro mw-list-item"><a href="https://translate.google.com/website?sl=auto&tl=en&hl=en-GB&u=https://ro.wikipedia.org/wiki/Formula_lui_Stirling" title="Formula lui Stirling – Romanian" lang="ro" hreflang="ro" data-title="Formula lui Stirling" data-language-autonym="Română" data-language-local-name="Romanian" class="interlanguage-link-target"><span>Română</span></a></li> <li class="interlanguage-link interwiki-ru mw-list-item"><a href="https://translate.google.com/website?sl=auto&tl=en&hl=en-GB&u=https://ru.wikipedia.org/wiki/%25D0%25A4%25D0%25BE%25D1%2580%25D0%25BC%25D1%2583%25D0%25BB%25D0%25B0_%25D0%25A1%25D1%2582%25D0%25B8%25D1%2580%25D0%25BB%25D0%25B8%25D0%25BD%25D0%25B3%25D0%25B0" title="Формула Стирлинга – Russian" lang="ru" hreflang="ru" data-title="Формула Стирлинга" data-language-autonym="Русский" data-language-local-name="Russian" class="interlanguage-link-target"><span>Русский</span></a></li> <li class="interlanguage-link interwiki-sq mw-list-item"><a href="https://translate.google.com/website?sl=auto&tl=en&hl=en-GB&u=https://sq.wikipedia.org/wiki/P%25C3%25ABrafrimi_i_Stirlingut" title="Përafrimi i Stirlingut – Albanian" lang="sq" hreflang="sq" data-title="Përafrimi i Stirlingut" data-language-autonym="Shqip" data-language-local-name="Albanian" class="interlanguage-link-target"><span>Shqip</span></a></li> <li class="interlanguage-link interwiki-scn mw-list-item"><a href="https://translate.google.com/website?sl=auto&tl=en&hl=en-GB&u=https://scn.wikipedia.org/wiki/Formula_di_Stirling" title="Formula di Stirling – Sicilian" lang="scn" hreflang="scn" data-title="Formula di Stirling" data-language-autonym="Sicilianu" data-language-local-name="Sicilian" class="interlanguage-link-target"><span>Sicilianu</span></a></li> <li class="interlanguage-link interwiki-sk mw-list-item"><a href="https://translate.google.com/website?sl=auto&tl=en&hl=en-GB&u=https://sk.wikipedia.org/wiki/Stirlingova_aproxim%25C3%25A1cia" title="Stirlingova aproximácia – Slovak" lang="sk" hreflang="sk" data-title="Stirlingova aproximácia" data-language-autonym="Slovenčina" data-language-local-name="Slovak" class="interlanguage-link-target"><span>Slovenčina</span></a></li> <li class="interlanguage-link interwiki-ckb mw-list-item"><a href="https://translate.google.com/website?sl=auto&tl=en&hl=en-GB&u=https://ckb.wikipedia.org/wiki/%25D9%2586%25D8%25B2%25DB%258C%25DA%25A9%25D8%25AE%25D8%25B3%25D8%25AA%25D9%2586%25DB%2595%25D9%2588%25DB%2595%25DB%258C_%25D8%25A6%25DB%258E%25D8%25B3%25D8%25AA%25D8%25B1%25D9%2584%25DB%258C%25D9%2586%25DA%25AF" title="نزیکخستنەوەی ئێسترلینگ – Central Kurdish" lang="ckb" hreflang="ckb" data-title="نزیکخستنەوەی ئێسترلینگ" data-language-autonym="کوردی" data-language-local-name="Central Kurdish" class="interlanguage-link-target"><span>کوردی</span></a></li> <li class="interlanguage-link interwiki-sv mw-list-item"><a href="https://translate.google.com/website?sl=auto&tl=en&hl=en-GB&u=https://sv.wikipedia.org/wiki/Stirlings_formel" title="Stirlings formel – Swedish" lang="sv" hreflang="sv" data-title="Stirlings formel" data-language-autonym="Svenska" data-language-local-name="Swedish" class="interlanguage-link-target"><span>Svenska</span></a></li> <li class="interlanguage-link interwiki-shi mw-list-item"><a href="https://translate.google.com/website?sl=auto&tl=en&hl=en-GB&u=https://shi.wikipedia.org/wiki/Tanfalit_n_Stirling" title="Tanfalit n Stirling – Tachelhit" lang="shi" hreflang="shi" data-title="Tanfalit n Stirling" data-language-autonym="Taclḥit" data-language-local-name="Tachelhit" class="interlanguage-link-target"><span>Taclḥit</span></a></li> <li class="interlanguage-link interwiki-tr mw-list-item"><a href="https://translate.google.com/website?sl=auto&tl=en&hl=en-GB&u=https://tr.wikipedia.org/wiki/Stirling_yakla%25C5%259F%25C4%25B1m%25C4%25B1" title="Stirling yaklaşımı – Turkish" lang="tr" hreflang="tr" data-title="Stirling yaklaşımı" data-language-autonym="Türkçe" data-language-local-name="Turkish" class="interlanguage-link-target"><span>Türkçe</span></a></li> <li class="interlanguage-link interwiki-uk mw-list-item"><a href="https://translate.google.com/website?sl=auto&tl=en&hl=en-GB&u=https://uk.wikipedia.org/wiki/%25D0%25A4%25D0%25BE%25D1%2580%25D0%25BC%25D1%2583%25D0%25BB%25D0%25B0_%25D0%25A1%25D1%2582%25D1%2596%25D1%2580%25D0%25BB%25D1%2596%25D0%25BD%25D0%25B3%25D0%25B0" title="Формула Стірлінга – Ukrainian" lang="uk" hreflang="uk" data-title="Формула Стірлінга" data-language-autonym="Українська" data-language-local-name="Ukrainian" class="interlanguage-link-target"><span>Українська</span></a></li> <li class="interlanguage-link interwiki-ur mw-list-item"><a href="https://translate.google.com/website?sl=auto&tl=en&hl=en-GB&u=https://ur.wikipedia.org/wiki/%25D8%25B3%25D9%25B9%25D8%25B1%25D9%2584%25D9%2586%25DA%25AF_%25DA%25A9%25D9%2584%25DB%258C%25DB%2581" title="سٹرلنگ کلیہ – Urdu" lang="ur" hreflang="ur" data-title="سٹرلنگ کلیہ" data-language-autonym="اردو" data-language-local-name="Urdu" class="interlanguage-link-target"><span>اردو</span></a></li> <li class="interlanguage-link interwiki-vi mw-list-item"><a href="https://translate.google.com/website?sl=auto&tl=en&hl=en-GB&u=https://vi.wikipedia.org/wiki/X%25E1%25BA%25A5p_x%25E1%25BB%2589_Stirling" title="Xấp xỉ Stirling – Vietnamese" lang="vi" hreflang="vi" data-title="Xấp xỉ Stirling" data-language-autonym="Tiếng Việt" data-language-local-name="Vietnamese" class="interlanguage-link-target"><span>Tiếng Việt</span></a></li> <li class="interlanguage-link interwiki-zh mw-list-item"><a href="https://translate.google.com/website?sl=auto&tl=en&hl=en-GB&u=https://zh.wikipedia.org/wiki/%25E5%258F%25B2%25E7%2589%25B9%25E9%259D%2588%25E5%2585%25AC%25E5%25BC%258F" title="史特靈公式 – Chinese" lang="zh" hreflang="zh" data-title="史特靈公式" data-language-autonym="中文" data-language-local-name="Chinese" class="interlanguage-link-target"><span>中文</span></a></li> </ul> </section> </div> <div class="minerva-footer-logo"> <img src="/static/images/mobile/copyright/wikipedia-wordmark-en.svg" alt="Wikipedia" width="120" height="18" style="width: 7.5em; height: 1.125em;"> </div> <ul id="footer-info" class="footer-info hlist hlist-separated"> <li id="footer-info-lastmod">This page was last edited on 30 August 2024, at 03:24<span class="anonymous-show"> (UTC)</span>.</li> <li id="footer-info-copyright">Content is available under <a class="external" rel="nofollow" href="https://translate.google.com/website?sl=auto&tl=en&hl=en-GB&u=https://creativecommons.org/licenses/by-sa/4.0/deed.en">CC BY-SA 4.0</a> unless otherwise noted.</li> </ul> <ul id="footer-places" class="footer-places hlist hlist-separated"> <li id="footer-places-privacy"><a href="https://translate.google.com/website?sl=auto&tl=en&hl=en-GB&u=https://foundation.wikimedia.org/wiki/Special:MyLanguage/Policy:Privacy_policy">Privacy policy</a></li> <li id="footer-places-about"><a href="https://en-m-wikipedia-org.translate.goog/wiki/Wikipedia:About?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-GB">About Wikipedia</a></li> <li id="footer-places-disclaimers"><a href="https://en-m-wikipedia-org.translate.goog/wiki/Wikipedia:General_disclaimer?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-GB">Disclaimers</a></li> <li id="footer-places-contact"><a href="https://translate.google.com/website?sl=auto&tl=en&hl=en-GB&u=https://en.wikipedia.org/wiki/Wikipedia:Contact_us">Contact Wikipedia</a></li> <li id="footer-places-wm-codeofconduct"><a href="https://translate.google.com/website?sl=auto&tl=en&hl=en-GB&u=https://foundation.wikimedia.org/wiki/Special:MyLanguage/Policy:Universal_Code_of_Conduct">Code of Conduct</a></li> <li id="footer-places-developers"><a href="https://translate.google.com/website?sl=auto&tl=en&hl=en-GB&u=https://developer.wikimedia.org">Developers</a></li> <li id="footer-places-statslink"><a href="https://translate.google.com/website?sl=auto&tl=en&hl=en-GB&u=https://stats.wikimedia.org/%23/en.wikipedia.org">Statistics</a></li> <li id="footer-places-cookiestatement"><a href="https://translate.google.com/website?sl=auto&tl=en&hl=en-GB&u=https://foundation.wikimedia.org/wiki/Special:MyLanguage/Policy:Cookie_statement">Cookie statement</a></li> <li id="footer-places-terms-use"><a href="https://translate.google.com/website?sl=auto&tl=en&hl=en-GB&u=https://foundation.m.wikimedia.org/wiki/Special:MyLanguage/Policy:Terms_of_Use">Terms of Use</a></li> <li id="footer-places-desktop-toggle"><a id="mw-mf-display-toggle" href="https://translate.google.com/website?sl=auto&tl=en&hl=en-GB&u=https://en.wikipedia.org/w/index.php?title%3DStirling's_approximation%26mobileaction%3Dtoggle_view_desktop" data-event-name="switch_to_desktop">Desktop</a></li> </ul> </div> </footer> </div> </div> <div class="mw-notification-area" data-mw="interface"></div><!-- v:8.3.1 --> <script>(RLQ=window.RLQ||[]).push(function(){mw.config.set({"wgHostname":"mw-web.codfw.main-f69cdc8f6-vp9pw","wgBackendResponseTime":218,"wgPageParseReport":{"limitreport":{"cputime":"0.765","walltime":"0.998","ppvisitednodes":{"value":7598,"limit":1000000},"postexpandincludesize":{"value":89914,"limit":2097152},"templateargumentsize":{"value":4526,"limit":2097152},"expansiondepth":{"value":14,"limit":100},"expensivefunctioncount":{"value":2,"limit":500},"unstrip-depth":{"value":1,"limit":20},"unstrip-size":{"value":103089,"limit":5000000},"entityaccesscount":{"value":0,"limit":400},"timingprofile":["100.00% 702.091 1 -total"," 33.53% 235.423 2 Template:Reflist"," 26.88% 188.742 21 Template:Citation"," 13.62% 95.641 2 Template:Navbox"," 13.43% 94.316 1 Template:Calculus_topics"," 13.09% 91.898 1 Template:Short_description"," 12.08% 84.837 13 Template:R"," 10.55% 74.078 19 Template:R/ref"," 9.04% 63.485 2 Template:Pagetype"," 8.78% 61.629 20 Template:Math"]},"scribunto":{"limitreport-timeusage":{"value":"0.366","limit":"10.000"},"limitreport-memusage":{"value":5588549,"limit":52428800}},"cachereport":{"origin":"mw-web.codfw.main-f69cdc8f6-dxng5","timestamp":"20241122140754","ttl":2592000,"transientcontent":false}}});});</script> <script type="application/ld+json">{"@context":"https:\/\/schema.org","@type":"Article","name":"Stirling's approximation","url":"https:\/\/en.wikipedia.org\/wiki\/Stirling%27s_approximation","sameAs":"http:\/\/www.wikidata.org\/entity\/Q470877","mainEntity":"http:\/\/www.wikidata.org\/entity\/Q470877","author":{"@type":"Organization","name":"Contributors to Wikimedia projects"},"publisher":{"@type":"Organization","name":"Wikimedia Foundation, Inc.","logo":{"@type":"ImageObject","url":"https:\/\/www.wikimedia.org\/static\/images\/wmf-hor-googpub.png"}},"datePublished":"2002-11-26T00:47:15Z","dateModified":"2024-08-30T03:24:25Z","image":"https:\/\/upload.wikimedia.org\/wikipedia\/commons\/4\/48\/Mplwp_factorial_gamma_stirling.svg","headline":"approximation for factorials"}</script> <script>(window.NORLQ=window.NORLQ||[]).push(function(){var ns,i,p,img;ns=document.getElementsByTagName('noscript');for(i=0;i<ns.length;i++){p=ns[i].nextSibling;if(p&&p.className&&p.className.indexOf('lazy-image-placeholder')>-1){img=document.createElement('img');img.setAttribute('src',p.getAttribute('data-src'));img.setAttribute('width',p.getAttribute('data-width'));img.setAttribute('height',p.getAttribute('data-height'));img.setAttribute('alt',p.getAttribute('data-alt'));p.parentNode.replaceChild(img,p);}}});</script> <script>function gtElInit() {var lib = new google.translate.TranslateService();lib.translatePage('en', 'en', function () {});}</script> <script src="https://translate.google.com/translate_a/element.js?cb=gtElInit&hl=en-GB&client=wt" type="text/javascript"></script> </body> </html>