Estimate π with Pasta? Buffon's Needle & Noodle Problem

แชร์
ฝัง
  • เผยแพร่เมื่อ 29 ม.ค. 2025

ความคิดเห็น • 80

  • @michaelmahoney6782
    @michaelmahoney6782 2 หลายเดือนก่อน +3

    "The trick is you have to cook the spaghetti"
    My jaw DROPPED

    • @MihaiNicaMath
      @MihaiNicaMath  2 หลายเดือนก่อน +2

      This line is the origin story of the video!!!!

  • @numbers93
    @numbers93 3 ปีที่แล้ว +43

    love how he got 22/7 right off the bat lmao

    • @oceansofmath
      @oceansofmath หลายเดือนก่อน

      lmaooo. might have taken a couple of tries

  • @malteplath
    @malteplath 3 ปีที่แล้ว +7

    +1000 for humour and puns.
    Also.. a very insightful explanation, expertly put together. Many thanks for this!

  • @x0cx102
    @x0cx102 3 ปีที่แล้ว +2

    omg it's mihai nica i remember your paper on solving the game "guess who" from several years back!
    super fun to see you make some math expo videos too
    buffon needle indeed a classic

  • @johnchessant3012
    @johnchessant3012 3 ปีที่แล้ว +5

    Amazing video! My intuition for why curves of the same length will have the same average number of intersections regardless of shape: The more curled-up a curve is, it will intersect an edge more times if it happens to be close to an edge, *but* it is more compact so there's also a greater chance it won't be near an edge at all.

    • @MihaiNicaMath
      @MihaiNicaMath  3 ปีที่แล้ว +3

      Yes exactly! The surprising thing is that its perfectly balanced so that the average can't change at all

  • @gcewing
    @gcewing 3 ปีที่แล้ว +14

    And if you want to serve the noodles to your guests after doing maths with them, you have the Buffet Noodle Problem.

    • @MihaiNicaMath
      @MihaiNicaMath  3 ปีที่แล้ว +4

      You're going to love this other probability problem: en.wikipedia.org/wiki/Indian_buffet_process

  • @diribigal
    @diribigal 3 ปีที่แล้ว +31

    Just started - how did you write so nicely upside down?! And at the end, disappointed you didn't say "pastably be". Great video!

    • @MihaiNicaMath
      @MihaiNicaMath  3 ปีที่แล้ว +15

      Haha I'm glad you noticed the upside down writing! Basically I knew from computer experiments what the likely outcomes were and I had the most common cases prewritten out on a page behind the camera and hung UPSIDE DOWN. So all I had to do was copy the one for 14 crossings out symbol for symbol (it turns out this is actually THE most likely outcome when you throw 11 pieces...see the video with computer simulations)

    • @MihaiNicaMath
      @MihaiNicaMath  3 ปีที่แล้ว +6

      I really used my noodle planning it all out!!!!

  • @ElyotGrant
    @ElyotGrant 3 ปีที่แล้ว +17

    Really cool video Mihai, I've never seen that trick with the circle!
    This adds to my heap of evidence that linearity of expectation is the most overpowered result in all of mathematics.

    • @MihaiNicaMath
      @MihaiNicaMath  3 ปีที่แล้ว +4

      Totally agree it's powerful and comes up everywhere! One of the key ideas in my PhD thesis was breaking up complex stochastic processes into simpler ones and using linearity of expectation to control it.

    • @columbus8myhw
      @columbus8myhw 3 ปีที่แล้ว +2

      "But they're not independent - oh, we don't need that?"

  • @Golden_Tortoise
    @Golden_Tortoise 3 ปีที่แล้ว +15

    Very cool. My intuition tells me that the curvy noodles are not as good of an estimation for pi as straight noodles given, lets say, 20-30 throws. Meaning more throws would need to be made to get "close" to the estimation of pi, since curvy noodle take up less square area in general.

    • @MihaiNicaMath
      @MihaiNicaMath  3 ปีที่แล้ว +7

      This is good intuition! In general what you want in this kind of Monte Carlo estimate is for the variance to be minimized (see en.wikipedia.org/wiki/Variance_reduction ). This means that super curvy noodles that have a low chance of like 10 crossings but a high chance of 0 crossings are bad estimators. The optimal would be a noodle that always touchs the same number of time.....like the diameter 1 circle we actually used! This gives a perfect estimate in only 1 throw (Assuming you can measure its length). The optimal length 1 noodle is an interesting open question.....I would guess its a smaller circle?

    • @MihaiNicaMath
      @MihaiNicaMath  3 ปีที่แล้ว +3

      PS The circular noodle has "length" 1 because its a circle of diameter 1. So radius=1/2 here

    • @Golden_Tortoise
      @Golden_Tortoise 3 ปีที่แล้ว +1

      @@MihaiNicaMath Makes sense. Thank you for the awesome reply!

    • @chaosredefined3834
      @chaosredefined3834 3 ปีที่แล้ว +1

      ​ @Mihai Nica The straight line is the optimal solution for minimizing variance. It can only get 1 or 2 intersections. You can mathematically prove that, if you have a noodle structure that can hit 0 intersections with probability > 0, or can hit 3 intersections with probability > 3, then the noodle structure with only 1 or 2 intersections has less variance.
      The smaller circle can hit 0, 2 or 4 intersections. That's going to produce more variance.
      (Note that the straight line solution can do something awkward where the ends of it are exactly on some parallel lines. This is not defined in the problem, but it doesn't matter, as it occurs with probability zero)

    • @MihaiNicaMath
      @MihaiNicaMath  3 ปีที่แล้ว

      @@chaosredefined3834 I think I agree that the straight noodle (with 0,1 or 2 hits possible) will have lower variance than a circumference 1 noodle (that can hit 0,1,2,3 or 4 hits), so I agree a small complete circle is not optimal. However, I don't think this proves that a straight line is optimal: for example a length one arc of a diameter 1 circle could be better? I suppose the optimal one is the one that minimizes the probability of no hits and this indeed sound like the straight noodle but I'm not sure how to prove this

  • @PaulFisher
    @PaulFisher 3 ปีที่แล้ว +2

    “the first time you see this problem, it’s completely bananas” no, it’s just pasta

  • @gonzalopolo2612
    @gonzalopolo2612 ปีที่แล้ว +1

    Really enjoyable video!
    Subscribed!
    One point: At 4:04 I think that it would "more correct" to say Law of Large Numbers instead of Central Limit Theorem.
    Congratulations for your channel!

    • @MihaiNicaMath
      @MihaiNicaMath  ปีที่แล้ว

      Thanks! Glad you liked it!
      I agree with you that LLN would have been more clear. What I was going for was that the CLT tells you the size of the spread is order 1/sqrt(n) (it also tells you the shape, but I just want the size!). I definitely should have either explained more here though or just said LLN as you suggested.
      Btw, my latest video has a proof of the CLT which you might like! th-cam.com/video/oPQ4mNcqY7k/w-d-xo.htmlsi=wVMyi_mW_yJaScbt

  • @behindthemath5491
    @behindthemath5491 3 ปีที่แล้ว +3

    Excellent explanation!! Inspiring 😍

  • @DerekGoo
    @DerekGoo 3 ปีที่แล้ว

    BRO YOU SHOWED UP IN MY RECOMMENDATIONS LET'S GOOOO

  • @rock_sheep4241
    @rock_sheep4241 3 ปีที่แล้ว

    It's the first time I heard about Barbier theorem. Awesome video. I\ve heard a simillar problem from my math teacher in college about aproximating zeta Riemann function, but I did not find anything about it

  • @seneca983
    @seneca983 ปีที่แล้ว +2

    4:00 Did you mean the Law of Large Numbers rather than the Central Limit Theorem?

    • @MihaiNicaMath
      @MihaiNicaMath  ปีที่แล้ว +1

      I meant Central Limit Theorem: it tells you that the distance to the average is on the scale 1/sqrt{n} where n is the number of dice rolled. So as n increases, you know you are getting closer and closer. (The Law of Large Numbers just tells you in the limit that the average becomes the mean, but doesn't give details about the closer and closer part)

    • @seneca983
      @seneca983 ปีที่แล้ว +1

      @@MihaiNicaMath You don't need the Central Limit Theorem to know that. That theorem is specifically about how the *distribution* of the sum (or average) of independent random variables approaches (under certain conditions) approaches a normal distribution. For what you want is that the standard deviation of the average is directly proportional to 1/sqrt(n) which is a weaker and easier to prove result.

    • @MihaiNicaMath
      @MihaiNicaMath  ปีที่แล้ว +1

      @@seneca983 Yes, of course, but that result doesn't have a snappy name you can name drop in the video! The actually the main purpose is to leave a breadcrumb trail for people who have never heard of the CLT before if they want to dig deeper :)

  • @brentcrobarger7872
    @brentcrobarger7872 3 ปีที่แล้ว +1

    Why this works with geometry instead of numbers:
    If you spun each noodle around at it's mid point you would get a circle with radius 1/2. Now, consider all of the points inside the square where a mid point could be where the line only intersects the square once or not at all. Draw a 1/4 circle around each corner of the square with radius 1/2. Anything in this area WILL intersect 1-2 times depending on orientation. Anything outside this area WILL intersect the square 0-1 times. Counting the number of intersections is in effect measuring how many noodles landed inside the void, and how many landed in the corners. The more noodles thrown the more chaos theory will average out. The area of the 1/2r circle is .7854 so we can expect 78.54% of noodles to fall into this area. Since the two area's are effectively a circle and a 'not a circle' it's expected for pie to show up.
    4x (N/C) is simply converting this counting method to . . . uh . . . 'numbers'. As a noodle gets closer to the edge it has a greater number of angles where it will have more intersections rather than fewer (weather that's in the 0-1 or the 1-2 zone) Inversely, noodles near the center will have less of a chance of intersecting. This becomes a fairly smooth gradient of probability/percentage; which, I would assume where the 3.14 comes from.

    • @MihaiNicaMath
      @MihaiNicaMath  3 ปีที่แล้ว +1

      I think the problem with this approach is that which angles will give 1 intersection vs which angles will give 2 intersections depends on the exact location. If you want to add it all up to get the average you would need to find the exact formula and then do a complicated 3d integral over x,y and theta. So you can make this work but it's somewhat complicated. That's why I like this other method I do in the test of the video instead!

    • @brentcrobarger7872
      @brentcrobarger7872 3 ปีที่แล้ว

      @@MihaiNicaMath Technically you could calculate the average number of intersections for every grid position and get a more precise result, but since their are infinite many grid positions we'd be here for a while. I'm certain that the difference between using a grid with 100 positions vs 1000 would only change the digits of pie that you come up with.
      My point here is that this noodle method is in effect taking a sample of the data you would get from my proposed method. The ≈ incongruity with pie being a result of random variation in sampling. So really, we're talking about the same proof but looking at it from two different ends.
      I would like to say, the reason I came up with this solution is because I didn't quite see where 'the circle' was appearing in your video. So I had to sit here and think about another way to visualize it.

  • @CosmicDoom47
    @CosmicDoom47 ปีที่แล้ว +2

    How do we know that C is not a function of the noodle's length? I imagine the proof video will explain - curious! Great video!

    • @MihaiNicaMath
      @MihaiNicaMath  ปีที่แล้ว +1

      Yes this is exactly the topic covered in the proof video! The intuitive idea is briefly described in 1 sentence in this video: if you imagine cutting the noodle up into many many tiny pieces, then each piece has a tiny contribution, and the total expected value is just the sum of these. So it depends only on the number of pieces (i.e. the length) and not the shape (which is how the pieces are arranged all together)

  • @joshuatanase3718
    @joshuatanase3718 3 ปีที่แล้ว +1

    Nice video. I'm curious, are you Romanian?

    • @MihaiNicaMath
      @MihaiNicaMath  3 ปีที่แล้ว

      Thanks! I was born in Romania but I am Canadian :)

  • @mrazron
    @mrazron 3 ปีที่แล้ว +3

    Imagine using 3.142*10^80 noodles, the pi value estimation would be greatly improve

    • @MihaiNicaMath
      @MihaiNicaMath  3 ปีที่แล้ว +8

      This might not work because there are only ~10^80 particles in the universe, and you need to save some particles for the paper for the grid/the marker to count the crossings etc .

    • @FakeLLama23
      @FakeLLama23 3 ปีที่แล้ว +1

      @@MihaiNicaMath ✋Major thanks for counting all the particles in the universe.
      Just kidding tho love your vids

  • @huhneat1076
    @huhneat1076 3 ปีที่แล้ว

    "And I got 22/7."
    *Nervous sweating*

  • @MathLawes
    @MathLawes 3 ปีที่แล้ว

    Very well done!

  • @daigakunobaku273
    @daigakunobaku273 3 ปีที่แล้ว +5

    Finally! Someone has made a video on my favorite proof in the entire math! Do I get it correctly that you've read about it in "Proofs from the BOOK"?

    • @MihaiNicaMath
      @MihaiNicaMath  3 ปีที่แล้ว +6

      No I didn't read it from there....I think I first heard of this from How Not to Be Wrong by Jordan Ellenberg years ago, but I filled in the details myself in this square grid setting. I'm assuming based on your comment this one is in proofs from the book?

    • @daigakunobaku273
      @daigakunobaku273 3 ปีที่แล้ว +2

      @@MihaiNicaMath yes, there the problem is posed and solved a bit differently though, with parallel lines instead of squares (but the main idea of using round needles and linearity of expectation remains the same)

  • @01k
    @01k 3 ปีที่แล้ว +1

    Nice video

  • @lucas_6667
    @lucas_6667 3 ปีที่แล้ว +1

    Very good video!

  • @higinho23
    @higinho23 3 ปีที่แล้ว

    Very Cool! Thank You

  • @atharvas4399
    @atharvas4399 3 ปีที่แล้ว +1

    does the length of the noodles matter?

    • @MihaiNicaMath
      @MihaiNicaMath  3 ปีที่แล้ว +1

      Yes: if you double the length, you double the average number of crossings. The 4/Pi formula is for length 1 noodles.

  • @_qpdbdbqp_
    @_qpdbdbqp_ 3 ปีที่แล้ว +1

    Your video is so cool! Are you from Romania? :)

    • @MihaiNicaMath
      @MihaiNicaMath  3 ปีที่แล้ว +1

      I was born in Romania but I am Canadian! (Maybe the slight accent and flannel gave it away?)

    • @_qpdbdbqp_
      @_qpdbdbqp_ 3 ปีที่แล้ว

      @@MihaiNicaMath actually it was your name, “Mihai” is a popular name in Romania :))

  • @Adam-xr6fj
    @Adam-xr6fj 3 ปีที่แล้ว +1

    So every noodle has an average of 4/pi crossings.

    • @MihaiNicaMath
      @MihaiNicaMath  3 ปีที่แล้ว +2

      Every noodle of length 1 has 4/Pi crossings on average. (Noodles of length 2 will have twice as many: 8/Pi)

  • @Thepiecat
    @Thepiecat 3 ปีที่แล้ว

    314th subscriber :)

  • @angrymurloc7626
    @angrymurloc7626 3 ปีที่แล้ว

    Watching this, it wasn't exactly clear to me why cutting the noodles in tiny pieces suddenly makes their shape arbitrary

    • @MihaiNicaMath
      @MihaiNicaMath  3 ปีที่แล้ว +2

      It's the other way around: given a noodle (of arbitrary shape) you can always cut it into tiny pieces so that each piece is approximately a line segment. Then you can reorganize the pieces into a straight line. Since moving the pieces around doesn't change the average number of crossings, this shows that all noodles of the same length have the same average number of crossings. The proofs video has the full detailed mathematical proof!

  • @jiteshruch
    @jiteshruch 3 ปีที่แล้ว

    All the best for SOME1!

  • @GBloxers
    @GBloxers 3 ปีที่แล้ว

    Your explanation is great, up until the moment after you explain how to use a circular noodle of diameter 1 to find C (7:20).
    The noodle you use to find C has a circumference of pi, whereas the noodles we threw at the grid would have a circumference of 1, since that is the length of a noodle. It is not made clear why the results from a noodle with length pi in a unit grid would be equivalent to that of a noodle with unit length in a unit grid. Moreover, you brush past the equation detailing how the average number of crossings is proportional to the length of the noodle (6:12), which detracts from your presentation and does not fully explain the proof. How can I know that this is the case? Where did you get this equation from? I understand that this part may have been omitted for the purposes of keeping things simple and lowering the barrier to entry, but I feel like even showing an integral (or whatever mechanism was used to acquire this equation) somewhere on the screen is essential to fully prove Buffon's noodle problem.
    Overall though, your presentation is very well-put together. It's just this one part I take issue with.

    • @MihaiNicaMath
      @MihaiNicaMath  3 ปีที่แล้ว +1

      This is a great point! Indeed, the proportionality result is the heart of the idea and in this video I only state the result in this video and claim it holds "by cutting the noodle into tiny pieces and rearranging". The bonus video called "proof of proportionality" has an extremely detailed proof of this proportionality you can go check out :) th-cam.com/video/6XnkEThjQZ8/w-d-xo.html

    • @MihaiNicaMath
      @MihaiNicaMath  3 ปีที่แล้ว +1

      EDIT: I checked the video and I think the card for the proofs video was gone by the time the proportionality equation is displayed...I moved the card back a few seconds so hopefully now its more clear where the argument for proportionality is! Thanks for pointing out this confusion so I could fix it.

    • @GBloxers
      @GBloxers 3 ปีที่แล้ว

      @@MihaiNicaMath Thank you for the clarification! Honestly, I didn't even notice the cards, which is a little embarrassing on my part haha... Your video is more than sufficient then, really excellent work! You definitely deserve the honorable mention for this.

  • @agustincabrera414
    @agustincabrera414 3 ปีที่แล้ว +2

    This video was great hahahhaa

  • @taavimetso9178
    @taavimetso9178 3 ปีที่แล้ว +2

    You got lucky 😂😂😂

    • @MihaiNicaMath
      @MihaiNicaMath  3 ปีที่แล้ว +2

      Yes and no: On one hand I got lucky that 22/7 is a really good approximation for Pi, but this is actually the MOST LIKELY value to come out the experiment when throwing 11 noodles. So I would say I got "not unlucky" :) (Plus I sort of cheated in that I wrote the computer program before I did the experiment, so I knew the likely outcomes before I even did it. Thats why I chose 11 noodles!)

  • @d.l.7416
    @d.l.7416 3 ปีที่แล้ว +3

    I got here on 3,141 views XD

    • @MihaiNicaMath
      @MihaiNicaMath  3 ปีที่แล้ว +1

      That's like a 10,000 noodle estimate for pi :)

  • @ibrahiymmuhammad4773
    @ibrahiymmuhammad4773 2 ปีที่แล้ว

    If I want pie I just make it

    • @MihaiNicaMath
      @MihaiNicaMath  2 ปีที่แล้ว

      Thats how I feel about spaghetti

  • @CasualMitosisCollective
    @CasualMitosisCollective 3 ปีที่แล้ว +1

    πsta

    • @MihaiNicaMath
      @MihaiNicaMath  3 ปีที่แล้ว +1

      My favourite type is spaghett-2.718...

  • @skilz8098
    @skilz8098 3 ปีที่แล้ว

    Why is the constant to this formula 4/PI? There's another way to understand and prove this using basic algebra and understanding the relationship between linear equations and the trigonometric functions. However, it starts with what is 4/PI?
    The fractional value 4/PI is the reciprocal of PI/4. Does this value look familiar to you? It's the same as a 45 degree angle. And this is the key to understanding how this works.
    Within basic algebra and understanding the properties of linear equations we can reference the point slope form of a line y=mx+b where m is its slope and b is its y-intercept. The slope m is defined as rise/run which can be calculated from any two points on a line by the formula m=(y2-y1)/(x2-x1) and a shorthand notation of this would be m = dy/dx. Where d or delta stands for rate of change... What does this have to do with 4/PI, PI/4 or 45 degree angle? Everything!
    Let's step back a bit and look at the basic expression for all mathematics the identity equation: y = x. This equation relates that for all x, y is the same as x. When we plot this graph we end up with a line that passed through the origin (0,0) and tends to +infinity in the 1st quadrant, and tends to -infinity in the 3rd quadrants within the 2D Euclidean Plane.
    We also know that this line y=x can be written as a function f(x) = x and that this line bisects the X and Y axes. We also know that the X & Y axes are orthogonal - perpendicular to each other as they create a right angle that is either PI/2 or 90 degrees. We can also see that the identity equation y = x is a special case of the general formula y = mx+b. In the case of y=x we can see that m = 1 and b = 0 due to the identity properties of multiplication and addition: a*1 = a and a+0 = a.
    What does this this have to do with trigonometry? We know that the slope is defined as rise over run or dy/dx we also know that the slope of y=x has a value of 1. So we need to ask ourselves what trig function has an output that is equal to 1 when its input angle is either PI/4 radians or 45 degrees. Here we can see that tan(PI/4) or tan(45) = 1. The angle here for this function is the angle that is below the line y=mx+b and the +x-axis. We can then see that the slope of the linear equation itself dy/dx = tan(t). What's even more interesting is that there is an identity property within the class of trigonometric functions that states tan(t) = sin(t)/cos(t). We can then easily see that the slope dy/dx is also equal to sin(t)/cos(t). This implies that dy = sin(t) and dx cos(t) and that (y2-y1) = sin(t) and (x2-x1) = cos(t).
    This is all embedded within the identity equation. For example 1 = 1 is a true statement giving us a value of 1. PI is embedded within the value 1. How?
    Take the value one and draw it as a unit vector. You have a start position at 0 which is its tail, and its pointing arrow is then listed as 1. This vector has 2 points. All line segments are vectors and all vectors are line segments. The value 1 that we always consider to be a "scalar" is in fact a vector. Any line that has 2 points also has another distinct property. The angle of any line within regards to itself is 180 degrees or PI radians. I told you PI was embedded in the value. It has to be! If it wasn't, then the identity equation y=x would not be a valid statement.
    More than just that, the first arithmetic equation you learn: 1+1=2 is more than just addition. It is also vector addition behind the scenes and this expression generates the unit circle positioned at the point (1,0). Each of the arguments or inputs are a radius and the output is the circle's diameter. Also, we know that the Pythagorean Theorem is A^2 + B^2 = C^2 where A,B,&C are the lengths of each leg and we know that the general formula for a circle is (x-h)^2 + (y-k)^2 = r^2 where the point (h,k) is the position of the circle's center, (x,y) is any point on the circle's circumference and r is its radius. The Pythagorean Theorem is also the basis for the Distance Formula, and the Equation of a Circle is a specific case or set of the Pythagorean Theorem and the equation 1+1=2 satisfies both of them. As for a the A^2 + B^2 = C^2 consider a right triangle with its two legs being a value of 1. What's its hypotenuse? It's quite simple, sqrt(2) or 1.41421. Another irrational number. So yes, all your numbers are embedded within y=x, embedded within the value 1. It's more than just your numbers, but all branches of mathematics are embedded within y=x. Why? Because y=x isn't just the identity equation, it is also a perfect bisector, it has perfect symmetry, it is a line of reflectiveness and is the underlying principle to the Associative Property.