YoVDO

Pi Revealed in a Pile of Toothpicks

Offered By: Coding Train via YouTube

Tags

Mathematics Courses p5.js Courses Probability Density Functions Courses

Course Description

Overview

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.

Syllabus

Happy Pi Day 2023!
Introduce Buffon's Needle
Unpack the math
Let toothpick fall at an angle
The probability that the toothpick crosses the border
Uniform probability density function
Illustrate the probablity with a graph
Approximating the value of Pi
Calculating the area under the curve
Resources for Buffon's Needle
Start Coding
Draw vertical lines
Add a toothpick
Draw background in setup
We have to use the built-in value of Pi
Find the closest column
Determine if the toothpick intersects the column
Rotate the line relative to the y-axis
Draw the toothpick as a vertical line
Improve the visuals
Approximate the value of Pi using the probility that a toothpick intersects a column
Suggestions for variations
New Passenger Showcase page on the Coding Train website
Easter egg


Taught by

The Coding Train

Related Courses

Blockchain Essentials
A Cloud Guru
AI Design and Engineering with Microsoft Azure
Cloudswyft via FutureLearn
Aprendizaje de las matemáticas de primaria
Universidad de los Andes via Coursera
Astrophysics: Exploring Exoplanets
Australian National University via edX
Astrophysics: The Violent Universe
Australian National University via edX