Pi Revealed in a Pile of Toothpicks
Offered By: Coding Train via YouTube
Course Description
Overview
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
Introduction to LogicStanford University via Coursera Networked Life
University of Pennsylvania via Coursera Introduction to Mathematical Thinking
Stanford University via Coursera Computational Photography
Georgia Institute of Technology via Coursera Initiation à la théorie des distributions
École Polytechnique via Coursera