News for hackers. Stuff that matters.
Re:China urges its people to struggle. Some say no by a_conservative on Thursday July 08, 2021 @11:14AM (#27773011)
If anyone is unsure of the truth of the parent post (like I was), I built a simple simulator in Python to test it for myself [0]

    boys = 100000           girls 99350
    boys = 100000           girls 100333
    boys = 100000           girls 101195
[0] https://pastebin.com/Et5CU3n0
Re:China urges its people to struggle. Some say no by nightcracker on Thursday July 08, 2021 @11:25AM (#27773172)
You simulated the limiting case, where you don't stop having babies until you get a boy. That's (obviously) not realistic as we have a finite lifespan and fertility, but note that the expectation still holds.

In this process you will always get 1 boy, obviously. But you have a (1/2)^k * (1/2) chance of getting k girls before your first boy. Thus the expected number of girls is

   Sum[k * (1/2)^k * (1/2), k, 0, inf]
which is 1: https://www.wolframalpha.com/input/?i=Sum%5Bk+*+%281%2F2%29%... .
Re:China urges its people to struggle. Some say no by a_conservative on Thursday July 08, 2021 @11:42AM (#27773448)
Excellent point! I updated it to make the number of births per family a parameter. It's still an approximation of reality of course.

Here are the results when the number of max births per family is dropped to 2:

    boys = 74861            girls 75166
    boys = 74752            girls 75464
    boys = 75047            girls 74933