Stirling's Approximation: A STUNNING Result For Factorials (ft Imperial College)
Thanks to Imperial for hosting me! Hope everyone enjoyed! I love this approximation since it becomes more and more familiar with each step and leaves such a satisfying final result - please comment with any questions or suggestions for new topics, and as always, subscribe to stay updated.
~ Thanks for watching!
Comment solutions to the challenge down below.
@blackpenredpen … as always I've left you a challenge at the end of this video as well as the last few - if you see this give it a go!
Thanks so much for all the recent support - hitting 1k subscribers has been amazing and so please keep sharing and interacting so I can make even more content!
Thanks again for all the recent support and please keep sharing and interacting!!
#maths #mathematics #integrals #Imperial #MIT #Cambridge #approximation #problemsolving #stirling #approximation #taylor #maclaurin #gaussian #gauss #normaldistribution #statistics #whoknew #fascinating #functions #euler #funproblems #proofs #functions #physics #sums #series #limits #whiteboard #math505 #blackpenredpen #integral #trig #trigonometry
Пікірлер: 146
Please answer the challenge at the end down below! Also feel free to ask any questions.
Constructive feedback: please write larger and adjust lighting to remove whiteboard glare 😊
@OscgrMaths
25 күн бұрын
@@DavidMFChapman Will do next time, thanks for mentioning!
@user-cd9dd1mx4n
23 күн бұрын
@OscgrMaths Hi dear, I really enjoy the videos you make, and I highly appreciate the effort you put in to make such good contents. Actually there is something I would like to talk to you about, and I value your perspective. I am wondering if we could have a small discussion at your convenience. Would it be possible for you to share your email address with me?
@warrengibson7898
21 күн бұрын
and improve the audio
My new favourite maths youtuber great explanations
@OscgrMaths
24 күн бұрын
@@green_cobra Thank you so much!!
I was hoping you would do a few calculations to demonstrate the accuracy. I did it myself on my programable pocket calculator: n = 5 -1.7% n = 10 -0.8% n = 20 -0.4% etc
@OscgrMaths
24 күн бұрын
@@DavidMFChapman Oh nice! I was hoping viewers would try this out for themselves - thanks so much for this comment this is excellent.
@DavidMFChapman
24 күн бұрын
@@OscgrMaths I am a big fan of the Golden Ratio and I “collect” problems where it shows up in the solution.
@OscgrMaths
24 күн бұрын
@@DavidMFChapman Ah okay nice! I'll try and do a video on an integral involving the golden ratio.
I am happy we have people like you on the internet.
@OscgrMaths
19 күн бұрын
@@akshatsharma8151 Thank you so much!
Very cool as always
@OscgrMaths
19 күн бұрын
@@maths_505 Thank you!!!
This is absolutely brilliant!
@OscgrMaths
9 сағат бұрын
@@jiachengsun9910 Thank you! I'm so glad you enjoyed!
you have a great knack for making complex topics fun! ♂️
@OscgrMaths
11 күн бұрын
@@JaseewaJasee Thank you!
congrats on 1k! love another gamma function vid
@OscgrMaths
24 күн бұрын
@@advait8142 Thank you!!
Great video - you have an amazing way of explaining and keeping the audience engaged. Subscribed!
@OscgrMaths
21 күн бұрын
Thanks so much! Very kind of you.
Interesting result the way you explain things !
@OscgrMaths
24 күн бұрын
Thanks so much!
Really good, thanks!
@OscgrMaths
15 күн бұрын
Thank you!
Congrats on 1k mate!! Love the vids, your explanations have been helpful
@OscgrMaths
25 күн бұрын
@@victorcow6869 Thanks so much! Really appreciate the support.
Lovely, thank you
@OscgrMaths
23 күн бұрын
@@lucahaines4655 Thanks so much!
As n approach 100, the estimation shows only 0.15% from the exact value. This approximation is awesome! Good job, mate!
@OscgrMaths
23 күн бұрын
@@gagadaddy8713 Thank you!! It's a really lovely approximation and amazing how close it gets.
great video!
@OscgrMaths
13 күн бұрын
@@annamariaiaia1563 Thank you!
I never encountered the gamma function during graduate school, but had heard of stirling’s approximation. Glad to see it really wasnt as complicated as I thought it’d be. Great video!
@OscgrMaths
9 күн бұрын
Thanks so much!
absolutely loved it, i was searching for gamma function for some advanced maths in jee adv. and suddenly your video popped up!! watched it understood it and now it's really impressive for me to know something more!! thanks a lot keep making this type of videos and yeah you got a new subscriber
@OscgrMaths
14 күн бұрын
@@reedsayantan23 Thank so much for the comment! I really appreciate it.
Great video! Greetings from Brazil🇧🇷
@tiktik9413
22 күн бұрын
😮😮😮😮bom dia
@juliaantunes8924
22 күн бұрын
@@tiktik9413 bom dia! 😄
@OscgrMaths
21 күн бұрын
Hello! Bom dia! 🇧🇷
Great video!) Love your content!)
@OscgrMaths
23 күн бұрын
@@timofeysobolev7498 Thank you so much!!
@timofeysobolev7498
22 күн бұрын
@@OscgrMaths Thanks to you!)
Awesome video!!!
@OscgrMaths
16 күн бұрын
@@mertaliyigit3288 Thanks so much!
Congrats on 1k subs- you did it very quickly 🥳 also it's pretty sick that you did this video at imperial lol
@OscgrMaths
25 күн бұрын
Thanks so much!! Yeah filmed a few there today...
Congrats on 1k :D
@OscgrMaths
25 күн бұрын
Thanks so much! So grateful for the support and excited to make many more videos too.
Keep going my friend ❤❤❤❤
@OscgrMaths
23 күн бұрын
Thanks so much!! Will do.
Love it.
@OscgrMaths
17 күн бұрын
@@PewDiePie777 Thank you!
Do a video on Gaussian integral and also explain the Bessel function and its application. I didn't find your question though. Try to write it on the board so that we can also get a look at it.
For the longest time i could "derive" every part of the approximation except the 2 pi. The 2 pi makes sense today for the first time
@OscgrMaths
23 күн бұрын
@@muskyoxes Glad it makes sense now!! Thanks for the comment.
this is like a hyperpolynomial
Very nice
@OscgrMaths
21 күн бұрын
Thank you!
Nice video
@OscgrMaths
23 күн бұрын
@@dakcom-mk6mp Thank you!
Also constructive feedback: there's a rather loud hum around 4khz, likely due to some sort of fan. I say it's around 4khz because turning down that frequency in my equalizer makes it much better. A lapel mic would definitely help isolate your voice from the room noise. But, if there is still a loud hum, you might consider doing some noise canceling, and seeing how that sounds. Just make sure to record a few seconds where you aren't talking, and use that in the noise cancelation. And, of course, if you have control over the fan, try turning it off while recording.
@OscgrMaths
14 күн бұрын
@@ZipplyZane I've been thinking of a lapel mic - thanks for the feedback 😭.
What a great technique! It might have been interesting to show just how accurate the approximation is for large values of n, though the audience can try that for themselves, I suppose.
@OscgrMaths
25 күн бұрын
Ah I didn't consider that... excellent idea though, let me know what you get if you give it a shot!
@worldnotworld
25 күн бұрын
@@OscgrMaths I did a little messing around. f(n) consistently under-approximates n!. By n=10 we get f(n)/n! to be 0.9917, but the difference in values is 30104.83. For n=20, the ratio is 0.997, and the difference is 7.35763889E29... I suppose criteria for "accuracy" will vary wildly. The approximation certainly isn't any easier to calculate!
@OscgrMaths
25 күн бұрын
@@worldnotworld Wow that's so interesting!
@kgangadhar5389
25 күн бұрын
@@worldnotworldphysicist use this to get the order of magnitude estimates where the exact values are not needed.
@worldnotworld
25 күн бұрын
@@kgangadhar5389 That seems odd, since the calculation of the approximation is far more involved than simply calculating the factorial. What you'd want for the purpose you describe is an function for the order of magnitude of n! (rather than an estimate of n!) that was less computationally expensive than n!.
you got good content keep it up, are you doing a maths uni degree ?
If we use higher order terms of f(t), we can keep going and derive the so-called Stirling Series! What was found here is the leading order term of that series
@OscgrMaths
23 күн бұрын
@@adw1z Yes! And each will be more and more accurate. Thanks so much for the comment!
problem is, that is exactly what it is, an approximation, some things this is good, but quick and precise is out of reach of ALMOST all algorithms :-)
This is really cool. Thanks! I'm happy to find another great math source on the internet! This sort of passion for maths isn't too common, really. Are you, by chance, an AoPS student?
@OscgrMaths
21 күн бұрын
Hey, no I've never come across this before as it seems to be mostly a big thing in the US - but it looks really interesting! Definitely love the idea of having a focus on problem solving.
@booshkoosh7994
21 күн бұрын
@@OscgrMaths Right! Thanks for the videos. Most all AoPS students are math competition participants. Although AoPS advertises for a younger crowd, the biggest community is around the Olympiad training. You have to score in the top 1 percent (literally), on two tests (you have to pass the first test in order to take the second), before you can take a year-round maths training to make it onto the American Olympiad team. There are only 5 people on each team, and there's only 1 team per country. There are over 100 countries that participate, yearly! It really gets intense as test results near, or when the end of a class nears. Usually AoPS classes are 6 or 7 months long, and there isn't a single test for the whole of the 6 months! You usually get a proof that you need to write each week, and then 7 or so problems that you need to solve each week (they only count the total amount of problems solved over the 6 months, and it doesn't matter what your weekly score is). There are usually no instructions for how to solve these problems, but instead there is a book of similar problems with loads of proofs and solutions. It takes nearly 2 or 3 hours to solve a single problem (1 hour if it's a really good day). As one student of mathematics to another, seriously ignore small-fry stuff that most people are comfortable with (non of your videos are like that, but people will probably ask for stuff like that in the future). It's special to do something special, and not something watered-down or just okay. I appreciate your willingness to stick it out. Problem solving is most intuition and persistence, and that is something special which most people aren't very comfortable with. Your video topics are excellent! It takes some imagination to do proper math (most proofs -- if not all -- are based on intuition, and then the justification of it); so don't get bogged-down if people say otherwise. I really appreciate the fact that you are keeping the footage and representation basic, and not cluttering it with complex lighting or video edits. Thanks again!👍😄
@OscgrMaths
21 күн бұрын
@@booshkoosh7994 Thank you so much for this comment! Having my videos get bigger has been amazing but it has led to more negative comments too and so your kind words really mean a lot. Glad to know there's people out there who understand what I'm going for. I also completely agree with your view of maths on problem solving and I've found the equivalent program in the UK - the first exam is around October, so I'll definitely go for it then. Thanks!
@booshkoosh7994
21 күн бұрын
@@OscgrMaths Absolutely! Happy to help! Good luck on the exam! 😄
@booshkoosh7994
15 күн бұрын
@@OscgrMaths Do you mind if I asked what the name of that UK program is? I'm always on the look-out for good math sources. Thanks!
Nice presentation. Maybe think of improving the sound recording.
@OscgrMaths
24 күн бұрын
@@BikeArea Yes I'm thinking of getting a lapel mic. Thanks for the comment!
I like this. The usual way (to approximate ln(n!) by an integral, makes the Sqrt[2 pi n] difficult to get.
@OscgrMaths
21 күн бұрын
Thank you so much! The usual way is the weak approximation but introducing the gamma function is what helps provide the sqrt2pin part! Glad you enjoyed.
@Calcprof
21 күн бұрын
@@OscgrMaths I shold have thought of it. This approximation for exponential integrals is a standard in asymptotic analysis
It would be brilliant if you can prove the gaussian integral
This is a really cool way to do it! To try to answer the question at the end of the video, I wonder if we could write n! = exp(sum_(k=1)^n log(k)), and then use summation by parts? Also, would it be weaker than the method you provided in the video since you can always take more terms in the Taylor series but can’t really improve partial summation estimations? Thank you for sharing this tho!
Nice vid. Also on a side note, do you just own a really big white board or is it at the college in the title? (a rather vague question I hope you'll indulge)
@OscgrMaths
22 күн бұрын
It's at the university Imperial College in London! My other videos are on my own smaller whiteboard. Hoping to make more on the bigger ones at the uni since they're easier to lay working out on. Thanks for the comment!
❤❤
What's your favourite part of mathematics?
@OscgrMaths
24 күн бұрын
@@wit1729 Hmm... great question. I can't say one for sure, but recently I've been enjoying learning some vector calculus and I'd like to learn more about analytic number theory next. How about you?
9:33 To turn a product into sum, Say we have ∏ a_n, if we take the natural log (or any other base), we get: log(∏ a_k), but also using the property of logarithms, that log(uv)=log(u)+log(v), we have log(a1 × a2 × a3 × ...) which is also equal to log(a1)+log(a2)+log(a3)+..., which can be written as ∑log(a_k), After applying required calculations, we can turn the product back (without log), by exponentiation. Please share if there is any other way. Thank you.
@OscgrMaths
17 күн бұрын
Hey - yes! Logs are the way to go here. I'll give you a hint of next steps... Considering the graph of ln(x) - perhaps we could create an inequality with the sum of logs and the integral. Given that [sum from 1 to n] ln(k) = ln(n!) which by thinking about the area under the lnx curve is less than or equal to [integral from 1 to n] lnx dx Try evaluating that integral and rearranging for an inequality in terms of n!...
Awesome Job! Is there any way to prove that they are asymptotically equivalent or is that a little to advanced?
@OscgrMaths
23 күн бұрын
@@liamturman Thanks so much! You might be interested in this document from the university of connecticut which provides a few different and very interesting proofs for this (one of which involves bernoulli numbers!) kconrad.math.uconn.edu/blurbs/analysis/stirling.pdf
Tangential question: are there any interesting functions other than Gamma that provide factorial results for integer inputs? (Something different from just multiplying Gamma(x) by something silly, like sin(pi*x)!)
@OscgrMaths
25 күн бұрын
@@worldnotworld Examples that come to mind are the beta function (but admittedly only through its relationship to the gamma function) as well as the choose or permutation functions for combinatorics. The subfactorial is a really interesting relative of the factorial that I covered on my channel - maybe take a look at that if you're interested! Admittedly that's as much as I know about but I'm sure there's many more.
@worldnotworld
25 күн бұрын
@@OscgrMaths Thank you! I will explore the topic, starting on your channel.
Question, at the end you replaced the lower bound of the integral with -inf because we're dealing with large values of n but at the start you only used the first 3 terms of the taylor expansion (which would be for approximating small values of n). Is this not contradictory? Great video though, very nice result!
@OscgrMaths
23 күн бұрын
Thanks for the comment! If it were a Maclaurin expansion (centred at 0) for a function of n it would be only be valid for small values of n, but since it's a Taylor expansion around the point n for a function of t, whatever value we choose for n (even if it's very large) it just means the approximation will be most accurate roughly around that area. Hope that makes sense! Feel free to ask any more questions you have.
Pi * 1000 subs 💪💪
@OscgrMaths
8 сағат бұрын
@@o0QuAdSh0t0o Hadn't noticed but that's great!! Thanks for commenting.
You should listen to DorFuchs's Stirling-Formula song
@OscgrMaths
24 күн бұрын
I don't speak German but it looks great 😂 thanks for the recommendation!
Try passing the audio of the video through a low pass filter to te remove high frequency humm
@OscgrMaths
23 күн бұрын
@@JAzzWoods-ik4vv Oh that's a really helpful suggestion thanks so much!
The Stirling approximation is so amazing because its very good even for small values of n. For example choose n=3 and get that 3!~5.84. Pretty good imo
@OscgrMaths
24 күн бұрын
@@aliexpress.official Yeah definitely, if you check out some other comments people tried approximating with increasing values. Amazing how close it gets!
@gagadaddy8713
23 күн бұрын
The approximation in large n value is more important, especially when the time computer is not available. But even now, this approximation serves a good modeling of the function. Brilliant!
Not so rigorous and you seem to be abusing notations (such as taking n into infinity in the bounds while it's still there in the expression) . But it's still convincing for a Physicist ! Good job mate
@OscgrMaths
23 күн бұрын
@suzum0978 Yeah that part with n in the bounds is a little rough - that's why it's definitely an approximation! But thanks for the comment either way. If you want a slightly more rigorous (but less accessible which is why I didn't include it) derivation, it can actually be done with a contour! By considering 1/n! as a taylor coefficient in the maclaurin series of e^z and then computing it with the cauchy integral formula. You can try and work out the line integral using the saddle point method. The dominant portion near the saddle point is approximated by a real integral and Laplace's method. Actually Laplace's method is useful in evaluating this integral in general so is also worth considering (especially since the saddle point method is kind of a complex extension of laplace's method). Hope this is interesting and thanks for the comment.
@suzum0978
23 күн бұрын
@@OscgrMaths this sounds exciting, I hope you make video about it if you have time in the future!
@OscgrMaths
23 күн бұрын
@@suzum0978 Okay great!
When n goes to infini it’s not an approximation and it’s equal it’s called an « equivalent » with this symbol ~
@OscgrMaths
20 күн бұрын
@@Silver-bq6td Oh good to know thanks!
i might need a slight help with the challenge, i think i'm doing the right steps but i got stuck. i have ln(n!)=[sum from 2 to n][integral from 1 to k]of 1/t dt
@OscgrMaths
25 күн бұрын
I'll give you a hint... Considering the graph of ln(x) - perhaps we could create an inequality with the sum of logs and the integral: [sum from 1 to n] ln(k) = ln(n!) which by thinking about the area under the lnx curve is less than or equal to [integral from 1 to n] lnx dx Perhaps try computing that integral and rearranging for an inequality in terms of n!...
@Tosi31415
25 күн бұрын
@@OscgrMaths got it, i overcomplicated it. we get the same thing without the sqrt(2pi*n)
@Tosi31415
25 күн бұрын
i tried it and it's a veeery poor approximation for "small" n, but i guess it has the same order of magnitude in the limit so yeahhh
@OscgrMaths
25 күн бұрын
@@Tosi31415 Yes exactly!! I think it's quite nice how there's different approaches with different accuracies. Thanks so much for doing the challenge!
@OscgrMaths
25 күн бұрын
@@Tosi31415 Yeah that makes sense since we made some pretty big assumptions...
I mean, I get that this is the sterling approximation, but i really dont see the reason, why we are doing the Taylor series at the point n, especially if n is large. That seems kind of arbitrary
New here. Never heard anyone pronounce ln as lun. Its usually either ell-enn or stubbornly calling it log.
@OscgrMaths
23 күн бұрын
@Gameboygenius I think it might be a British thing? I always said it as ell-enn because I first learnt most of my calculus online from american channels but my teachers and classmates have recently been calling it lun and I've reluctantly converted... Thanks for the great comment!
@patrickcorliss8878
23 күн бұрын
@@OscgrMaths lun is great. Hope it catches on !!
This is a cool derivation. But I am a little confused. You use approximate inequalities twice: the first with the Taylor series, and the second with the integral bound. With the Taylor series, this should really be accurate "near n," but you use the approximation for all t in between 0 and infinity. This is even beyond the radius of convergence. So I would not expect these integrals to be similar at all. I plotted the function and the approximation (both in the exponent of e) on Desmos and I guess the functions are somewhat similar. It is not too implausible that they area under each are close as n gets large. But it is still not clear. I guess what I am saying is it would be good to see a proof that the Taylor series approximation you are using are asymptotically justified. The other approximation with the integral bound is completely believable. As n gets big, the area not accounted for should get small.
@OscgrMaths
24 күн бұрын
@@willnewman9783 Hey this is a great point and i will definitely take a look at this in more detail. One thing I would say is that if you look at the integral you end up with before making any substitutions, it's extremely similar to a normal distribution with a mean of n. Obviously this still doesn't fix everything you've mentioned, but it does mean that our approximation is most accurate around the part of the function we're integrating that has the most area under it. Thanks for the comment and I'll look more into this!
Huxley?
@OscgrMaths
21 күн бұрын
I did spend some time in Huxley! Then they put me in Skempton as there was a free room with a whiteboard and it's just down the road.
Cannot read it. Too noisy.
@Vehdbiene
23 күн бұрын
"🤓☝️" go outside ,touch grass ,make some real friends bud . leave bro alone its a great vid!
@juliaantunes8924
22 күн бұрын
U can't READ bc of the NOISE? Man i usually read stuff with my eyes but ok
@quagmire3594
10 күн бұрын
@@juliaantunes8924 Cannot read and it is too noisy, clearly your english is poor. There is a noise in the background - obvious. The board is at an angle to the camera and the windows are reflecting of it. This is poor.
@quagmire3594
10 күн бұрын
@@Vehdbiene Why no inform and and create improvement.