Pi Revealed in a Pile of Toothpicks

Pi Revealed in a Pile of Toothpicks

The Coding Train via YouTube Direct link

Happy Pi Day 2023!

1 of 24

1 of 24

Happy Pi Day 2023!

Class Central Classrooms beta

YouTube playlists curated by Class Central.

Classroom Contents

Pi Revealed in a Pile of Toothpicks

Automatically move to the next video in the Classroom when playback concludes

  1. 1 Happy Pi Day 2023!
  2. 2 Introduce Buffon's Needle
  3. 3 Unpack the math
  4. 4 Let toothpick fall at an angle
  5. 5 The probability that the toothpick crosses the border
  6. 6 Uniform probability density function
  7. 7 Illustrate the probablity with a graph
  8. 8 Approximating the value of Pi
  9. 9 Calculating the area under the curve
  10. 10 Resources for Buffon's Needle
  11. 11 Start Coding
  12. 12 Draw vertical lines
  13. 13 Add a toothpick
  14. 14 Draw background in setup
  15. 15 We have to use the built-in value of Pi
  16. 16 Find the closest column
  17. 17 Determine if the toothpick intersects the column
  18. 18 Rotate the line relative to the y-axis
  19. 19 Draw the toothpick as a vertical line
  20. 20 Improve the visuals
  21. 21 Approximate the value of Pi using the probility that a toothpick intersects a column
  22. 22 Suggestions for variations
  23. 23 New Passenger Showcase page on the Coding Train website
  24. 24 Easter egg

Never Stop Learning.

Get personalized course recommendations, track subjects and courses with reminders, and more.

Someone learning on their laptop while sitting on the floor.