My favorite way to compute Pi....experimentally!
Вставка
- Опубліковано 13 чер 2024
- Check out more pi approximation in this Maple Learn document: learn.maplesoft.com/d/OLPIBQF... My thanks to @maplesoft for sponsoring today's video!
Buffon's problem is an experimental way to compute pi. Drop a bunch of toothpicks on a paper with equally spaced lines. Then pi is nothing but 2 divided by the probability that the toothpick lands on the line (when the spacing is the same length as the toothpick). In this video we'll see precisely why this is the case and check out a few other famous pi equations.
0:00 Pi Experiment
0:58 Driving the formula
6:07 Dealing with arbitrary widths
7:49 Pi approximations in Maple Learn
Check out my MATH MERCH line in collaboration with Beautiful Equations
►beautifulequations.net/pages/...
COURSE PLAYLISTS:
►DISCRETE MATH: • Discrete Math (Full Co...
►LINEAR ALGEBRA: • Linear Algebra (Full C...
►CALCULUS I: • Calculus I (Limits, De...
► CALCULUS II: • Calculus II (Integrati...
►MULTIVARIABLE CALCULUS (Calc III): • Calculus III: Multivar...
►VECTOR CALCULUS (Calc IV) • Calculus IV: Vector Ca...
►DIFFERENTIAL EQUATIONS: • Ordinary Differential ...
►LAPLACE TRANSFORM: • Laplace Transforms and...
►GAME THEORY: • Game Theory
OTHER PLAYLISTS:
► Learning Math Series
• 5 Tips To Make Math Pr...
►Cool Math Series:
• Cool Math Series
BECOME A MEMBER:
►Join: / @drtrefor
MATH BOOKS I LOVE (affilliate link):
► www.amazon.com/shop/treforbazett
SOCIALS:
►Twitter (math based): / treforbazett
►Instagram (photography based): / treforphotography
For anyone interested in coding it up, a simplified scenario is (to guarantee closeness to the line and to ignore the mirror symmetry) to take a uniformly random x from [0,1) and theta from [0,pi/2), then you count a success if x + sin(theta) >= 1. The probability of success is still 2/pi. Note that sin and cos are interchangeable here.
Very unrelated but nice haircut dude! Whatever your latest look is looks very clean and sharp
Ha thank you! That is my wife’s amazing handiwork:D
Fun fact: The same formula holds even when the needle isn't a straight line, except it gives the _expected number_ of crossings; the intuition being that if your "needle" has the same length but is really curled up, it will be less likely to intersect a line but when it does, it will usually intersect it more than once.
so do you count the number of crossings? That's going to jack up my error estimate, as it's now a Poisson process.
Since one toothpick is a Bernoulli process, you get a binomial distribution, and the square of the uncertainty goes as P(1-P)/N.
That is some hilarious T-shirt!
"sinx = opposite/hipopotamus"
haha I love it:D
There is a simpler random way to calculate pi by throwing arrows at a circle bounded by a square, and calculating pi from the ratio of the arrows inside the circle. Not only it's much simpler, simulating it does not require usage of pi or trigo functions - just random numbers, substruction and multiplication
Another wonderful video from my favorite math tutor. You're one of the reasons i fell in love with math and now i study it for the beauty not just the marks. Major thanks dr trefor
Wow, thank you!
@DrTrefor Yes thanks for sharing Dr Trefor. I really hope you can respond to my other comment when you can. Thanks very much.
Hi Dr. Bazett!
Very cool!
Theres another pi formula which uses arctan, similar to the 1-1/3+1/5-... one. It is pi = 16arctan(1/5)-4arctan(1/239), and was used to calculate pi to 527 digits, which is the world record for calculating pi by hand. Could you maybe do a video on a geometric proof of this? Because I have no idea where it comes from.
I believe that family is all coming from the Taylor series for arctan
At the start of the video, the second = is also an "approximately", because you swap out a mathematical probability for its observed frequency.
It's also probably not so easy to guarantee that the angles and positions are uniformly distributed on the range, but sample size is probably a much more relevant concern for a trial by hand anyway.
The integral of arccos(x) from 0 to 1 is the same as the integral of cos(x) from 0 to pi/2, which makes the calculation much easier. (Convince yourself graphically)
Absolutely!
Amazing!
Is this one of the ways of using monte carlo method to approximate π?
That is very cool
Hey man! This was a really nice simple and elegant proof. Side note: the chapter of "deriving the formula" was spelt as driving the formula, otherwise, great vid!
The formula uses probability. how can we express this as a counting problem?
The number of toothpicks that intersect a line vs the total number of toothpicks?
and the lined paper needs to be large enough so that every toothpick lies between two lines right?
Exactly!
Pi is Cool and all but I can't take my eyes away from that cute Hippopotamus.
lol:D
Ah I was trying to recall this to prove the quantum version of pi - quantum length and angle from measurement 'noise'
If you toss as many toothpicks as there are lines on the page is there some connection with 1/e ? I keep trying to find ways to visualize the constant e but so far I've been told a catenary arch or a hanging chain are the only things that sorta get close.
I don’t think so, the rotations of the toothpicks make it reasonable that pi is involved but I can’t see an e
Fun stuff, but there’s an issue with your computer simulation. I suspect that pi exists somewhere in your code (or in the machine code for one of the functions you use). Could someone program a needle dropping simulation that calculates pi without already knowing pi?
The pi is purely emergent here. The simulation works by randomly choosing an x and y coordinate of midpoints from the square, randomly choosing a rotation angle, and then counts them up.
Before I liked, you'd got 314 likes, wow!
Haha that’s awesome
Maths is life
It's lovely maths, but lacks a certain practicality.
Modelling it as a random walk suggest that the error should be 1/sqrt(n) so for 3 decimal places something like 1,000,000 throws would be needed.
... but we are in the company of mathematicians, why worry about such mundane issues.
I liked your analysis of this method to “compute” pi …. But the glib comment about just running a computer a million samples is fraught with danger. It’s very easy with this type of problem to run into problems with the random number generator used … first you need random pairs of numbers (x and theta), something an a lot of pseudo random number generators are very bad at, second it can be fairly easy to exceed the actual length of the generator is capable of generating i.e. its period. Many modern tools and computer libraries have generators that greatly reduce these issues and very many do not. A fun exercise is to calculate the convergence rate and the compare the analytical results to a computer experiment. The convergence rate is quite slow no surprise, but often the computer results stops improving after a surprising small number of trials.
First
Wow you are fast!
You are such an amazing teacher. I really learn a lot from your lectures. Do you have an IG or Facebook?