Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add explanation of Buffon's needle problem #1615

Merged
merged 1 commit into from
Aug 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ Change Log / Ray Tracing in One Weekend

### The Rest of Your Life
- Fix -- Fix typo of "arbitrary" (#1589)
- New -- Added a bit more explanation of Buffon's needle problem (#1529)


----------------------------------------------------------------------------------------------------
Expand Down
13 changes: 9 additions & 4 deletions books/RayTracingTheRestOfYourLife.html
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,13 @@
Estimating Pi
--------------
The canonical example of a Monte Carlo algorithm is estimating $\pi$, so let's do that. There are
many ways to estimate $\pi$, with the Buffon Needle problem being a classic case study. We’ll do a
variation inspired by this method. Suppose you have a circle inscribed inside a square:
many ways to estimate $\pi$, with _Buffon's needle problem_ being a classic case study. In Buffon's
needle problem, one is presented with a floor made of parallel strips of floor board, each of the
same width. If a needle is randomly dropped onto the floor, what is the probability that the needle
will lie across two boards? (You can find more information on this problem with a simple Internet
search.)

We’ll do a variation inspired by this method. Suppose you have a circle inscribed inside a square:

![Figure [circ-square]: Estimating $\pi$ with a circle inside a square
](../images/fig-3.01-circ-square.jpg)
Expand Down Expand Up @@ -449,8 +454,8 @@

One Dimensional Monte Carlo Integration
====================================================================================================
Our Buffon Needle example is a way of calculating $\pi$ by solving for the ratio of the area of the
circle and the area of the circumscribed square:
Our variation of Buffon's needle problem is a way of calculating $\pi$ by solving for the ratio of
the area of the circle and the area of the circumscribed square:

$$ \frac{\operatorname{area}(\mathit{circle})}{\operatorname{area}(\mathit{square})}
= \frac{\pi}{4}
Expand Down