About an answer given for Project Euler 19

188 Views Asked by At

The problem is here and someone gave this answer but I don't understand it even if I know the rule of large numbers.

If you want to write a code for this, it is really boring. On the other hand, if someone asks you if some day is Sunday, the probability of yes is 1/7. The rule of large numbers indicate that over many guesses (n), the number of your true guess will approach n/7 as n gets large. So for 120 months in 20th century, it's enough to check integers close to 1200/7=171.4.., which are 171 and 172 and by far less probability 170 and 173. The answer is 171 :)

I don't understand when he says "the number of your true guess will approach n/7" and also why he divided "1200" and not "120" by 7 ?

EDIT: I would like to understand why he used the probability of a sunday in a week and not a sunday in a month ?

Thank you in advance