Puzzle #4: Working Days

Calculating the number of days between two arbitrary dates is doable for humans and trivial on modern computers. However, calculating the number of working days: Mondays through Fridays, is more complicated. In this puzzle you are asked to devise an algorithm for doing this. This is something you can do on the back of a napkin, so you don’t need anything else then pen, paper and the rational part of your brain.

Puzzle #3: Boys and Girls

Assume a country where every family wants to have a boy and continues having babies until they actually have one. We consider only one generation. The probability of having a boy or a girl is always the same. After some time has passed, what is the ratio between boys and girls in the country?