logoalt Hacker News

card_zerolast Sunday at 4:55 PM2 repliesview on HN

I was thinking along these lines: suppose it's a needle, but it can't rotate. It always falls at the same angle. Then there's no noodle, and no apparent connection to circles. Is pi still involved? Next, suppose there are two perpendicular angles that are permitted, and the needle always falls at one of those. That means you can have square noodles, but rotations still aren't allowed, so the squares must always be aligned the same way, and the only suggestion of a circle is if you consider a square to be an approximation to a circle. Then three angles, hexagonal noodles. Does an approximation to pi therefore slowly creep in as you increase the sides on the polygon?


Replies

CrazyStattoday at 1:42 AM

> Does an approximation to pi therefore slowly creep in as you increase the sides on the polygon?

Yes, under some assumptions. As the sibling comment points out, if there’s a single allowed angle theta then the expected number of intersections is cos(theta) * L/W (-pi/2 < theta < pi/2). You can get from this fact to the standard Buffon’s needle result by integrating wrt theta to find the average probability over thetas with a uniform distribution on (-pi/2 < theta < pi/2): \int 1/pi * cos(theta) * L/W d theta.

Now suppose you have two angles, theta_1 and theta_2. The expected number of intersections for each of them is as above, and if the needle falls at one or the other with equal probability then the overall expectation is 1/2 * cos(theta_1) * L/W + 1/2 * cos(theta_2) * L/W. Passing to the case with n distinct angles with equal probabilities we have \sum_i 1/n cos(theta_i) * L/W.

Now if we make the further assumption that the angles are evenly distributed over (-pi/2 < theta < pi/2), i.e. they are the angles of the sides of a regular n-gon, then we can interpret that sum as a Riemann sum. If we write it as

1/pi \sum_i pi/n cos(theta_i) * L/W

Then pi/n is the delta_i term in the riemann sum, and the limit is

lim_{n -> inf} 1/pi \sum_i pi/n cos(theta_i) * L/W = 1/pi \int cos(theta) * L/W d theta.

We can pull the L/W out, leaving \int_-pi/2^pi/2 cos(theta) d theta = sin(pi/2) - sin(-pi/2) = 2, giving the final result of 2/pi * L/W.

Essentially, as we increase the number of allowable angles we are approximating an integral of the cosine function (times constants) from -pi to pi, which is where the pi creeps in. The angles don’t need to be strictly evenly spaced for this to work—if they are independent randomly selected from the uniform distribution then it will also work, as you’re then performing a monte carlo integration.

_alternator_last Sunday at 5:52 PM

For the first question, the answer is just cos(\theta)*L/W, where theta is the angle off horizontal (assuming the floorboards are vertical). So a trig function shows up, if not pi.

If you don't allow rotations, but somehow still take a polygonal limit to circles, I suspect you'll end up with the same answer. But the limit is necessarily restricted relative to highly symmetric polygons going this route.

In general, rotational symmetry gives a ton of power to simplify the math, and leads to highly general results like arbitrary "noodles" having the same average crossing count as needles of the same length.