A clock has an hour, minute, and second hand, all of length 1. Let T be the triangle formed by the ends of these hands. A time of day is chosen uniformly at random. What is the expected value of the area of T?
clearvars
tot=0; ct=0;
for h=0:11
for m=0:59
for s=0:59
t=h+m/60+s/3600;
hh=360*t/12;
mh=360*(t-floor(t));
sh=360*(t*60-floor(t*60));
angles=repmat([hh mh sh],1,2);
angles=abs(angles(2:4)-angles(3:5));
for i=1:3
sides(i)=sqrt(2-2*cosd(angles(i)));
end
a=sides(1);b=sides(2);c=sides(3);
sabc=sum(sides)/2;
A=sqrt(sabc*(sabc-a)*(sabc-b)*(sabc-c));
tot=tot+A;
ct=ct+1;
end
end
end
disp([tot ct])
tot/ct
uses the angles between each pair of hands to find the side lengths using the law of cosines with the known 1-unit lengths of the hands, and then uses Heron's formula to find the area of the triangle with the three found sides.
The 43,200 areas add up to 20626.4790145681 for an average of 0.477464792003891.
This numerical integration is also valid (is the answer) for the case where the mechanism moves only every second, as it is done at intervals of one second. But if the all the hands including the second hand move smoothly, a better approximation is given with the following replacement line:
for s=0:.01:59.99
which gives the average as 0.477464829271844.
Putting the approximation of 0.4774648 into Wolfram Alpha identifies the result as 3/(2*pi) =~ 0.477464829275686, presumably the value for a continuously moving set of hands. Or else that's the value for the average for 3 randomly chosen points, in which case the current problem is remarkably close. Otherwise the difference in the last 4 digits would come from adding hundreds of thousands of numbers together and represents rounding error.
|
Posted by Charlie
on 2023-08-23 14:58:30 |