Monday, June 20, 2011

Ngon Dartboard Probability Simulation

While I was working on the extension problem, Andy Rundquist sent me the results of his simulations along with the screencast showing how he did it in Mathematica.

Evaluating the formula from the last post
\[ \begin{align*}
P \left ( d_{c}\lt d_{e} \right) &= \frac{ tan^3 \frac{\pi}{2n} + 3 tan \frac{\pi}{2n} }{ 6 tan \frac{\pi}{n} } \\
\end{align*} \]
... for several different n, we have:
n Probability Andy's Simulation
3 .1851851852

4 .2189514165

5 .2314757303

6 .237604307

7 .2410913279

8 .2432751885
9 .2447375774
10 .2457666208
Most of the results are fairly close. I think seeing the results of Andy's simulations definitely gave me a little more confidence about posting my attempted solution online.

Some of the numbers from the simulations are a little off and that's expected. Run the simulation a few more times and you'll get a slightly different result every time. They fluctuate around the "true" proportion of darts that will land closer to the center. For the simulation diagrams above, Andy used 30,000 as the number of trials.

Extension (Statistics): What is the number of trials that should be used for simulations if we want most of our simulations to be near our "true" proportion (e.g. within 0.01, 0.001, 0.0001, etc)?

Square Dartboard Probability
Ngon Dartboard Probability
Ngon Dartboard Probability Simulation
Ngon Dartboard Probability Limit

UPDATE: Fixed typos, grammar, and added links to other posts.


  1. Very cool. I learned a lot doing this project. Here's an example: if you want random dots in a circle, don't randomly choose r and theta separately. If you do, half your points will be closer to the center than the edge of the circle (it should only be 1/4 of the points). I ended up doing a separate x and y random coordinate but now I know if you want to do it in polar coords, take the square root of your random number for r. Weird stuff. Thanks for pulling all this together!

  2. @Andy: Here's a James Tanton video on Bertrand's Paradox on this idea. How you choose your points at random affects the probability results.

    This issue came up in class when I wanted to do a cheap lab on confidence intervals involving the proportion of Earth covered by water. The results of randomly sampling points on a globe is different from randomly sampling points on a Mercator Projection map of Earth.

  3. I had never heard of Bertrand's Paradox, thanks for posting that link! It's interesting in this case that I had a sense of what the percentages should be and that's how I knew my polar way was wrong.