Thanks for the idea

]]>She came to the same conclusion. Very good work!

]]>This can also be done without calculating the midpoints. We can consider the sample angle itself as the angle of the midpoint, and then calculate the distance.

The threshold of the distances are sqrt(2*(1-cos 27)), sqrt(2*(1-cos 36)) and sqrt(2*(1-cos 45))

J simulation:

```
load 'trig'
samp =: 1000000
a1=:(?samp$360)*1p1%180 NB. The angles
a2=:(?samp$360)*1p1%180
a3=:(?samp$360)*1p1%180
x1=:cos a1 NB. The points
y1=:sin a1
x2=:cos a2
y2=:sin a2
x3=:cos a3
y3=:sin a3
d1=:(((x1-x2)^2)+(y1-y2)^2)^%2 NB. The distances
d2=:(((x1-x3)^2)+(y1-y3)^2)^%2
d3=:(((x3-x2)^2)+(y3-y2)^2)^%2
l1=:d1<0.618034 NB. Conditions to be met
l2=:d2<0.76536686
l3=:d3<0.46689
(+/%#)(l1*.l2)*.l3
```

≈0.027433

Time taken for execution is about 0.758 seconds.

]]>I have been playing with that all night. So far, I have not done it. Perhaps you will?

]]>Yes, it was the only way that could work in both programs. M does not have an IntersectRegion command.

]]>It might be compilable. I see why you stuck with the midpoint idea for both.]]>

I discovered that too after I had posted the program. It does appear to be a substantial improvement.

Here is the code you requested:

```
dist[{x1_,y1_},{x2_,y2_}]:=\[Sqrt]((x2-x1)^2+(y2-y1)^2);
midpoint[{{x1_,y1_},{x2_,y2_}}]:={(x1+x2)/2,(y1+y2)/2};
sectormid[arcangle_] := Module[{a = RandomInteger[{0, 360}]},
arc1 = {{Cos[Degree*a], Sin[Degree*a]}, {Cos[Degree*(a + arcangle)],
Sin[Degree*(a + arcangle)]}} // N;
midpoint[arc1]];
ans=Table[{sectormid[18],sectormid[36],sectormid[54]},{100000}];
s1=Select[ans,dist[First[#],#[[2]]]<=0.45399&];
s2=Select[s1,dist[First[#],#[[3]]]<=0.58779&];
s3=Select[s2,dist[#[[2]],#[[3]]]<=0.69466&];Length[s3]/100000.
```

As you can see there is much chance for improvement. It will run faster on your machines than mine too.

]]>Polar was a last resort, after more than a week of fumbling with those vectors, I finally gave up. Anyways, they have the same problem the sector command does. It was difficult to tell when there was a triple intersection. In the end the polygon - polar idea with the distance between the midpoints that finally worked. The M code is on the way.

]]>Thanks for all the work. Why did you choose polar coordinates and not vectors or the Sector command for the sectors? Can you post the Mathematica code when you get a chance?

]]>Daniel C wrote:

]]>The probability two sectors with central angles α and β intersect is (α+β) / (2π).

This can easily be proven with a diagram. The second sector can be right to the left or right of the first, or anywhere in between. This results in an angle of α+β.

Now, to the problem. Fix the sector with central angle π/10, and call it A. Consider the sector with central angle 2π/10, and call it B. The third sector is C. The probability B intersects A is 3/20, by the fact above.

Now, let f be the function that models the intersection of A and B for each position. Since area is linearly dependent on angle, f first rises, stays constant, and then falls (draw it yourself; draw a circle, a sector, and see where the second sector can intersect the first). The graph looks like a hill.

Either way, the point is that the expected value for the area of the intersection is π/15. Now, by our fact above, the probability that C intersects our current intersection is 11/60. Once again, this is valid because area is linearly dependent on angle.

Our probability is, multiplying our two probabilities:

3/20⋅11/60=11/400

Also, I must try this one. Looks cool.

]]>