3 ducks have landed in a circular pond. What is the probability there is a diameter such that the semicircle on one side contains all of them?
Repeat for 4 ducks.
Note: consider the ducks to be randomly chosen points in a circle.
With the bug gone and a 4th duck added:
ct=0; hit=0;
for a=0
for b=0:.5:359.5
for c=0:.5:359.5
for d=0:.5:359.5
ct=ct+1;
set=sort([a b c d]);
aa=set(1);bb=set(2);cc=set(3);dd=set(4);
diff=[bb-aa cc-bb dd-cc aa-dd+360];
if max(diff)>180
hit=hit+1;
end
end
end
end
end
disp([hit ct hit/ct])
results in
185847839 hits out of 373248000 cases for a mean of 0.497920522012174
which is close to 1/2.
|
Posted by Charlie
on 2023-01-24 11:10:00 |