Главная
Study mode:
on
1
Happy Pi Day 2023!
2
Introduce Buffon's Needle
3
Unpack the math
4
Let toothpick fall at an angle
5
The probability that the toothpick crosses the border
6
Uniform probability density function
7
Illustrate the probablity with a graph
8
Approximating the value of Pi
9
Calculating the area under the curve
10
Resources for Buffon's Needle
11
Start Coding
12
Draw vertical lines
13
Add a toothpick
14
Draw background in setup
15
We have to use the built-in value of Pi
16
Find the closest column
17
Determine if the toothpick intersects the column
18
Rotate the line relative to the y-axis
19
Draw the toothpick as a vertical line
20
Improve the visuals
21
Approximate the value of Pi using the probility that a toothpick intersects a column
22
Suggestions for variations
23
New Passenger Showcase page on the Coding Train website
24
Easter egg
Description:
Discover how to approximate the value of pi using toothpicks in this 25-minute coding tutorial. Learn about Buffon's Needle problem and implement a simulation using p5.js. Explore the mathematical concepts behind the experiment, including probability density functions and area calculations. Follow along as the instructor guides you through coding the simulation, from drawing vertical lines to determining toothpick intersections. Improve your understanding of geometric probability while creating an engaging visual representation of this classic mathematical problem. Gain insights into potential variations of the experiment and explore additional resources for further learning.

Pi Revealed in a Pile of Toothpicks

Coding Train
Add to list
0:00 / 0:00