31:20Coding Challenge 176: Buffon's Needle
From the creator
How do toothpicks approximate the value of pi? I'll show you by coding a simulation in p5.js! Code: https://thecodingtrain.com/challenges/176-buffon-needle ๐ Watch this video ad-free on Nebula https://nebula.tv/videos/codingtrain-coding-challenge-buffons-needle p5.js Web Editor Sketches: ๐น๏ธ Buffon's Needle: https://editor.p5js.org/codingtrain/sketches/zqytzJAZN ๐น๏ธ Line Line Intersection: https://editor.p5js.org/codingtrain/sketches/htO0scRB1 ๐น๏ธ Probability Density Function Graph: https://editor.p5js.org/codingtrain/sketches/eMaEGlfmu ๐ฅ Previous video: https://youtu.be/PHfKCxjsmos?list=PLRqwX-V7Uu6ZiZxtDDRCi6uhfTH4FilpH ๐ฅ All videos: https://www.youtube.com/playlist?list=PLRqwX-V7Uu6ZiZxtDDRCi6uhfTH4FilpH References: ๐ Buffon's Needle: https://en.wikipedia.org/wiki/Buffon%27s_needle_problem ๐ Analysis and Simulation: https://mste.illinois.edu/activity/buffon/ ๐ Pickup Sticks & Pi: https://ogden.eu/pi/ Related Coding Challenges: ๐ 95 Approximating the Value of Pi: https://youtu.be/5cNnf_7e92Q ๐ 126 Toothpicks: https://youtu.be/-OL_sw2MiYw ๐ 145 Ray Casting 2D: https://youtu.be/TOEi6T2mtHo Timestamps: 0:00 Happy Pi Day 2023! 0:45 Introduce Buffon's Needle 1:40 Unpack the math 4:40 Let toothpick fall at an angle 7:08 The probability that the toothpick crosses the border 7:27 Uniform probability density function 8:12 Illustrate the probability with a graph 10:49 Approximating the value of Pi 11:11 Calculating the area under the curve 12:48 Resources for Buffon's Needle 13:28
Published 2023-03-14 ยท Watch on YouTube โ
Availability and playback restrictions are controlled by the original channel.
Keep exploring Learn to Code
31:20
02:20
4:01:19
57:412018 Top Contributor Party in New York City - Highlights and Interviews
freeCodeCamp.org
1:52:55Data Structures and Algorithms in JavaScript - Full Course for Beginners
freeCodeCamp.org
16:03
49:03