Why does pi show up here? | The Gaussian Integral, explained
HTML-код
- Опубликовано: 2 июл 2019
- Support me on Patreon! / vcubingx
Join my discord server! / discord
The Gaussian Integral is a term that describes the area under a normal distribution of mean 1. This value is equal to the square root of pi. In this video, I go over the hidden circle behind this, using a bit of multivariable calculus. Hope you enjoy!
Follow Me!
/ vcubingx
github.com/vivek3141
/ vcubingx
Music by Chillhop: chillhop.com/listen
sadtoi - Jeux D'eau chll.to/60d3efc2
Philanthrope, mommy - embrace chll.to/7e941f72
#calculus #gaussian #integral
This video was animated using manim: github.com/3b1b/manim
Source code for the animations: github.com/vivek3141/videos
Support me on Patreon! patreon.com/vcubingx
Join my discord server! discord.gg/Kj8QUZU
1:20 e^-(x²+y²) is a 1D function, not 3D. Thanks to u/efihiu for pointing this out!
YES, I know i promised to make a video on Stokes' Theorem and the Divergence Theorem. But, that video was taking a bit too long and I didn't want to leave you waiting for over a month. I had worked a decent amount on both of these videos, so I thought I might as well put this one out. The video on divergence theorem and stokes' theorem should be coming in the next few weeks, so look out for that!
Which software you use to add audio and small videos clips together 😐??
are you inspired by 3 blue 1 brown?? The video is really good
You mean e^-(x²+y²)?
Que programa usas para las grafica?
I'm dumb. Isn't e^-(x^2+y^2) a 2D function?
f:R^2->R
3B1B be like "Why pi is there, and why it's square rooted"
Max Haibara
Why is an astronaut doing panini in the corner
@@cmbaz1140 and what is Black Hitler doing here?
Ha ha ha
I can hear that voice !!
*"why is it", not "why it is"
This was hella cute. Solving it in 3D like that is a beautiful idea, and makes it so much more obvious than staring at the original problem.
Its cute until your professor never taught it and expects you to come up with it when he hands you a midterm
Thanks a lot for clearing my doubts. Salute to all mathematicians, physicist and teacher.Really applied maths is beautiful.
Applied maths is still inferior to pure maths
@@johnle1723 Nah i think thats better than arranging oranges in 42 dimensions.
Ok
@@Uri131 yes, right!
I remember when I learned to calculate the value of this integral. In 2005, as I took single variable calculus, I learned that exp(x^2) and exp(-x^2) had no elementar primitive. In 2006, in multi variable calculus, I saw how to calculate for this particular case using this polar coordinates substitution, and I just fell in love with it. It is so elegant, and important to get that the integration of the normal distribution over all values is 1.
Youre channel's finally going to blow up thanks to 3blue1brown's recognition
Yea it is very simmilar, also he uses the same framework for visualization as 3blue1brown
also check out reddit.com/r/manin. There are a lot of people making cool stuff with it
@@uzairm3816 Sorry, there aren’t any communities on Reddit with that name.
@@Guztav1337 oops I meand r/manim not manin. Manim stands for math animation
I have one nitpick: the animation that turns the cylinder into a cuboid is quite misleading. I know it's not intended to be the literal transformation, but it confused me for a sec. Though I understand that it might be difficult to accurately animate the unrolling, so I'll let it slide, especially since this video was so well explained. I didn't think I'd understand this integral for a while, since I didn't know how the shell method worked, but your explanation was perfect.
Right yeah, I agree. If I could go back and change anything, this would be the first thing I would
That’s just one of the beauties of multivarisble Calc. I haven’t taken it yet but that is just beautiful thank you for showing me this I’m enlightened!!!
Chudna........
Watched this vid before and after taking calc 3. I had a lot better understanding now
The hidden circle has been bothering me for a few days now! This was beautifully explained. New subscriber! :)
When there is pi, there is circle
Wow
3Blue1Brown has a video on that.
Everything is circle, so π must be everywhere.
刻进DNA的台词
r/im14andthisisdeep
I can't believe I had just found this today. It's so goddamn elegant it's disgustingly beautiful
You are doing some quality work here! Keep it up!
Thanks for animating this video for us!
So nice and clever! I find easier doing the double integral with a substitution to polar coordinates, but the rotation method is also nice! Great video!
That’s a great way of looking at it. I’d seen a related method using jacobian, but the solid of revolution is so much more intuitive.
Beautiful. Thank you. I have seen this done before by extending to the complex plane, but extending another real dimension seems even more intuitive.
Glad you enjoyed it!
Thank u for this, we get this function a lot while studying QM. You made it easy and earned a subscriber ♥️. Thank you
Love this one! Loved it in college, still calculate it every once in a while.
I love your videos, i think they are underrated, you deserve more views, the ux/ui can be improved, less assumptions made, explaining bottom up, not calling many other theorems and videos etc
Very nice! This is a life savor video for quantum mechanics. Couldn't find another video like this on youtube, thank you!
You're welcome! I'm glad it was helpful :)
Very simple and excellent explanation. Thanks for posting.
happy to see a complex contour integral interpretation. Great video bravo :)
I really liked the animations and how you explained the 2D integration bit but I feel like part of the explanation is missing. You've presented basically the standard proof: start with the integrand f(x), take f(x)f(y) and go to polar coordinates r, theta to evaluate it. Then pi pops out because the limits of integration of theta contain a pi. But this doesn't explain what makes the Gaussian special. Why don't we see pi in almost every integral? After all we can do the trick of taking f(x)f(y) and going to polar coordinates for any function, not just exp(-x^2). The important observation is that for the Gaussian when we do this, the theta dependence of the integrand factors out completely: exp(-x^2-y^2)=exp(-r^2) doesn't have any theta in it! This is a very unusual property of the Gaussian. There aren't a lot of functions for which if you take f(x)f(y) and go to polar coordinates you get something that only depends on r. In general, you get some messy expression involving sin(theta) and cos(theta) which doesn't simplify to anything involving pi.
Thanks for this comment, it addresses the exact thing that bothered me: what makes this argument work for Gaussian but not other solids of revolution. However, I feel like either I'm not understanding something, or then your explanation isn't comprehensive. To me, a dependence on theta seems like something a function that is non-symmetric around the origin would have. However, there's a lot of solids of revolution that are perfectly symmetrical around the origin, and thus don't have any dependence on theta. It seems that another property of the Gaussian, the fact that the shape of it's "slope" exp(-x^2) happens to fit exactly the substitution trick at 4:23, plays also role here.
@@DDranks I think you're just looking at it from a different angle. The construction used here is not to take a function f(x) and to consider its solid of revolution f(r). Instead, we consider a sort of "Cartesian product" version of this function f(x)f(y). For the Gaussian this happens to be the same as the solid of revolution of f(x). This equivalence of the "Cartesian product" f(x)f(y) and solid of revolution f(r) for the Gaussian is precisely the property I described in the OP. This is what allows us to simplify the integral and extract information about the 1D integral of f(x). You can say this is special from two angles.
The angle I took in the OP is to say: let's look at all functions f(x) and consider f(x)f(y). For which functions does the theta dependence drop out and we can simplify things? The answer is the Gaussian.
The other angle, which you took, is to start out with a solid of revolution f(r). This is already simplified and if you integrate this over R2, you will get some answer involving pi (provided the integral exists). However, in general this does not give you much information about the integral of any 1D function. From this angle it's a bit harder to formulate a question for which "the Gaussian" is the answer, which is why I took the other angle in my OP. But you are correct that this is an equally valid way of looking at this problem.
I atually remember being blown away learning this in university. thanks for the great video
Taking calc 1 this upcoming semester, beautiful video, went way beyond my understanding 😂
Really cool, was confusing with the 2piR but after remembering that’s the equation for the circumference of a circle I was good.
You're a amazing teacher. Thank you.
Highly competent explanation!
Thanks so much it has confused me for like a year and now i finally know why π shows up (subscribed
Thank very well explaining. Sometime we cannot find the re-solution of the equation then we just re-write it into the form that we known how to solve it.
That is the experiences!
Isn't this more elegant using polar coordinates? In any case, very slick and professional quality video!
Finally all cleared up! Thanks a million.
No problem!
Simply beautiful!
You just blowed my mind right there 💥🤯🚀 Awesome 🎉🤩
Somehow I feel like this doesn't get to the core of why pi is there.. I mean, this is the explanation they teach in Calculus courses, but it's still just a trick... unfortunately some math problems are like that.
No no. There was no explicit reasoning for the presence of pi, but it can be somehow inferred. In my understanding, pi is there because of the rotational invariance of the function, the very property that allows the integral to be separated when you rotate it. The 2D case (2D in the domain) is the one that feels intuitive, because pi is defined over a two-dimensional object (the circle), so in that case it is easy to see how given the rotational symmetry the volume can be interpreted as an amalgamation of cylinders - which would inevitably bring over the factor of pi to the calculation. But in higher (and well, the one lower) dimensional case it would behave like the higher dimensional equivalents of that cylinder, i.e. higher powers of pi - a little bit like the factor of pi in the volume of a hypersphere.
Well, that's what I took from it. Haha
I can't come up with an intuitive answer, but if you use cylindrical coordinates it just makes sense
I see it like this: when I see the curve of exp(-(x^2+y^2)), I pretend I am looking down at it from a bird's eye view and I see that the graph is radially symmetrical, which implies circles and thus pi.
It's basically because for the Gaussian exp(-x^2-y^2)=exp(-r^2) which doesn't depend on theta in polar coordinates and allows us to get a pi from the theta integral. The Gaussian is the only function which satisfies the property f(x)f(y)=f(r), which makes it special. See my comment for a more long-winded explanation
@@DavidSmyth666 Exactly.
There are lots of distributions that have circular, or, more broadly, elliptical, contours, at least in a very generalized sense of ellipse. These are called, obviously enough, elliptical distributions. en.wikipedia.org/wiki/Elliptical_distribution
An example is the T family, of which the bivariate Gaussian is an example (being a limiting case). Of course, these don't factor out quite so nicely so you're left with gamma function terms that, in the limit, only leave pi behind. Multivariate_t-distribution
I sort of wonder whether one simply gets used to all these correspondences, but in Calculus classes they sure do seem weird!
Very nice 👍 explanation
I completed 2nd year .For many times I thinked about it... Haven't got answer...Now gotcha....Tq 🤗
5:03 great concept
I like this method as simply understandable. thank you
Very intuitive!
Got here from 3b1b, you now have a sub ❤
I got 5 likes, and 5 is such a milestone, it turned blue!
It is amazing...I was admiring while watching the video.
I like how you videos show a harder kinds of math compared to 3b1b
somehow the way you said "I mean, where is the circle?" in the beginning cracked me up. I actually had to stop the video cause I was laughing too loudly to still understand what you were saying. I didn't sleep a lot tonight. thanks for the informative video - and for the laugh of course!
What's funny though?
@@justforfun2238 I mean yeah it's not really "jokey" funny or anything which is why I even mentioned it... just the fact that it's just an equation and his deadpan "where is the circle" where there's obviously no circle, cause, like I said, it's an equation. idk it was just the moment and the way he said it that got me
@@onsewatch yes it's actually kind of funny when something unexpected suddenly popped out XD
wow so clear, thank you bro
Amazing vid man
Loved it ♥️
I came from 3 blue 1 brown, i will stay :) Nice video!
Awesome! Thank you!
I seem to remember solving this in grad school by changing the coordinate system to polar. This allows for an analytic solution.
Fantastic! New subscriber here
This. Is. Awesome.
The best explanation ever ❤
The animations go pretty fast, but that makes them more fluent, if you wanna stop and think, there's still a pause botton; as well, I've notice that you're starting to grow in youtube and your voice sounds a little like a documentary tv proggram. Tho, I've seen an awesome progression on solving that problem in the youtube chanel "brackeys" you might wanna take a look. Keep going, you're doimg great
So, you basically calculated the volume of the 3D gaussian in two ways (one by the function and one by the cylinders) and equaled them. The video made it look a lot more complicated than it is. It took me a moment to understand.
Great video!
Thanks!
I wish i knew this channel when i was a kid
Hey mate, just discovered your video. I'm a huge fan of Grant at 3B1B, but the fact that you use that same animation style, whilst making the content much easier to follow is a fantastic bonus. I'm a tertiary mathematics educator, so I look forward to seeing more videos like this in the future!
Good nice explanation thank you.
1:20 e^-(x^+y^2) is a 1D function, not 3D. It maps from R^2 to R
@Hamza Omar Because f(x,y) is one dimensional, it gives out one output. Since it has two arguments it is a two dimensional input space, which maps a value on a 1D map by the transformation f(x,y).
@Hamza Omar No, you seem to misinterpret the input, output space with the spaces it is represented in. It is represented in three dimensional space, since it is mapped by two input spaces into an output space. However, the function transforms the input spaces into one output space (note that we give the function two independent values and only get one in return).
@Hamza Omar the function takes in two numbers as inputs and outputs a single numbers. Although this function is 1D, it has a nice visualization in 3D as a surface.
A 3D function takes in N variables as inputs and outputs 3 numbers. Something like a parametric curve is the simplest being F:R->R³
What definition it 'dimension of a function' are you using? I would say it should be the dimension if the graph, because a function is set-theoretically defined by its graph
@Spherical Laplacian No, it is not 2D. It is a function of two variables, however the function outputs a scalar.
Best exposition on the Gaussian that I've seen! Others get into theory of linearity, morphisms, etc. This is much more concrete, less abstract.😊
Thanks!
@@vcubingx Sure. It was succinct, well presented & clear--I loved it, & as a result, I'm going to see your other lectures, too😊
Yep that is actually nicely said as many just fall for the common misinterpretation of nonanalytic with the meaning that there is no indefinite integral described by a function. Yet there is, indeed. The error function is just not analytic, such as all other Gamma function related functions.
Nice idea to explain the Gaussian integral with a circle, it just perfectly makes sense. :-)
btw here in Finland everybody seems to learn that the indefinite integral of exp(-x^2) cannot be calculated and has to be approximated numerically. But that is definitely not so, if they only would explain the term analytic correctly.
Easy enough to show that the derivative of the error function will give you exp(-x^2).Tada! Surprise! You stopped because you learned the wrong thing. Just a pity. Because Gamma functions and alike are just so nice functions to know
What program do you use to make those animations? And those graphs? They are awesome!
Thank you! I use manim: github.com/3b1b/manim
3:20 small mistake "rotated around the y axis"
I don't see the mistake
@@vcubingx It's rotated around the z axis. At 3:15 you say z and then later y.
@@Gameboygenius Yes, the function e^(-(x^2 + y^2)) is symmetrical with respect to the z axis, but if you rotate the function e^(x^2) around the y axis you get the function e^(-(x^2 + y^2)), which is what I meant to say. Probably should have made it more clear.
@@vcubingx I agree with the previous guy. Rotating e^(-x^2) around the z-axis will give you e^(-y^2). Rotating around the y axis will give you flipped e^(-x^2) -- if rotation is by pi it will flip to negative for example. The cylinder you describe is projecting a circle to the xy-plane, which means the center of the rotation is the z-axis. Hence to make a set of infinitely many cylinders by rotating the e^(-x^2) function, you have to rotate around the z-axis. Please, correct me if I am wrong
AMAZING!!!!
I also liked 3b1b's approach in his multivirable calc course on khan academy. He started out with the same approach as you showing the 3d version is just the 2d version squared. Then he made it in cylindrical coordinates, utilizing a double integral and the fact x^2 + y^2 = r^2.
r spanned from 0 to infinity and theta spanned from 0 to 2pi which is how pi showed up in the final result.
The integral looked like this:
int from 0 to 2pi ( int from 0 to infintity ( e ^ -r^2 r dr d(theta) ) )
The main reason this became solvable was because now there was an r next to the dr because a tiny change in arc length is r * d(theta)
Nice, I wasn't aware that he covered it in his course. Do you have a link? I can't seem to find it.
@@vcubingx It was in this article at the very bottom: www.khanacademy.org/math/multivariable-calculus/integrating-multivariable-functions/double-integrals-a/a/double-integrals-in-polar-coordinates?modal=1
The best explanation never!
I am baffled! So amazing...
Great way to see it
i dont understand u said we have to find volume under curve then why u r using shell instead of using whole cylinder
As we are inscribing a 3d Volume here, why not in 2D we inscribe a rectange and carry out the operation, and that will give a wrong answer, what is wrong with my approach? Any help is appreciated!
Awesome video ...
Your reasoning seems to apply to any symmetric function, for example lates take a triangle function with the height and width of 1, the area is of course 0.5 but if I rotate it there will be circles and stuff, that doesn’t immediately says that there will be a pie involved. So there is nothing in your argument “unique” to a Gaussian, it will be pretty to see a reasoning a bit more unique for Gaussian about why there will be pie in it. (One I can think of, is the fact that a Gaussian is an eigenfunction if Fourier transform and I’m sure there is a geometrical way to get a “feeling” for this
Late to the party, but darn that was cool!
Cool!
Can put your sources or book about the gaussian integral? Thanks for the video.
Applied a quaternion to this for fun inversely and invariantly.
Arccos(tan(sin(-x)*2πy))
Simple trigjebra.
Thanks
Impressive :)
Man u r awesome
3:45 it looks like the upper oppening went to the right .. but you're calculting as if it was still up (top)
Yeah that animation was dodgy. Imagine slicing into the cylinder vertically (like you would slice a cake) and then unrolling that. This is what is meant.
@@fahrenheit2101 exactly
multiplying the function by itself in a new variable is the same as rotating the function don't get it can you explain more
Can you tell me which tool you use for this video?
綺麗な図でわかりやすかったです
こやって一旦次元上げてからrで解くの、他にもあるんでしょうかね
複素空間でもあるんでしょうかね 興味しんしん
Slick!
OMG WHAT A BEAULTIFUL CUTE PERFECT VIDEO AAAAAAAA 🤩🤩🤩🤩🤩
I'd like to know how can we know the value of dr in the volume formula
He should have written that it is the volume element dV
Interesting
Thankyou
Hmmm why does the sum of circumferences feel like a surface and not a volume?
Can you make a video content on error function? Please 🙏
the easiest way to understand this problem. wow!
X square is a surface. Minus means negative curves. e.is a ratio of distance of log. Pi is a ratio of circle. Root pi is a surface ratio. Integral of log gives inverse of negative curves. So ratio of circular surfaces.
Wow, these Animations Look so similar to 3B1B, dont they?
The explanation is also similar to RandomMathsInc
I've a doubt: 3:59 how can we get the length and breadth of the cuboid as such? By the way, this video is mind blowing
Take the hollow cylinder and imagine slicing it vertically (like how you'd slice a cake) and then unroll it. You end up with a cuboid. Its height is the same as the height of the cylinder, which is e^-r^2 (plug in x=r,y=0 to the multivariable function, for example). The length can be imagined as the circumference of the original cylinder, which is 2*pi*r. Finally the depth is just dr, some small shell width that tends to 0. A similar trick can be used to show that the curved surface area of a cylinder is 2*pi*r, by imagining unrolling this area into a rectangle.
This is not about the math, which I think you nailed, but about the Gaussian distribution.
The Gaussian distribution is less important because it's a good model for data. It's actually a poor model for most data, including things like blood pressure, which tends to have a longer right tail.
The importance of the Gaussian is primarily because of the Central Limit Theorem, which says that averages of many independent random variables tend to behave like Gaussians. Most estimators in what statisticians call "regular problems"---essentially they are ones where Taylor series approximations of the likelihood make sense---behave this way. The canonical example is, of course, the sample mean of independent random variables when the data are not heavy-tailed.
Thanks, you're absolutely right. I made this video right before I took statistics, so I wasn't very aware of the CLT and it's applications. Thanks for watching and commenting!
I'd like to add that I've always wanted to make a video on the CLT because of how powerful it is, I'm definitely considering it to be my next video.
Lost me at 3:46 ;_;
Edit: replayed that part a dozens of times and I kinda get it now ;v;
I was LITERALLY thinking about questions like "what's the square root of pi?" and "is "x times x is pi" a real thing?" just an hour ago...
multiplying a function by it self with another variable does not give the equation of the revolution of the function as the equation of revolution is z=f(√(x²+y²))
Title should be: Why does pi shows up everywhere!
Sholud not answer be sqrt(2pi)?
Yeah... And pretty much always when trying to understand "why" you should keep the 2 on the pi. Or just adopt tau
Beautiful, indeed, though it is, according to my intuition, more a “how” than a “why”. I knew this proof, but I still remain amazed why pi shows up in two completely different contexts - circle and probability. Or why the Central Limit Theorem “wants” to use a pi-related curve as limit distribution… Imagine that, tomorrow, Terence Tao comes up with some prime number theorem, involving pi, would y’all be able to silence your amazement by simply reading the proof ? I remain, my mouth wide open…