In June 2001, my wife and I
celebrated our golden wedding
anniversary. To our surprise, this 50th
anniversary occurred on the same
day of the week as the wedding 50
years ago. I wondered if this is a
common occurrence.
Consider the 52
years from 1900 through 1951. What
is the exact probability that, for a
randomly selected wedding date in
this period, the golden anniversary (50th anniversary)
fell on the same day of the week?
y=1900; m=1; d=1;
ct=0; yList=[]; considered=0;
dt=datetime(y,m,d);
while y<1952
dt2=datetime(y+50,m,d);
considered=considered+1;
if month(dt2)==m % leap->non-leap gives March vs Feb
if weekday(dt)==weekday(dt2)
ct=ct+1;
if ~ismember(year(dt),yList)
yList(end+1)=year(dt);
end
end
end
jd=juliandate(dt)+1;
dt=datetime(jd,'ConvertFrom','juliandate');
y=year(dt);
m=month(dt);
d=day(dt);
end
ct
considered
ct/considered
yList
finds
ct =
9431
considered =
18992
ans =
0.49657750631845 == the desired probability
Fifty years can be 18262 or 18263 days depending on the number of leap year days intervening--either 12 or 13. 18263 is divisible by 7, and so all the dates in a 1-year span of March through February will or will not be weekday matches. Leap year days will definitely not be matches, as 50 years later will not be another leap year. This 4-year cycle is certainly a basis for the major part of an analytic solution, but with consideration for the fact that 1900 was not a leap year although it was divisible by 4, so that the first two months of that year are not in sync with the cycle.
|
Posted by Charlie
on 2025-02-14 10:43:31 |