On a regular two dimensional coordinate plane, you have a square with side length 1 unit.
Pick a point within the square at random, and from there travel a random but straight direction .5 units.
What is the probability that you end up still within the square?
First, a simple simulation suggests the answer is around 0.443.
I found it easier to focus on failure instead of success, so
consider the point landing outside the box. I will assume that random direction
is equivalent to picking a random angle between 0 and 2Pi, and by the symmetry
of the problem, I will restrict my focus on starting points (x,y) such that
0<x,y<1/2
Considering a circle of radius 1/2 with center at (x,y), we
want the angle of the arc(s) of the circle to the left of the yaxis and below
the xaxis. Two arcs are formed when x^2+y^2>1/4, and the total angle is
given by 2ArcCos(2x)+2ArcCos(2y). When x^2+y^2<=1/4, we have a single arc of
Pi/4+ArcCos(2x)+ArcCos(2y). Dividing these by the total angle of 2Pi gives us
the density function we need to find the total probability of leaving the box.
Remembering symmetry, we integrate over the lower left 1/2 X
1/2 box (and multiply by 4 and subtract from 1), and we are careful about which
region we use with each density:
Probability of staying in the box=
14Int[Int[(1/2Pi)*(Pi/4+ArcCos[2x]+ArcCos[2y],{y,0,Sqrt[1/4x^2]}]+
Int[(1/2Pi)*(2ArcCos[2x]+2ArcCos[2y],{y,Sqrt[1/4x^2],1/2}],{x,0,1/2}]
=17/(4Pi) approx. 0.443.

Posted by owl
on 20050818 23:25:45 