Download as pdf or txt
Download as pdf or txt
You are on page 1of 9

Needles in Haystacks, Oceans and More

Youve probably heard the old saying, its like finding a needle in a haystack, meaning looking for
something is as hopeless as trying to paddle your kitchen table up shits creek using a spatula. Chinese
has a similar saying you probably havent heard: C , which approximately means to fish for a
needle in the ocean. But needles are for more than just metaphors and sowing: they are also
infinitely thin and serve recreational mathematical investigation into probability quite well.
Well begin by examining a pretty old problem about needles: the Buffon Needle experiment/prob-
lem. The experiment is to drop a needle on a large sheet of lined paper, with lines (parallel horizontal
lines) that have as the distance between them the length of the needle (though we generalize for a
needle of any length). What is the probability that the needle lies on one of the lines?
The traditional problem, where the needle has length 1 (designating the distance between two parallel
lines as the unit length WLOG), gives a probability of hitting the lines
2

; this is largely the reason the


experiment is well known, as it is a good way to experimentally approximate the value of . Lets first
consider the case where the length of the needle has (0,1]. We will say that the probability of
hitting a line is P() =
1

]
0

p() d, where p() is the probability of hitting a line given that the angle
of the needle to the paralell lines is . Well consider a single pair of lines as the boundary for where
the needle can fall, (that is, at least one end of the needle is somewhere between two specific lines),
since this is representative of the infinitely long and wide sheet of paper. Then p() =
]
0
1
q(x) dx,
where q(x) =
1 if the needle touches the horizontal
0 otherwise
, given that the needle is at angle to the
horizontal and one end of the needle is at x above the lower horizontal line.

1
Sin
The function q(x) isnt really necessary for our calculations here, it just helps for us to realize where
the values we get are coming from. Thus, since the needle will touch the horizontal when it is any-
where from x [1 Sin , 1] as you can see from the diagram, (and of course also at x = 0),
]
0
1
q(x) dx is equal to the length of this interval, which is of course Sin . Then
P() =
1

]
0

]
0
1
q(x) dx d
P() =
1

]
0

Sin d
P() =
1

_ Cos

0
P() =
2

So, when = 1, we obtain the expected value of


2

as the probability that the needle does hit a line. It


is nice to note that the probability increases linearly with when [0, 1]. Note: we integrated over
the range [0, ] because the needle is symmetric about 180
o
flips.
Now lets do the case of 1 (well see quickly why the same method cant be used: just consider
the result for a moment, which would say that can only get as large as

2
, when in fact there is a
finite non-zero probability for any positive ). Well integrate this time just over the distance from
one end of the needle to the lower horizontal: P() =
]
0
1
p(x) dx, where p(x) = probability of touch-
ing a line when one end is exactly x units from the lower horizontal. Then well consider the probabil-
ity that the needle doesnt hit, i.e. the range the angle can take so that the needle stays between the
two horizontals: specifically, the range

2
,

2
j. The range ArcSin
x

j, ArcSin
1x

jj gives
what were looking for, as the diagrams below demonstrate.

1 x
x

ArcSin
x

ArcSin
1x

Then p(x) =
1

|ArcSin|
1x

] +ArcSin|
x

]], so we can evaluate


P() directly:
P() =
1

]
0
1
|ArcSin
x

j +ArcSin
1x

j] dx
P() =
2

]
0
1
ArcSin
x

j dx
P() =
2

]
0
1f
ArcSin[] d
P() =
2

_ 1
2
+ ArcSin
1 f
0
P() =
2

1
1

2
+
1

ArcSin
1

1
P() =
2

|
2
1 +ArcSin
1

]
This is the probability of not hitting, so 1 P() is the probability that the needle does land on a line.
Note that these two cases - for less than and greater than 1 - agree at = 1 both in value and
derivative (so the probability function is continuous). Below is its graph for [0, 3]:
0.0 0.5 1.0 1.5 2.0 2.5 3.0

0.2
0.4
0.6
0.8
1.0
P()
It is also interesting to note that the probability for > 1 is really the same, only with that arcsin
integral multiplying it.
Needles in Haystacks, Oceans and More
Youve probably heard the old saying, its like finding a needle in a haystack, meaning looking for
something is as hopeless as trying to paddle your kitchen table up shits creek using a spatula. Chinese
has a similar saying you probably havent heard: C , which approximately means to fish for a
needle in the ocean. But needles are for more than just metaphors and sowing: they are also
infinitely thin and serve recreational mathematical investigation into probability quite well.
Well begin by examining a pretty old problem about needles: the Buffon Needle experiment/prob-
lem. The experiment is to drop a needle on a large sheet of lined paper, with lines (parallel horizontal
lines) that have as the distance between them the length of the needle (though we generalize for a
needle of any length). What is the probability that the needle lies on one of the lines?
The traditional problem, where the needle has length 1 (designating the distance between two parallel
lines as the unit length WLOG), gives a probability of hitting the lines
2

; this is largely the reason the


experiment is well known, as it is a good way to experimentally approximate the value of . Lets first
consider the case where the length of the needle has (0,1]. We will say that the probability of
hitting a line is P() =
1

]
0

p() d, where p() is the probability of hitting a line given that the angle
of the needle to the paralell lines is . Well consider a single pair of lines as the boundary for where
the needle can fall, (that is, at least one end of the needle is somewhere between two specific lines),
since this is representative of the infinitely long and wide sheet of paper. Then p() =
]
0
1
q(x) dx,
where q(x) =
1 if the needle touches the horizontal
0 otherwise
, given that the needle is at angle to the
horizontal and one end of the needle is at x above the lower horizontal line.

1
Sin
The function q(x) isnt really necessary for our calculations here, it just helps for us to realize where
the values we get are coming from. Thus, since the needle will touch the horizontal when it is any-
where from x [1 Sin , 1] as you can see from the diagram, (and of course also at x = 0),
]
0
1
q(x) dx is equal to the length of this interval, which is of course Sin . Then
P() =
1

]
0

]
0
1
q(x) dx d
P() =
1

]
0

Sin d
P() =
1

_ Cos

0
P() =
2

So, when = 1, we obtain the expected value of


2

as the probability that the needle does hit a line. It


is nice to note that the probability increases linearly with when [0, 1]. Note: we integrated over
the range [0, ] because the needle is symmetric about 180
o
flips.
Now lets do the case of 1 (well see quickly why the same method cant be used: just consider
the result for a moment, which would say that can only get as large as

2
, when in fact there is a
finite non-zero probability for any positive ). Well integrate this time just over the distance from
one end of the needle to the lower horizontal: P() =
]
0
1
p(x) dx, where p(x) = probability of touch-
ing a line when one end is exactly x units from the lower horizontal. Then well consider the probabil-
ity that the needle doesnt hit, i.e. the range the angle can take so that the needle stays between the
two horizontals: specifically, the range

2
,

2
j. The range ArcSin
x

j, ArcSin
1x

jj gives
what were looking for, as the diagrams below demonstrate.

1 x
x

ArcSin
x

ArcSin
1x

Then p(x) =
1

|ArcSin|
1x

] +ArcSin|
x

]], so we can evaluate


P() directly:
P() =
1

]
0
1
|ArcSin
x

j +ArcSin
1x

j] dx
P() =
2

]
0
1
ArcSin
x

j dx
P() =
2

]
0
1f
ArcSin[] d
P() =
2

_ 1
2
+ ArcSin
1 f
0
P() =
2

1
1

2
+
1

ArcSin
1

1
P() =
2

|
2
1 +ArcSin
1

]
This is the probability of not hitting, so 1 P() is the probability that the needle does land on a line.
Note that these two cases - for less than and greater than 1 - agree at = 1 both in value and
derivative (so the probability function is continuous). Below is its graph for [0, 3]:
0.0 0.5 1.0 1.5 2.0 2.5 3.0

0.2
0.4
0.6
0.8
1.0
P()
It is also interesting to note that the probability for > 1 is really the same, only with that arcsin
integral multiplying it.
2 Needle Experiments.nb
Needles in Haystacks, Oceans and More
Youve probably heard the old saying, its like finding a needle in a haystack, meaning looking for
something is as hopeless as trying to paddle your kitchen table up shits creek using a spatula. Chinese
has a similar saying you probably havent heard: C , which approximately means to fish for a
needle in the ocean. But needles are for more than just metaphors and sowing: they are also
infinitely thin and serve recreational mathematical investigation into probability quite well.
Well begin by examining a pretty old problem about needles: the Buffon Needle experiment/prob-
lem. The experiment is to drop a needle on a large sheet of lined paper, with lines (parallel horizontal
lines) that have as the distance between them the length of the needle (though we generalize for a
needle of any length). What is the probability that the needle lies on one of the lines?
The traditional problem, where the needle has length 1 (designating the distance between two parallel
lines as the unit length WLOG), gives a probability of hitting the lines
2

; this is largely the reason the


experiment is well known, as it is a good way to experimentally approximate the value of . Lets first
consider the case where the length of the needle has (0,1]. We will say that the probability of
hitting a line is P() =
1

]
0

p() d, where p() is the probability of hitting a line given that the angle
of the needle to the paralell lines is . Well consider a single pair of lines as the boundary for where
the needle can fall, (that is, at least one end of the needle is somewhere between two specific lines),
since this is representative of the infinitely long and wide sheet of paper. Then p() =
]
0
1
q(x) dx,
where q(x) =
1 if the needle touches the horizontal
0 otherwise
, given that the needle is at angle to the
horizontal and one end of the needle is at x above the lower horizontal line.

1
Sin
The function q(x) isnt really necessary for our calculations here, it just helps for us to realize where
the values we get are coming from. Thus, since the needle will touch the horizontal when it is any-
where from x [1 Sin , 1] as you can see from the diagram, (and of course also at x = 0),
]
0
1
q(x) dx is equal to the length of this interval, which is of course Sin . Then
P() =
1

]
0

]
0
1
q(x) dx d
P() =
1

]
0

Sin d
P() =
1

_ Cos

0
P() =
2

So, when = 1, we obtain the expected value of


2

as the probability that the needle does hit a line. It


is nice to note that the probability increases linearly with when [0, 1]. Note: we integrated over
the range [0, ] because the needle is symmetric about 180
o
flips.
Now lets do the case of 1 (well see quickly why the same method cant be used: just consider
the result for a moment, which would say that can only get as large as

2
, when in fact there is a
finite non-zero probability for any positive ). Well integrate this time just over the distance from
one end of the needle to the lower horizontal: P() =
]
0
1
p(x) dx, where p(x) = probability of touch-
ing a line when one end is exactly x units from the lower horizontal. Then well consider the probabil-
ity that the needle doesnt hit, i.e. the range the angle can take so that the needle stays between the
two horizontals: specifically, the range

2
,

2
j. The range ArcSin
x

j, ArcSin
1x

jj gives
what were looking for, as the diagrams below demonstrate.

1 x
x

ArcSin
x

ArcSin
1x

Then p(x) =
1

|ArcSin|
1x

] +ArcSin|
x

]], so we can evaluate


P() directly:
P() =
1

]
0
1
|ArcSin
x

j +ArcSin
1x

j] dx
P() =
2

]
0
1
ArcSin
x

j dx
P() =
2

]
0
1f
ArcSin[] d
P() =
2

_ 1
2
+ ArcSin
1 f
0
P() =
2

1
1

2
+
1

ArcSin
1

1
P() =
2

|
2
1 +ArcSin
1

]
This is the probability of not hitting, so 1 P() is the probability that the needle does land on a line.
Note that these two cases - for less than and greater than 1 - agree at = 1 both in value and
derivative (so the probability function is continuous). Below is its graph for [0, 3]:
0.0 0.5 1.0 1.5 2.0 2.5 3.0

0.2
0.4
0.6
0.8
1.0
P()
It is also interesting to note that the probability for > 1 is really the same, only with that arcsin
integral multiplying it.
Needle Experiments.nb 3
Needles in Haystacks, Oceans and More
Youve probably heard the old saying, its like finding a needle in a haystack, meaning looking for
something is as hopeless as trying to paddle your kitchen table up shits creek using a spatula. Chinese
has a similar saying you probably havent heard: C , which approximately means to fish for a
needle in the ocean. But needles are for more than just metaphors and sowing: they are also
infinitely thin and serve recreational mathematical investigation into probability quite well.
Well begin by examining a pretty old problem about needles: the Buffon Needle experiment/prob-
lem. The experiment is to drop a needle on a large sheet of lined paper, with lines (parallel horizontal
lines) that have as the distance between them the length of the needle (though we generalize for a
needle of any length). What is the probability that the needle lies on one of the lines?
The traditional problem, where the needle has length 1 (designating the distance between two parallel
lines as the unit length WLOG), gives a probability of hitting the lines
2

; this is largely the reason the


experiment is well known, as it is a good way to experimentally approximate the value of . Lets first
consider the case where the length of the needle has (0,1]. We will say that the probability of
hitting a line is P() =
1

]
0

p() d, where p() is the probability of hitting a line given that the angle
of the needle to the paralell lines is . Well consider a single pair of lines as the boundary for where
the needle can fall, (that is, at least one end of the needle is somewhere between two specific lines),
since this is representative of the infinitely long and wide sheet of paper. Then p() =
]
0
1
q(x) dx,
where q(x) =
1 if the needle touches the horizontal
0 otherwise
, given that the needle is at angle to the
horizontal and one end of the needle is at x above the lower horizontal line.

1
Sin
The function q(x) isnt really necessary for our calculations here, it just helps for us to realize where
the values we get are coming from. Thus, since the needle will touch the horizontal when it is any-
where from x [1 Sin , 1] as you can see from the diagram, (and of course also at x = 0),
]
0
1
q(x) dx is equal to the length of this interval, which is of course Sin . Then
P() =
1

]
0

]
0
1
q(x) dx d
P() =
1

]
0

Sin d
P() =
1

_ Cos

0
P() =
2

So, when = 1, we obtain the expected value of


2

as the probability that the needle does hit a line. It


is nice to note that the probability increases linearly with when [0, 1]. Note: we integrated over
the range [0, ] because the needle is symmetric about 180
o
flips.
Now lets do the case of 1 (well see quickly why the same method cant be used: just consider
the result for a moment, which would say that can only get as large as

2
, when in fact there is a
finite non-zero probability for any positive ). Well integrate this time just over the distance from
one end of the needle to the lower horizontal: P() =
]
0
1
p(x) dx, where p(x) = probability of touch-
ing a line when one end is exactly x units from the lower horizontal. Then well consider the probabil-
ity that the needle doesnt hit, i.e. the range the angle can take so that the needle stays between the
two horizontals: specifically, the range

2
,

2
j. The range ArcSin
x

j, ArcSin
1x

jj gives
what were looking for, as the diagrams below demonstrate.

1 x
x

ArcSin
x

ArcSin
1x

Then p(x) =
1

|ArcSin|
1x

] +ArcSin|
x

]], so we can evaluate


P() directly:
P() =
1

]
0
1
|ArcSin
x

j +ArcSin
1x

j] dx
P() =
2

]
0
1
ArcSin
x

j dx
P() =
2

]
0
1f
ArcSin[] d
P() =
2

_ 1
2
+ ArcSin
1 f
0
P() =
2

1
1

2
+
1

ArcSin
1

1
P() =
2

|
2
1 +ArcSin
1

]
This is the probability of not hitting, so 1 P() is the probability that the needle does land on a line.
Note that these two cases - for less than and greater than 1 - agree at = 1 both in value and
derivative (so the probability function is continuous). Below is its graph for [0, 3]:
0.0 0.5 1.0 1.5 2.0 2.5 3.0

0.2
0.4
0.6
0.8
1.0
P()
It is also interesting to note that the probability for > 1 is really the same, only with that arcsin
integral multiplying it.
Next we'll look at a related - though much more general - needle dropping problem (a special case of
which is the buffon needle problem). The problem is this: if we drop a needle of length on an
infinite rectangular lattice, each rectangle having dimensions , what is the probability that the
needle will lay on one of the lattice lines? We should expect that the answer to this problem, some
probability function P(, , ) should have the property that Lim
o
P(, , ) = P(), the probability
we calculated for the previous problem, since a lattice with rectangles whose length is infinite is an
infinitely large sheet of lined paper.
How do we get P (, , )? We will again just consider one rectangle as the space in which one end of
the needle must land as our sample space: then given a value of , the angle to the horizontal of the
needle, there are a few critical points to be considered (as there were two in the previous problem).
They are illustrated below (for the case of
< Min[, ]):


Cos
Sin
Those four positions of the needle are the furthest NorthWest, NorthEast, SouthWest and SouthEast
the "bottom end" of the needle can be so that the needle stays inside the rectangle, i.e. the needle
doesn't cross the lattice lines. Thus that end of the needle has the light blue shaded region as it's
home to roam freely without crossing the lattice line: anywhere else, it will cross a lattice line. Thus,
we simply need to calculate the probability that it lands in that region, which is the area of the region
divided by the total area of the rectangle (). And the area of the region is calculable in terms of our
variables as well- it's two sides are given by Cos and Sin , so that it has area
( Cos ) ( Sin ) = Sin Cos +
2
Sin Cos . Now we simply have to
integrate over the range of , which we can make to be just [0, f 2] by symmetry. Thus
P(, , ) =
2

]
0

2
1

( Sin Cos +
2
Sin Cos ) d
P(, , ) =
2

_ + Cos Sin
1
2

2
Cos
2

f 2
0
P(, , ) =
2

2
0 +(0 ) ( 0) |0
1
2

2
]
P(, , ) = 1
2

+

2

= 1
2 (+)+
2

Thus, as expected, if we let or go to infinity, we get back the answer to the Buffon Needle Prob-
lem:
Lim
o
(1 P(, , )) = Lim
o

2 (+)
2


=
2

0
=
2

Which is equivalent to what we had: we set the length between two horizontal lines as the unit length
in the Buffon problem, but we could have just replaced by

and the same solution would apply to


the case where the length between horizontals is . (The probability calculated here is the probability
of not touching a lattice line, so we used 1 P.)
We can get a numerical value now for a simple specific case: where = = , we obtain
P(, , ) = 1
3
2

2
= 1
3

- .045, which is pretty unlikely.


We do need to use different bounds for when } [0, Min[, ]], the reason being that the needle
cannot be entirely inside the rectangle for some values of if it is longer than one of the sides. If
[Min[, ], Max[, ]], only one bound needs to be changed; if _Max[, ],
2
+
2
, then
both bounds need to be changed. (
2
+
2
is the largest can be before the probability is automati-
cally one: you can convince yourself of this.) The diagram below shows why this is the case. (We can
let s WLOG, else switch
them.)

ArcSin


ArcCos


Thus, for the second case (where [, ]), the function is
P(, , ) =
2

+ Cos Sin
1
2

2
Cos
2

f 2
ArcCos

j
, which is something weird,
while for the third case (where _,
2
+
2
we
get
P(, , ) =
2

+ Cos Sin
1
2

2
Cos
2

ArcSin_

ArcCos

j
, which is also something
weird. The graph of the probability function, with each of these cases included, is below (though
unfortunately not interactive in a PDF):
0.0 0.2 0.4 0.6 0.8 1.0

0.2
0.4
0.6
0.8
1.0
P(,
1
2
,1)
4 Needle Experiments.nb
Next we'll look at a related - though much more general - needle dropping problem (a special case of
which is the buffon needle problem). The problem is this: if we drop a needle of length on an
infinite rectangular lattice, each rectangle having dimensions , what is the probability that the
needle will lay on one of the lattice lines? We should expect that the answer to this problem, some
probability function P(, , ) should have the property that Lim
o
P(, , ) = P(), the probability
we calculated for the previous problem, since a lattice with rectangles whose length is infinite is an
infinitely large sheet of lined paper.
How do we get P (, , )? We will again just consider one rectangle as the space in which one end of
the needle must land as our sample space: then given a value of , the angle to the horizontal of the
needle, there are a few critical points to be considered (as there were two in the previous problem).
They are illustrated below (for the case of
< Min[, ]):


Cos
Sin
Those four positions of the needle are the furthest NorthWest, NorthEast, SouthWest and SouthEast
the "bottom end" of the needle can be so that the needle stays inside the rectangle, i.e. the needle
doesn't cross the lattice lines. Thus that end of the needle has the light blue shaded region as it's
home to roam freely without crossing the lattice line: anywhere else, it will cross a lattice line. Thus,
we simply need to calculate the probability that it lands in that region, which is the area of the region
divided by the total area of the rectangle (). And the area of the region is calculable in terms of our
variables as well- it's two sides are given by Cos and Sin , so that it has area
( Cos ) ( Sin ) = Sin Cos +
2
Sin Cos . Now we simply have to
integrate over the range of , which we can make to be just [0, f 2] by symmetry. Thus
P(, , ) =
2

]
0

2
1

( Sin Cos +
2
Sin Cos ) d
P(, , ) =
2

_ + Cos Sin
1
2

2
Cos
2

f 2
0
P(, , ) =
2

2
0 +(0 ) ( 0) |0
1
2

2
]
P(, , ) = 1
2

+

2

= 1
2 (+)+
2

Thus, as expected, if we let or go to infinity, we get back the answer to the Buffon Needle Prob-
lem:
Lim
o
(1 P(, , )) = Lim
o

2 (+)
2


=
2

0
=
2

Which is equivalent to what we had: we set the length between two horizontal lines as the unit length
in the Buffon problem, but we could have just replaced by

and the same solution would apply to


the case where the length between horizontals is . (The probability calculated here is the probability
of not touching a lattice line, so we used 1 P.)
We can get a numerical value now for a simple specific case: where = = , we obtain
P(, , ) = 1
3
2

2
= 1
3

- .045, which is pretty unlikely.


We do need to use different bounds for when } [0, Min[, ]], the reason being that the needle
cannot be entirely inside the rectangle for some values of if it is longer than one of the sides. If
[Min[, ], Max[, ]], only one bound needs to be changed; if _Max[, ],
2
+
2
, then
both bounds need to be changed. (
2
+
2
is the largest can be before the probability is automati-
cally one: you can convince yourself of this.) The diagram below shows why this is the case. (We can
let s WLOG, else switch
them.)

ArcSin


ArcCos


Thus, for the second case (where [, ]), the function is
P(, , ) =
2

+ Cos Sin
1
2

2
Cos
2

f 2
ArcCos

j
, which is something weird,
while for the third case (where _,
2
+
2
we
get
P(, , ) =
2

+ Cos Sin
1
2

2
Cos
2

ArcSin_

ArcCos

j
, which is also something
weird. The graph of the probability function, with each of these cases included, is below (though
unfortunately not interactive in a PDF):
0.0 0.2 0.4 0.6 0.8 1.0

0.2
0.4
0.6
0.8
1.0
P(,
1
2
,1)
Needle Experiments.nb 5
Next we'll look at a related - though much more general - needle dropping problem (a special case of
which is the buffon needle problem). The problem is this: if we drop a needle of length on an
infinite rectangular lattice, each rectangle having dimensions , what is the probability that the
needle will lay on one of the lattice lines? We should expect that the answer to this problem, some
probability function P(, , ) should have the property that Lim
o
P(, , ) = P(), the probability
we calculated for the previous problem, since a lattice with rectangles whose length is infinite is an
infinitely large sheet of lined paper.
How do we get P (, , )? We will again just consider one rectangle as the space in which one end of
the needle must land as our sample space: then given a value of , the angle to the horizontal of the
needle, there are a few critical points to be considered (as there were two in the previous problem).
They are illustrated below (for the case of
< Min[, ]):


Cos
Sin
Those four positions of the needle are the furthest NorthWest, NorthEast, SouthWest and SouthEast
the "bottom end" of the needle can be so that the needle stays inside the rectangle, i.e. the needle
doesn't cross the lattice lines. Thus that end of the needle has the light blue shaded region as it's
home to roam freely without crossing the lattice line: anywhere else, it will cross a lattice line. Thus,
we simply need to calculate the probability that it lands in that region, which is the area of the region
divided by the total area of the rectangle (). And the area of the region is calculable in terms of our
variables as well- it's two sides are given by Cos and Sin , so that it has area
( Cos ) ( Sin ) = Sin Cos +
2
Sin Cos . Now we simply have to
integrate over the range of , which we can make to be just [0, f 2] by symmetry. Thus
P(, , ) =
2

]
0

2
1

( Sin Cos +
2
Sin Cos ) d
P(, , ) =
2

_ + Cos Sin
1
2

2
Cos
2

f 2
0
P(, , ) =
2

2
0 +(0 ) ( 0) |0
1
2

2
]
P(, , ) = 1
2

+

2

= 1
2 (+)+
2

Thus, as expected, if we let or go to infinity, we get back the answer to the Buffon Needle Prob-
lem:
Lim
o
(1 P(, , )) = Lim
o

2 (+)
2


=
2

0
=
2

Which is equivalent to what we had: we set the length between two horizontal lines as the unit length
in the Buffon problem, but we could have just replaced by

and the same solution would apply to


the case where the length between horizontals is . (The probability calculated here is the probability
of not touching a lattice line, so we used 1 P.)
We can get a numerical value now for a simple specific case: where = = , we obtain
P(, , ) = 1
3
2

2
= 1
3

- .045, which is pretty unlikely.


We do need to use different bounds for when } [0, Min[, ]], the reason being that the needle
cannot be entirely inside the rectangle for some values of if it is longer than one of the sides. If
[Min[, ], Max[, ]], only one bound needs to be changed; if _Max[, ],
2
+
2
, then
both bounds need to be changed. (
2
+
2
is the largest can be before the probability is automati-
cally one: you can convince yourself of this.) The diagram below shows why this is the case. (We can
let s WLOG, else switch
them.)

ArcSin


ArcCos


Thus, for the second case (where [, ]), the function is
P(, , ) =
2

+ Cos Sin
1
2

2
Cos
2

f 2
ArcCos

j
, which is something weird,
while for the third case (where _,
2
+
2
we
get
P(, , ) =
2

+ Cos Sin
1
2

2
Cos
2

ArcSin_

ArcCos

j
, which is also something
weird. The graph of the probability function, with each of these cases included, is below (though
unfortunately not interactive in a PDF):
0.0 0.2 0.4 0.6 0.8 1.0

0.2
0.4
0.6
0.8
1.0
P(,
1
2
,1)
6 Needle Experiments.nb
Next we'll look at a related - though much more general - needle dropping problem (a special case of
which is the buffon needle problem). The problem is this: if we drop a needle of length on an
infinite rectangular lattice, each rectangle having dimensions , what is the probability that the
needle will lay on one of the lattice lines? We should expect that the answer to this problem, some
probability function P(, , ) should have the property that Lim
o
P(, , ) = P(), the probability
we calculated for the previous problem, since a lattice with rectangles whose length is infinite is an
infinitely large sheet of lined paper.
How do we get P (, , )? We will again just consider one rectangle as the space in which one end of
the needle must land as our sample space: then given a value of , the angle to the horizontal of the
needle, there are a few critical points to be considered (as there were two in the previous problem).
They are illustrated below (for the case of
< Min[, ]):


Cos
Sin
Those four positions of the needle are the furthest NorthWest, NorthEast, SouthWest and SouthEast
the "bottom end" of the needle can be so that the needle stays inside the rectangle, i.e. the needle
doesn't cross the lattice lines. Thus that end of the needle has the light blue shaded region as it's
home to roam freely without crossing the lattice line: anywhere else, it will cross a lattice line. Thus,
we simply need to calculate the probability that it lands in that region, which is the area of the region
divided by the total area of the rectangle (). And the area of the region is calculable in terms of our
variables as well- it's two sides are given by Cos and Sin , so that it has area
( Cos ) ( Sin ) = Sin Cos +
2
Sin Cos . Now we simply have to
integrate over the range of , which we can make to be just [0, f 2] by symmetry. Thus
P(, , ) =
2

]
0

2
1

( Sin Cos +
2
Sin Cos ) d
P(, , ) =
2

_ + Cos Sin
1
2

2
Cos
2

f 2
0
P(, , ) =
2

2
0 +(0 ) ( 0) |0
1
2

2
]
P(, , ) = 1
2

+

2

= 1
2 (+)+
2

Thus, as expected, if we let or go to infinity, we get back the answer to the Buffon Needle Prob-
lem:
Lim
o
(1 P(, , )) = Lim
o

2 (+)
2


=
2

0
=
2

Which is equivalent to what we had: we set the length between two horizontal lines as the unit length
in the Buffon problem, but we could have just replaced by

and the same solution would apply to


the case where the length between horizontals is . (The probability calculated here is the probability
of not touching a lattice line, so we used 1 P.)
We can get a numerical value now for a simple specific case: where = = , we obtain
P(, , ) = 1
3
2

2
= 1
3

- .045, which is pretty unlikely.


We do need to use different bounds for when } [0, Min[, ]], the reason being that the needle
cannot be entirely inside the rectangle for some values of if it is longer than one of the sides. If
[Min[, ], Max[, ]], only one bound needs to be changed; if _Max[, ],
2
+
2
, then
both bounds need to be changed. (
2
+
2
is the largest can be before the probability is automati-
cally one: you can convince yourself of this.) The diagram below shows why this is the case. (We can
let s WLOG, else switch
them.)

ArcSin


ArcCos


Thus, for the second case (where [, ]), the function is
P(, , ) =
2

+ Cos Sin
1
2

2
Cos
2

f 2
ArcCos

j
, which is something weird,
while for the third case (where _,
2
+
2
we
get
P(, , ) =
2

+ Cos Sin
1
2

2
Cos
2

ArcSin_

ArcCos

j
, which is also something
weird. The graph of the probability function, with each of these cases included, is below (though
unfortunately not interactive in a PDF):
0.0 0.2 0.4 0.6 0.8 1.0

0.2
0.4
0.6
0.8
1.0
P(,
1
2
,1)
Finally we throw needles at a slightly more interesting (but equally simple) shape: a circle! What is the
probability that a needle of length dropped on a unit circle will lie on its circumference? (For the
analysis we assume one end of the needle has landed inside the circle.) We'll say that the probability
of laying on the circumference is P() =
]
1
1
w
x
p(x) dx, where p(x) is the probability of laying on
the circumference given that one end of the needle is exactly x units away from the center of the
circle: because of this approach, we need to add in a weight factor, w
x
, which represents the
"probability" that the needle has one end exactly x units from the center. (The lower bound is 1
because for x < 1 the needle cannot touch the circumference of the circle, and so p(x) = 0 for
those values. This is strictly for s 1: we'll consider the case of [1, 2] later.) In the previous two
problems this weight factor was the same for every point in the sample space because we considered
each point individually and took the integral over the whole space. But with the circle, instead of
doing the same, we want to use the symmetry of the circle to allow us only to consider one radius line
as the sample space: but the likelihood of landing at the origin exactly (x = 0) is clearly less than
landing exactly on the circumference of the circle (x = 1). (This may seem false given the fact that
both have probability 0 when calculated directly, but when we consider the limit definition of the
continuous space of points we're working with, the weights become necessary in "integral" form.)
What is this weight function? It has to have
]
0
1
w
x
dx = 1 (the sum of all the probabilities has to be 1),
and in particular the probability of landing x units away from the origin is the area (length) of the set
of points with this property, 2 x, divided by the total area of the circle, . Thus w
x
=
2 x

= 2 x,
which is already normalized (
]
0
1
2 x dx = 1]. Thus P() = 2
]
0
1
x p(x) dx. Now, how do we find p(x)?
A diagram helps here.

1
x
p(x) is equal to

, using the in the above diagram: all angles [0, ] for the needle to take as an
angle to the horizontal will let the needle cross the circumference: all others (in the range [0, ]) will
not. Since the range [, 2 ] is identical we can consider only this space: then we want to know what
is in terms of x and . We can use the law of cosines to find out:
x
2
+
2
2 x Cos( ) = 1
= = ArcCos
x
2
+
2
1
2 x
j
= = ArcCos
x
2
+
2
1
2 x
j
Now we have everything we need to calculate P() :
P() =
]
1
1
2 x|1
1

ArcCos
x
2
+
2
1
2 x
j] dx, which is valid for s 1. For 1 s s 2, we have to adjust
the bounds and make a slight adjustment: we mentioned before that the lower bound is 1 on this
integral because for that case, x [0, 1 ] gives p(x) = 0. But for > 1, that range of values gives
p(x) = 1: thus, we simply have to add
]
0
1
2 x dx to the integral we already have when evaluating in
the second case, that is
P() = (1 )
2
+
]
1
1
2 x|1
1

ArcCos
x
2
+
2
1
2 x
j] dx ! [1, 2].
Unfortunately, I cannot evaluate this integral (because of how funky the thing in the arccosine func-
tion is), and Mathematica doesn't seem to want to do the job either. As a result I'm not 100% positive
this result is correct, as this sort of probabalistic analysis can get a little funky at times (I've already
corrected four or five incorrect analyses of mine on this problem alone). So we'll leave this for now.
Needle Experiments.nb 7
Finally we throw needles at a slightly more interesting (but equally simple) shape: a circle! What is the
probability that a needle of length dropped on a unit circle will lie on its circumference? (For the
analysis we assume one end of the needle has landed inside the circle.) We'll say that the probability
of laying on the circumference is P() =
]
1
1
w
x
p(x) dx, where p(x) is the probability of laying on
the circumference given that one end of the needle is exactly x units away from the center of the
circle: because of this approach, we need to add in a weight factor, w
x
, which represents the
"probability" that the needle has one end exactly x units from the center. (The lower bound is 1
because for x < 1 the needle cannot touch the circumference of the circle, and so p(x) = 0 for
those values. This is strictly for s 1: we'll consider the case of [1, 2] later.) In the previous two
problems this weight factor was the same for every point in the sample space because we considered
each point individually and took the integral over the whole space. But with the circle, instead of
doing the same, we want to use the symmetry of the circle to allow us only to consider one radius line
as the sample space: but the likelihood of landing at the origin exactly (x = 0) is clearly less than
landing exactly on the circumference of the circle (x = 1). (This may seem false given the fact that
both have probability 0 when calculated directly, but when we consider the limit definition of the
continuous space of points we're working with, the weights become necessary in "integral" form.)
What is this weight function? It has to have
]
0
1
w
x
dx = 1 (the sum of all the probabilities has to be 1),
and in particular the probability of landing x units away from the origin is the area (length) of the set
of points with this property, 2 x, divided by the total area of the circle, . Thus w
x
=
2 x

= 2 x,
which is already normalized (
]
0
1
2 x dx = 1]. Thus P() = 2
]
0
1
x p(x) dx. Now, how do we find p(x)?
A diagram helps here.

1
x
p(x) is equal to

, using the in the above diagram: all angles [0, ] for the needle to take as an
angle to the horizontal will let the needle cross the circumference: all others (in the range [0, ]) will
not. Since the range [, 2 ] is identical we can consider only this space: then we want to know what
is in terms of x and . We can use the law of cosines to find out:
x
2
+
2
2 x Cos( ) = 1
= = ArcCos
x
2
+
2
1
2 x
j
= = ArcCos
x
2
+
2
1
2 x
j
Now we have everything we need to calculate P() :
P() =
]
1
1
2 x|1
1

ArcCos
x
2
+
2
1
2 x
j] dx, which is valid for s 1. For 1 s s 2, we have to adjust
the bounds and make a slight adjustment: we mentioned before that the lower bound is 1 on this
integral because for that case, x [0, 1 ] gives p(x) = 0. But for > 1, that range of values gives
p(x) = 1: thus, we simply have to add
]
0
1
2 x dx to the integral we already have when evaluating in
the second case, that is
P() = (1 )
2
+
]
1
1
2 x|1
1

ArcCos
x
2
+
2
1
2 x
j] dx ! [1, 2].
Unfortunately, I cannot evaluate this integral (because of how funky the thing in the arccosine func-
tion is), and Mathematica doesn't seem to want to do the job either. As a result I'm not 100% positive
this result is correct, as this sort of probabalistic analysis can get a little funky at times (I've already
corrected four or five incorrect analyses of mine on this problem alone). So we'll leave this for now.
8 Needle Experiments.nb
Finally we throw needles at a slightly more interesting (but equally simple) shape: a circle! What is the
probability that a needle of length dropped on a unit circle will lie on its circumference? (For the
analysis we assume one end of the needle has landed inside the circle.) We'll say that the probability
of laying on the circumference is P() =
]
1
1
w
x
p(x) dx, where p(x) is the probability of laying on
the circumference given that one end of the needle is exactly x units away from the center of the
circle: because of this approach, we need to add in a weight factor, w
x
, which represents the
"probability" that the needle has one end exactly x units from the center. (The lower bound is 1
because for x < 1 the needle cannot touch the circumference of the circle, and so p(x) = 0 for
those values. This is strictly for s 1: we'll consider the case of [1, 2] later.) In the previous two
problems this weight factor was the same for every point in the sample space because we considered
each point individually and took the integral over the whole space. But with the circle, instead of
doing the same, we want to use the symmetry of the circle to allow us only to consider one radius line
as the sample space: but the likelihood of landing at the origin exactly (x = 0) is clearly less than
landing exactly on the circumference of the circle (x = 1). (This may seem false given the fact that
both have probability 0 when calculated directly, but when we consider the limit definition of the
continuous space of points we're working with, the weights become necessary in "integral" form.)
What is this weight function? It has to have
]
0
1
w
x
dx = 1 (the sum of all the probabilities has to be 1),
and in particular the probability of landing x units away from the origin is the area (length) of the set
of points with this property, 2 x, divided by the total area of the circle, . Thus w
x
=
2 x

= 2 x,
which is already normalized (
]
0
1
2 x dx = 1]. Thus P() = 2
]
0
1
x p(x) dx. Now, how do we find p(x)?
A diagram helps here.

1
x
p(x) is equal to

, using the in the above diagram: all angles [0, ] for the needle to take as an
angle to the horizontal will let the needle cross the circumference: all others (in the range [0, ]) will
not. Since the range [, 2 ] is identical we can consider only this space: then we want to know what
is in terms of x and . We can use the law of cosines to find out:
x
2
+
2
2 x Cos( ) = 1
= = ArcCos
x
2
+
2
1
2 x
j
= = ArcCos
x
2
+
2
1
2 x
j
Now we have everything we need to calculate P() :
P() =
]
1
1
2 x|1
1

ArcCos
x
2
+
2
1
2 x
j] dx, which is valid for s 1. For 1 s s 2, we have to adjust
the bounds and make a slight adjustment: we mentioned before that the lower bound is 1 on this
integral because for that case, x [0, 1 ] gives p(x) = 0. But for > 1, that range of values gives
p(x) = 1: thus, we simply have to add
]
0
1
2 x dx to the integral we already have when evaluating in
the second case, that is
P() = (1 )
2
+
]
1
1
2 x|1
1

ArcCos
x
2
+
2
1
2 x
j] dx ! [1, 2].
Unfortunately, I cannot evaluate this integral (because of how funky the thing in the arccosine func-
tion is), and Mathematica doesn't seem to want to do the job either. As a result I'm not 100% positive
this result is correct, as this sort of probabalistic analysis can get a little funky at times (I've already
corrected four or five incorrect analyses of mine on this problem alone). So we'll leave this for now.
Needle Experiments.nb 9

You might also like