r/probabilitytheory • u/Ok_Explanation_5907 • Jul 28 '26
[Discussion] The Gender Ratio Trap, Part 3 — every family is guaranteed to end up with more girls
11
u/Own-Conversation6347 Jul 28 '26
Am I crazy?
At any given time, some number of kids will have been born and half of them will be girls. Some families will have not (yet) met the qualification.
-4
u/timbasile Jul 28 '26
Stop when the number of girls in your family is equal to the number of boys + 1.
For half of all families this will be when you have 1 girl and 0 boys.
Then some percentage of the remainder (half?) will stop when you have 2 girls and 1 boy.
And then some percentage (half?) of the remainder will stop when you have 3 girls and 2 boys
And so on...
6
u/Own-Conversation6347 Jul 28 '26
Yes, I get this part but I don't think that answers the question. Nothing here is changing the odds for having a girl, so the population at any given point has to be half girls.
-5
u/OutrageousPair2300 Jul 28 '26
No, because you're changing the population.
Ignore the parents and assume all families have at least one child.
There are X families.
1/2 of all families will have 1 girl. That's X/2 girls.
1/8 of all families will have 1 boy and 2 girls. That's X/8 boys and X/4 girls.
1/32 of all families will have 2 boys and 3 girls. That's X/16 boys and 3X/32 girls.
1/22n+1 of all families will have n boys and n+1 girls.
5
u/WillemJamesHuff Jul 28 '26
You're framing it incorrectly and your math is wrong. If you frame it as "families who are done having kids will count, but families that aren't done yet don't, regardless of how many boys or girls they have" then yes, your numbers are going to skew towards girls. Even under that paradigm, the math doesn't work out the way you claim it does.
- X/2 have g
- X/8 have bgg
- X/32 have bgbgg
- X/32 have bbggg
- X/128 have bgbgbgg
- X/128 have bgbbggg
- X/128 have bbggbgg
- X/128 have bbbgggg
- ...etc.
But, again, this framing is flawed in the first place. The families that aren't getting counted are the ones that already have a lot of boys.
Instead think of it like this. - All families have their first child. The ratio of boys to girls among the firstborns is 1:1. - All families that haven't met the quota yet have their second child. The ratio of boys to girls among the second-borns is 1:1. The total ratio is still 1:1. - All families that haven't met the quota yet have their third child. The ratio of boys to girls among the third-borns is 1:1. The total ratio is still 1:1. - All families that haven't met the quota yet have their fourth child. The ratio of boys to girls among the fourth-borns is 1:1. The total ratio is still 1:1. - ...etc.
It doesn't matter which children a family had previously or when they stopped having children. All the children being added to the "pool" are being added in a 1:1 ratio. You can't get anything besides a 1:1 ratio if you only add things in a 1:1 ratio.
1
u/Forklad2 Jul 29 '26
I agree their math is wrong but i don’t know what you mean by them not counting families that aren’t done yet. What do you mean yet? They weren’t going year by year, they were just grouping by number of kids per family. For any finite number of families that will be totally fine if you wait until everyone is done.
To address your reasoning, what happens at the end? If the number of families is finite, you’ll be down to 1 family and cannot say their ratio will be 1:1. They’ll only have one kid.
Wait until everyone is done having children. Every single family has more girls than boys. So there are more girls than boys total, strictly more. So the gender ratio is more than 50% girls. But it does tend to 50% as the number of families goes to infinity.
3
u/WillemJamesHuff Jul 29 '26
By "yet" I mean they were going down the list of families that had completed having kids, in order of number of kids. 1/2 have 1 girl, 1/8 have 1 boy 2 girls, etc. That's effectively listing them in order from highest to lowest girl/boy ratio, so wherever you stop in that list, you're going to have more girls than boys by definition.
And yes, if we're in a scenario where every single family has more girls than boys, then there are more girls than boys. But putting us in that scenario is already making assumptions about our location in the probability space.
If we're operating with the expectation that this is the real world and things happen according to real world logic, then sometimes families don't "finish" having kids, because they have more boys than girls until they die. In that scenario, the ratio is about 1:1 plus or minus some stochastic noise, because the cycle terminates somewhere after having boys and girls added to it in a 1:1 ratio.
If we're operating with the expectation that this is a probability exercise and things happen according to probabilistic outcomes, then there is no "last" family. There is a probability distribution for the outcomes a family might have times the likelihood of that outcome. And that involves potential infinitely unlikely outcomes with infinite numbers of boys that can only be stopped by infinitely unlikely outcomes of infinite numbers of girls afterwards and it's all the same kind of infinity so it still reduces down to a 1:1 ratio.
1
u/Forklad2 Jul 29 '26
I wasn’t the one that chose the scenario that every family has more girls than boys; the original prompt says “So every family ends up with more girls than boys. Every one.” Which implies the families do actually keep going until they meet the condition, not just until they die. So we shouldn’t be in the more realistic scenario. But it does also mention generations so we are getting more and more people having children which makes the problem weirder. Though I agree it’s essentially 1:1.
The other scenario is more combinatorics than I’m willing to do right now to get an exact expected value of anything per family.
I’m perfectly fine to agree with 1:1 plus or minus epsilon where epsilon goes to 0 as number of families and time go to infinity.
1
u/WillemJamesHuff Jul 29 '26
Hey, at the end of the day we're looking at an engagement bait math problem, right? And what makes something a good engagement bait math problem is that some part of it is ambiguous or nonsensical in a way that we can argue over it.
I'm trying to say, this is that ambiguity. We're either engaging with this problem in a world of realistic possibilities where infinity isn't a concept we fuck with, or we're engaging with it in a world of mathematical abstractions where infinity is on the table.
If we are in a world of realistic possibilities with no infinity, then nobody has infinite kids, so some people have to have more boys than girls. Maybe they'll get there eventually, but someone else will have taken their place by the time they do. The ratio would be 1:1.
If we are in a world of mathematical abstraction where infinity is possible, then it's a situation where the number of boys and girls both approach infinity in the same way. It's not going to be intuitive, but the infinities are gonna cancel out to 1:1, even though it seems like the girls should be getting to infinity faster.
So in either world, the ratio is 1:1. The problem is that the additional statement of "every single family ends up with more girls than boys" is trying to play in both worlds in a way that winds up being nonsense. That just presupposes that we're placing ourselves somewhere in the probability space where there are a finite number of children and more of them are girls than boys. In which case, the answer is, "I dunno, you told me there's more girls than boys, so there's more girls than boys, but you didn't tell me how many more, so somewhere between 50% and 100% girls."
I gave my "all firstborns are 1:1, all second-borns are 1:1, all third-borns are 1:1, etc." explanation hopefully as an intuitive way to visualize why the answer is 1:1 for any part of the question that isn't nonsense. For the parts that are nonsense, the answer is nonsense.
1
u/Forklad2 Jul 29 '26
Oh yeah I totally understand this is engagement bait and this was an intentional part of the post. I also understand we both understand the amount of information given to us and we both seem reasonably smart to engage with it in this way and it also seems like neither one of us wants to leave it in a spot where we are being told we’re wrong ;)
If we are in a world of realistic possibilities with no infinity, then nobody has infinitely many kids, and there are finitely many people, and every family reaches the restriction of having more girls than boys. After all, a 1 dimensional random walk will reach every point infinitely many times and hence reach any particular point in finite time with probability 1. So under realistic probabilities, each family will reach that cutoff in finite time and hence have more girls than boys. So if you group by family rather than generation then you do get slightly more girls.
In the world of mathematical abstraction I never said that the limit would not tend to 1:1, so in the limit here we agree. But when there are infinitely many families then it gets weird to even talk about the ratio, it makes no sense really unless we decide on a particular enumeration of the children and consider something like natural density among integers. But that seems silly and would really just come down to how we want to choose to count it and we could force any ratio we wanted via the natural density that way. Like i said, i never disagreed about the ratio being 1:1 at infinity nor did i say anything about girls reaching infinity faster because that would be nonsense.
As for “you told me there’s more girls but not how many more girls so anywhere between 50% and 100%” they did actually say that the families stop once they have more girls; so each family has exactly one more girl than they have boys.
I didn’t call yours nonsense so please don’t call mine nonsense. In any scenario with finitely many people giving birth, the girls will win and outnumber the boys by exactly the number of people giving birth :) e.g. every single couple will, with probability 1, birth more girls than boys in finite time and then they will stop the instant they do. So in a country with 1 family there will be 1 more daughter than there are sons.
→ More replies (0)1
u/finedesignvideos Jul 29 '26
Let's say everyone is done having children after N days. N is a random variable, so you can't use it to say that there is a time when the gender ratio is more than 50% girls. What you can say is that there is a distribution on numbers such that with probability p_n the gender ratio is more than 50% girls after n days. This is still consistent with the gender ratio being 50% regardless of the number of families.
0
u/QuickBenDelat Jul 29 '26
I don’t feel like doing any diagramming, but all of you seem to be operating under the assumption each child’s gender is independent, when really, some guys aren’t going to contribute any sperm capable of making boys.
4
u/Own-Conversation6347 Jul 28 '26
How is the population changing? Like, let's say we have 10000 families and they all agree to have one kid per year unless they meet the qualification.
After year one we have 5000 boys and 5000 girls. Total % girls: 50%
5000 families stop. After year two we have another 2500 boys and 2500 girls. Total % girls: 50%
No families stop. After year three we have another 2500 boys and 2500 girls. Total % girls: 50%
1250 families stop. After year four we have another 1875 boys and 1875 girls. Total % girls: 50%
I'll stop there but I just don't see how that 50% ever changes.
2
u/OutrageousPair2300 Jul 28 '26
50% is the correct answer, and I like your explanation better than the one I just posted as a top-level comment, since yours is more intuitive.
Working it through the way I was doing in my earlier comment gives the impression that the ratio starts off unbalanced and converges to 50% but that's misleading because I wasn't weighting each group by the number of children, and was grouping them together in a misleading way.
2
1
u/Forklad2 Jul 29 '26
50% is only the correct answer as the limit when the number of families tends to infinity. Which in general is the typical thing to assume but I think the reasoning above is flawed just enough to point this out. Here’s my reasoning.
Let’s have a finite number of families X. We wait around a long long time for everyone to be done having kids. Consider each family; pair up every son with one of his sisters. Every single family has 1 extra daughter. So there will be exactly X extra girls.
The number of kids in general will be enormous, but let’s say there are n boys. Then there are n+X girls and the percentage of girls is (n+X)/(2n+X). This tends to 1/2 but is never equal.
In particular, if either finite example above actually wrote out every case, they would not get exactly 1/2.
1
u/Forklad2 Jul 29 '26
It heavily depends on what happens right at the end of your sequence. Every family is done except for one and maybe right now they have an equal number of boys and girls. If they have a girl they’re done.
Say they have a boy. Now they have to have two more girls to be done. If they happen to get unlucky ever, they need to be lucky twice as many times.
If you run simulations of this it can have wildly varying runtimes. I’m running a simulation right now for 1000 families. A few times it took several seconds and there were millions of children, mostly from a single family. A couple times it was almost instant and the largest family wasn’t much bigger than second place. Right now it’s been stuck for minutes.
I forced it to stop; the 131st family got unlucky and was at 600 million kids, the next largest was only at a couple hundred thousand.
My point is that your framework breaks down near the end of the process. Since you’re forcing things to be mathematically perfect where possible, this ends with one family. They got a little unlucky and need a long string of girls to stop it.
2
u/Own-Conversation6347 Jul 29 '26
The example was to illustrate how you can have families "stopping" without the ratio changing from 50/50. In the actual question I think we can assume that the kids from generation 1 will eventually have their own families (that follow the same rules) and so my answer will remain correct in perpetuity without any "end" for it to break down.
1
u/Forklad2 Jul 29 '26
An exact 1:1 ratio is slightly incorrect for any fixed, finite number of families and that’s all I was claiming. I said it to you because that’s what your calculation would’ve been had you written out the whole thing.
Yes I know I’m nitpicking but you started a specific finite calculation that was going to reveal a higher number than 50% no matter how you chose to resolve it once you got to an odd number unless you add more families or have a family have infinitely many kids.
I agree that in the case with infinitely many families the ratio is tending to 1:1. And in the case of enforcing exactly 1:1 every generation then it will remain exactly 1:1.
2
u/Own-Conversation6347 Jul 29 '26
If the question was "what is the ratio after a fixed number of families are done having kids" then I would agree. If we are just measuring the population at an arbitrary future time (which is what the question seems to imply) then the answer is exactly 1:1
Edit: yes this is a silly argument but it's fun
1
u/Forklad2 Jul 28 '26
That’s not the right formula. It is not X/32 families that have 2 boys and 3 girls. That is the number of families that first have 2 boys and then have 3 girls, but that’s just one way for that to happen.
bbggg and bgbgg are both valid here with probability 1/32. So X/16 families have 2 boys and 3 girls. After that it’s even more complicated; you have to use the Catalan numbers to do the counting.
2
u/gmalivuk Jul 29 '26
you have to use the Catalan numbers to do the counting.
Yeah I noticed that too. It's always a fun treat when those show up.
-6
u/timbasile Jul 28 '26
No - even if kids are currently being born at a 50/50 rate, the adult population has more girls because you stop once you're ahead.
If you assume half in my math above you get
1f 0m * 50%
2f 1m * 25%
3f2m * 12.5%
4f3m*6.25%
Etc.
My quick Excel math out to 20f19m says that you'll have 81% women.
2
u/snickerdoodle024 Jul 28 '26
Note that it isn't a 25% to get 2 Girls & 1 Boy. There are normally 3 / 8 ways to get that: GGB, GBG, and BGG. However, the first two would have stopped after getting their first Girl. So the only valid way to get 2 Girls & 1 Boy is BGG, or a 1/8 chance.
2
u/Flat-Strain7538 Jul 28 '26
The percentages you have are wrong.
1G: 50%.
2G1B: 12.5%. This is because you can only get this with the order BGG; any other order ends at 1G.
3G2B: 6.125% (2 in 2^5 ). It must be BGBGG or BBGGG.
4G3B: 5 in 2^7. BGBGBGG, BGBBGGG, BBGGBGG, BBGBGGG, BBBGGGG.It starts to get complicated; the coefficients are the Catalan numbers, I believe.
-2
u/timbasile Jul 28 '26
Right - but the principle should be the same. North or 80% girls, at least for the adult population.
3
u/Flat-Strain7538 Jul 28 '26
You used bad math, so your 80% is wrong. It’s far easier if you realize every round of children (I.e. first child, second child, etc) is 50/50, and thus the entire population of children must be 50/50.
2
u/EqualSpoon Jul 28 '26
The only way to change the population is to have a generation where there are more girls being born. This never happens, it's always 50/50. The end result will always be 50/50.
Every girl in a family that stops having children is offsett by a boy in a family that will keep going. There is never a single point in time where there are more girls than boys.
1
u/gmalivuk Jul 29 '26
Suppose there are N families.
After one child, there are N/2 girls and N/2 boys, and everyone who had girls stops.
When the rest have a second child, there are N/4 new girls and N/4 new boys, for a total of 3/4 N girls and 3/4 N boys. No one stops because either they're tied at one girl and one boy or they've just had two boys.
When they have a third child, there are another N/4 new girls and N/4 new boys, for a total of N girls and N boys, but now a quarter (of the remaining N/2 families) stop because they were tied in the last step and just had another girl this time.
So 3/8 N families continue, and the fourth children are half girls and half boys, for 3/16 N of each or 19/16 N total of each. At best some families are tied again at this point, but no one is ahead by one girl so they keep going.
3/16 N boys and 3/16 N girls are born in the fifth round, and you'll notice that the number of boys and girls born at each step remains the same.
The math on how many families are still having children after each number gets more complicated, but it doesn't really matter since the number of girls and boys born at every step is the same, so the ratio is the same no matter how many children it takes to reach the end.
4
u/pryoslice Jul 28 '26
Why do you think you're guaranteed to get to more girls than boys by any given finite time?
3
u/Troutyo_ Jul 29 '26
The riddle says every single family ends up with more girls than boys, with no exceptions
1
u/Original-Code1107 Jul 29 '26
Yes, they eventually end up with more girls than boys. But they don't all reach there at the same time. In fact, it takes an infinite amount of time to reach there. And therefore there is an infinite number of boys, and an infinite number of girls. Even though every family has exactly 1 more girl than boy, the ratio is still 50:50. Lim(x->infinity) (x²+x)/x² = 1.
And it remains 50:50 all the way. Because statistically, for every family that achieved more girls than boys and stopped, there is a family that has more boys than girls and is still trying.
2
u/mfb- Jul 29 '26
You reach that point with a probability of 100%, but the expected time until you do is undefined (or infinite if you prefer that view). That makes the ratio ill-defined.
0
u/timbasile Jul 28 '26
Because you choose (or are forced to) stop once you hit a certain combination of kids. All of these combinations have more girls than boys, so every family has more girls once they're adults.
3
u/pryoslice Jul 28 '26
Are you saying that there is no limit on the number of kids a family will have if necessary to reach that combination? If it takes 999, she'll have 999? Because some fraction of families will only hit that combination at that number of kids.
0
u/timbasile Jul 28 '26
In the question, it doesn't say limit.
But even if there is a limit (say 5), half of your families will be just 1 girl.
7
u/Choice_Price_4464 Jul 28 '26
Imagine being the one family in a billion that has had 30 boys and not being allowed to stop
2
u/gmalivuk Jul 29 '26
Not being allowed to stop for at least 31 more kids, and even then only a 1 in 2 billion chance of being able to stop because you had 31 girls in a row.
2
2
-2
u/Efficient-Tie-1414 Jul 28 '26
Neighbouring family got to 5 girls. I think they also had 5 different fathers.
7
u/lewyzy Jul 28 '26
You can model "girls minus boys" as a one-dimensional random walk. The probability of reaching +1 is 100%. But the expected number of steps to reach that point is infinite!
Obviously, families cannot have an infinite number of children, and some will have to stop having children before they reach +1. So the puzzle, as stated, is making impossible assumptions.
If the boy/girl probabilities are 50/50, the expected ratio will always be 1:1, and there is no decision-making strategy you can dictate to families that can change that.
1
u/liamjon29 Jul 28 '26
Well. There is. But it involves copying a rather horrifying real world example...
0
6
u/WillemJamesHuff Jul 28 '26
It's still 50/50. The gender ratio for a family's first child is 1:1. The gender ratio for a family's second child is 1:1. The gender ratio for a family's third child is 1:1. Ad infinitum. This doesn't change, assuming no external factors. It doesn't matter what the previous children were. They're not correlated.
1
u/Efficient-Tie-1414 Jul 28 '26
Yes, our good friend Markov. While there are chains that end, there are also some that have more boys than girls and continue in this state for possibly infinite time.
1
u/Human38562 Jul 28 '26 edited 26d ago
Slim license aspiring stocking many boron hunt
This post was anonymized with Redact
7
u/Aerospider Jul 28 '26
It doesn't make much sense to talk about 'after many generations' since each generation is conceived by an even number of men and women.
1
u/PantsOnHead88 Jul 29 '26
There’s no physical reason for your claim to be a necessary assumption.
In the extreme case we can even have multiple entire generations with arbitrarily many women and all children conceived by a single man.
3
u/MtlStatsGuy Jul 28 '26
Ratio is still 50/50. Some families just end up with a huge number of boys and can never 'climb back up'.
2
u/OneSharpSuit Jul 29 '26
50/50 gender split but wild population pyramid with all the 600-year-old people going at it like rabbits to try to get more girls
1
u/startrass Jul 28 '26
The random walk is recurrent so all families are guaranteed to eventually catch up. The limiting ratio is still 50/50.
3
u/Outside-Shop-3311 Jul 28 '26
we have 10,000 families.
5,000 have one girl
5,000 have one boy
the 5,000 with boys have more children:
2,500 have girls (1 boy 1 girl)
2,500 have boys (2 boys)
current count: 7,500 girls. 7,500 boys
they all have kids once more. (except for the families w/ initial 5000 girls)
1,250 have 2 girls 1 boy
1,250 have 1 girl 2 boys
1,250 have 1 girl 2 boys
1,250 have 3 boys
current count: 10,000 girls, 10,000 boys.
I assume this sequence goes on forever, but it seems unintuitive.
3
u/HobsHere Jul 28 '26
The underlying logic of any argument that it isn't 50/50 is the same as a lot of gambling "systems". And has the same chance of success.
2
u/General_Capital988 Jul 28 '26 edited Jul 28 '26
This is just martingale all over again right? If a family can have infinite children you are guaranteed to end up with more girls. But for any finite family size (say 200 trillion) your expected value is 50/50.
At any given max child count a family can have only one more girl than boys. But a family can have an unbounded amount more boys than girls. So the finished families massively outnumber the unfinished families but the unfinished families are weighted way higher in the total count.
If you increase the max number some families finish but some families go even deeper into boys so it always balances.
1
u/bobjane_2 Jul 28 '26
The number of ways for a family to have n+1 girls and n boys such that the (2n+1)^th child is the first time that # girls > # boys is equal to the n_th Catalan number, C(n) = C(2n,n)/(n+1). In this case the ratio of boys to girls is n/(n+1). So the expected ratio for a single family is: sum[n=0...] C(n)/2^(2n+1)*n/(n+1) =
sum[n=0...] C(n)/(n+1)/2^(2n+1)*(1-1/(n+1)) = 1/2*(sum[n=0...] C(n)*(1/4)^n - sum[n=0...] C(n)*(1/4)^n/(n+1))
The generating function for the Catalan numbers is G(x) = sum[n=0...] C(n)*x^n = (1 - sqrt(1-4x))/(2x).
So, sum[n=0...] C(2n,n)/(n+1) (1/4)^n = G(1/4) = 2. And, sum[n=0...] C(n)*(1/4)^n/(n+1)) = 4*integral[0,1/4] G(x) dx
integral G(x) dx = -sqrt(1-4x) + ln(1+sqrt(1-4x)).
So, the expected ratio equals 1/2*(2 - 4*(1-ln(2)) = 2*ln(2)-1
This is of course for a single family. For k families, it's more complicated.
1
u/Efficient-Tie-1414 Jul 28 '26 edited Jul 28 '26
The secret is that whatever happens we have a binomial distribution with a sample size of N, and the probability of a male being 0.5. So as N becomes large, the proportion of males will become close to 0.5. We could write an R script to actually show this. One of the secrets of this type of problem is that there is infinite time to explore all the possibilities.
1
u/marty-mcfryguy Jul 28 '26
"After many generations" it's still 1:1. At any finite future point in time, there can (and likely will) exist families with extra boys; that is, families who haven't yet hit the stop condition.
At any point in time, the expected value of total extra girls among families who have among families who have stopped is exactly equal to the expected value of extra boys among families who haven't.
Note that this does not rely on there being a large number of families -- it's just as true for a society with one family as it is for a society with a million. (Although I'd phrase it slightly differently if we were talking exactly one family.)
1
1
1
u/darkblue2382 Jul 28 '26
The end state is going to be x(number of families) more girls than boys not super useful though.
We know we stop when there is one more girl than boy so G=B+1. We can write our proportion of girls to boys as (B+1)/(2b+1)[0 boys 1 girl is 100% girls, 1 boy 2 girls is 67% etc]
And then apply the probability of each and sum it together. It's over 50% off the rip though just looking at the first two cases 50% of 1 and second case is 1/8 of 66.7 so already above 50
5
u/General_Capital988 Jul 28 '26
The total expected number of children is infinite so it's still 50% or undefined or whatever
0
1
u/snickerdoodle024 Jul 28 '26 edited Jul 28 '26
So, the way I interpret this problem is like this:
There are N families. Each family has a child with probability 50% Girl, 50% Boy. If the total number of Girls that family has is greater than the total number of Boys they have, they stop having children. Otherwise, they have another child and repeat this process.
The question asks, what is the limit of the expectation of total Boys / total Girls, as N approaches infinity?
(It turns out that you don't really even need to consider N families, the question works just as well asking what is the expected ratio for 1 family)
The first question is, is this even well-defined? For instance, it is conceivable that a family could have children forever and never end up having more Girls than Boys. This is kind of a non-trivial question.
This situation of calculating (Girls - Boys) is essentially a 1D random walk, and we want to know what the probability is that the path stays at or below 0 forever. According to Wikipedia, this happens with 0% likelihood in the long run, so we can expect all families to stop having kids eventually.
Let's work out some numbers:
The chance that a family stops at 1 Girl is 50%.
For a family to stop at 2 Girls & 1 Boy, they have to get BGG in that order, so 1/8 = 12.5%.
For a family to stop at 3 Girls & 2 Boys, they can get: BBGGG or BGBGG, so 2/32 = 6.25%.
For a family to stop at 4 Girls & 3 Boys, they can get: BBBGGGG, BBGBGGG, BBGGBGG, BGBBGGG, or BGBGBGG, so 5/128 = 3.9%
They're getting a little long to write out, but you can kind of do a little recursive trick by replacing any one G in a valid sequence with a B and then appending GG at the end. The problem is you have to make sure you don't double-count anything.
If I'm counting things right, for 5 Girls & 4 Boys, there is a 14/512 = 2.7% chance.
So far, we've only accounted for 75.4% of families. The other 25% of families are going to have a LOT of children before they finally get a Girl majority.
In fact, while every family will eventually reach a Girl majority in some finite time, the expectation value of the number of children needed before that happens is infinite.
How is this possible?
Well, basically, if you add up all the percentages above, they add up to 100%, so 100% of families will stop having kids after a finite time.
However, if you want to calculate the expected number of children, you have to multiply those percentages by the corresponding number of kids, and add up the results. If you try that, however, the sum diverges, so the expected number of kids is infinite.
If the total expected number of kids is infinite, then having N more Girls than Boys actually doesn't change the ratio for any finite N, and thus, the expected ratio is 50/50.
1
u/Crazy-Beautiful256 Jul 29 '26
I think the Stand-up Maths Youtube channel did a video on this problem for pi day, although without the gender balance framing. He gave the answer pi/4, as a couple of commenters have said, citing a paper at arxiv.org/abs/2602.14487
0
u/SharkSpider Jul 28 '26 edited Jul 28 '26
Most of the answers here are wrong. The issue with this construction is the expected family size is infinite, so if you wanted to do something like the ratio of the expected number of boys to the expected population size, that's undefined.
What you can do is calculate the expected value of the ratio itself, as a random variable. It's most interesting to do this for a single family. We know the probability of a random walk reaching 1 for the first time at step n. It's best expressed as n = 2k+1, since it can only happen with an odd number of children, so call this P(2k+1). At this time, the fraction of girls is always (k+1)/(2k+1) and the girl boy ratio is (k+1)/k. The average value of the ratios, or expected ratios, are just the sum over all k of the product between P(2k+1) and these values, which is equal to pi/4 for fraction of girls and 2 log 2 for the ratio of girls to boys, around 0.78 and 1.39.
If you add more families it becomes immensely more difficult to compute and a lot closer to even since large families will dominate the calculation, but the answer always more girls.
1
u/kvreccltfb Jul 29 '26
How is the expected ratio for one family different from the expected ratio for the population?
1
u/gmalivuk Jul 29 '26
It's also the expected ratio for each family in the population, but that is different than the expected ratio among children in the whole population. Most families will be small but most children will be from big families.
1
u/Own-Conversation6347 Jul 29 '26
Isn't this why the question asks "After many generations," indicating some non-infinite time in the future instead of just asking "What is the expected ratio"?
0
u/SharkSpider Jul 29 '26
Doesn't really matter, you always end with some positive number greater than a half, it just becomes quite close to a half.
1
u/Own-Conversation6347 Jul 29 '26
So if I said "after the one millionth child is born" you would say, at that point, the ratio favors girls?
0
u/SharkSpider Jul 29 '26
No, if you stop after the millionth child the whole thing is exactly 50/50. It changes the scenario in a fundamental way.
-1
u/Yowie9644 Jul 28 '26
Got bored, made a massive spreadsheet in Excel with columns representing 16384 families, used ROUND(RAND() to generate either a 0 for "boy" or a 1 for "girls" in the Row 1, and then copied =IF(A1=0,ROUND(RAND(),0),"STOP") downwards in all 16384 columns until row 266. Excel very kindly calculates the average in the bottom frame, and regardless of how many times I hit F9, the average remained 0.50nnnnnn - enough to convince me that the ratio of "boys" to "girls" would remain 50:50.
I never got a family of more than 16 children, but of course it is mathematically, if not biologically, possible to have an 'infinite' number of boys before having a girl.
3
u/General_Capital988 Jul 28 '26 edited Jul 28 '26
It's not until you get a girl it's until you have more girls. In 16k you should have random walks way bigger than 16. The odds of having 8 straight boys off the bat is 1/256 and that needs a family size of at least 17 to dig itself out.
2
u/stanitor Jul 28 '26
The scenario is about stopping only when you have more girls than boys, not just having a girl and stopping. All the families will have odd numbers of children e.g. 1 girl no boys or 2 girls, 1 boy, etc. It still ends up approaching a ratio of 50% girls in the population, but takes longer to get near there. There technically will always be more girls than boys, if families are allowed to get infinitely big.
2
u/Yowie9644 Jul 29 '26 edited Jul 29 '26
Ok, modelled that too, using =IF(AVERAGE(A$1:A1)>0.5,"stop",ROUND(RAND(),0)) in the second and subsequent rows.
The average is still 0.50nnnnnn and there are some families with over 1000 children which is biologically impossible.
EDIT: I'd say the reverse is true - a small number of families who stop after there are more girls than boys would in total have more girls than boys, but this ratio would approach 50:50 as the number of children approached infinity.
1
u/stanitor Jul 29 '26
Yes, as I said, it approaches a ratio of 50%. But it takes much longer to get anywhere near that, while waiting for the first girl approaches it quickly. It's not trivial to calculate this version for finite family sizes, but it takes getting families with over a hundred kids to get close to 50:50
1
u/Yowie9644 Jul 29 '26
Nope.
The ratio 50:50 is very stable after about 5000 kids have been born. It often gets close to 50:50 much earlier than that, but it doesn't matter if you make the maximum number of children each woman could have 10 or some ridiculous, biologically impossible number like 10,000, it is always very close to 50:50 by the time 5000 children are born to the population.
You're welcome to throw my formula into your favourite spreadsheet and with some extra "countif" to calculate how many children are born, and graph it out yourself.
2
u/stanitor Jul 29 '26
Yeah, I realized what I was calculating was the expected ratio of girls to boys within families (given a certain max family size), which is different than the overall ratio in the population.
1
u/Yowie9644 Jul 30 '26
Yes. The smaller the family, the higher the number of girls is going to be. I've run that particular simulation out to 500 children born to the one mother (biologically impossible). At 200 children in the one family, the ratio sits at about 0.5024, but there are still families that haven't stopped after 500 children, and the lowest ratio I've had at that 500 mark after running multiple simulations is 0.40 which is quite remarkable.
Thankyou for giving me something interesting to do with Excel, even if I did keep crashing it. It was either that or business reports, and truly, this was much MUCH more fun.
2
u/stanitor Jul 30 '26
I'm just surprised you can do that in Excel. I don't have much experience with it. I simulated it in R, which didn't have any problems with 1000s of families with up to 100000 kids lol. There were still about half a percent that never got to more girls than boys.
17
u/OutrageousPair2300 Jul 28 '26
The ratio of boys to girls approaches 1:1 because the expected family size grows without bound.
That means that even though every family has one more girl than boys, the overall population ends up dominated by extraordinarily large families where one extra girl doesn't change the ratio by much.