12 ms·
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 ferti
by nightcracker 5y ago
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%5Ek+*+%281%2F2%29%2C+k%2C+0%2C+inf%5D https://www.wolframalpha.com/input/?i=Sum%5Bk+*+%281%2F2%29%... .
- a_conservative 5y agoExcellent 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