# You can calculate Pi by dropping toothpicks on a wood floor

**frauenfelder**#1

**jacob_ewing**#2

This is a neat application of a math puzzle that a teacher showed us in a college math class. The puzzle was to work out the probability of that toothpick intersecting a line when dropped. I was thrilled when I figured it out years later.

**kupfernigk**#3

This is not a way of calculating pi. It is a way of estimating pi using a Monte Carlo-type method.

And yes, I am a grumpy pedant.

**Boundegar**#4

When Daddy steps on a toothpick and jams it up under his big toenail, you can learn new vocabulary too!

**nixiebunny**#6

A much better pi is 355 / 113. Easy to remember: the inverse of 113/355. Good to more digits than youâ€™d expect.

**teknocholer**#7

Everyone knows pi is 245850922/78256779. Just as easy to remember as 3.14159265358979323846â€¦

**jacob_ewing**#8

I usually remember it as

3141592653589793238462643383279502884197169399375105820974944592307816406286208998628034825342117068 over 1000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.

Much easier to remember when the denominator is a clean power ten.

**jerwin**#9

Probably would be a lot easier to simulate on a computer then. Of course, most of the library functions that would be called in such a simulation rely on M_PI in some way.

**davide405**#10

Came to this thread hoping to find someone reminding us this was a probabilistic approximation.

Was not disappointed

**crenquis**#11

Usually one of the first things one does in a monte carlo class â€“ approximate pi.

Edit: first page of my monte carlo bookâ€¦

**knappa**#14

3+ 1/(7 + 1/(15 +1/(1 +1/(292 +1/(1 +1/(1 +1/(1 +1/(2 +1/(1 +1/(3 +1/(1 +1/(14 +1/(2 +1/(1 +1/(1 +1/(2 +1/(2 +1/(2 +1/(2)))))))))))))) or thereaboutsâ€¦

**allenk**#15

I like this problem as an excellent example of a math problem that becomes easier when you generalize it. The more general problem is: if you have a curved piece of wire of length L, and you toss it on this floor (where the lines have spacing 1), whatâ€™s the expected number e(L) of lines crossed? First you argue that e(A+B)=e(A)+e(B), and from that and continuity, that e(A) = cA for some c. Then let L be a circle of diameter 1 to figure out that e(pi) = 2 (it crosses one line, twice). Hence e(1) = 2/pi, which was the original question.

**anon8420928**#18

Donâ€™t we all agree here that you should be able to choose a death that is suitable for you?

**kupfernigk**#19

A weapon of mass destruction that could be deployed in less than 45 minutes - let Tony Blair know.

A very good idea. I have decided that the most suitable death for me would be to die of a heart attack due to the sexual attentions of one of my many mistresses, while travelling on one of my sailing ships from one of the ports of my 2000-year-old empire to one of my holiday palaces, in or about the year 4016.

Perhaps I should start a kickstarter. Sandwich - lacks ambition.

**jerwin**#20

and perfectly straight toothpicks and perfectly paralell lines. Possibly perfectly zero thickness too.

Oh, you can forget about pseudorandom generatorsâ€¦