*In a certain city, all of the families (as they want a girl) will have children until they have a girl, or until they have ten children. If no children die, and the chance of getting a girl is 50%, what is the ratio of boys to girls in the city?*

At first glance, it looks like boys would by far outnumber girls, because there are going to be families with nine boys and just one girl, or even with ten boys to no girls. But simple maths suggests differently – the following table will represent this:

Number of families |
Number of girls |
Number of boys |
Total girls |
Total boys |

512 | 1 | 0 | 512 | 0 |

256 | 1 | 1 | 256 | 256 |

128 | 1 | 2 | 128 | 256 |

64 | 1 | 3 | 64 | 192 |

32 | 1 | 4 | 32 | 128 |

16 | 1 | 5 | 16 | 80 |

8 | 1 | 6 | 8 | 48 |

4 | 1 | 7 | 4 | 28 |

2 | 1 | 8 | 2 | 16 |

1 | 1 | 9 | 1 | 9 |

1 | 0 | 10 | 0 | 10 |

Ratio of girls to boys: |
1023 : |
1023 |

A bit of explanation: this table takes a sample size of 1024 families, which some may notice as 2^10, or 10000000000 in base 2. This is because the probability of having a girl, then a boy and a girl, then two boys and a girl (and so on) keeps halving, so you need a sample size that can be halved ten times. The smallest number that qualifies for this is 1024.

Concerning the leftmost column, this is the number of families where the first child is a girl. There’s a 50% chance of this happening, so in our 1024 families, there are 1024*(0.5) = 512 families where the first child is a girl. Of the 512 where the first child is a boy, 512*(0.5) = 256 of them would have a girl as their second child. Now, of the remaining 256, 128 would have a girl as their third child. And so on, until you get to the one family with ten boys. The fourth column from the left multiplies the total girls in each type of family (‘types’ of family include the type with one girl, one boy and one girl, two boys and one girl, etc.) with the number of families there are. It’s not difficult to see that it results in the powers of 2 all being added together, which results in (2^10) -1 = 1023.

(The reason for this is simple enough if you look at the numbers in binary – 1000 + 100 + 10 + 1 [in base 2] = 1111. Since there are no 2s, you can consider this to be the equivalent of 9999 in decimal [NOT numerically {look at all these nested brackets!} but in that you can add 1 to it and you won’t be able to represent it with four digits any more], so 1111 + 1 = 10000. 10000 in decimal is 16, so 1111 is 15. Therefore, in binary, 2^0 + 2^1 + 2^2 …. 2^n = 2^(n+1) – 1.)

If you do the same with the boys – multiplying the number of boys per type of family by the number of such families there are, you get 1023 for the number of boys, as well! 1023 **:** 1023 **: : **1 **:** 1. This maintains the gender balance in society.

This is just one example of how surprising probabilities can be – here’s another:

*You have thirty friends, and this year they’ve all decided to hold birthday parties! Of course, you’re invited to all of them. Assuming all of your friends hold their parties on their birthdays, not a few days before or after, and that none of them were born on the twenty-ninth of February, what are the chances that you’re double-booked for at least one day in the year?*

You’d think that it would be pretty rare, right? After all, there are thirty parties to go to and three hundred and sixty-five days on which they can fall. Well, that’s where you’d be wrong; the chances of it happening are actually 70.6%!

How did I get that figure? That’s a topic for another post!