Page 1 of 1

Complicated maths question

Posted: Thu Jan 12, 2023 9:00 pm
by Maia
Starting with one woman, who gives birth to twin daughters every year from the age of 25 to 50, and then dies, followed by exactly the same thing happening to all of her offspring, and all of their offspring, and so on, ad infinitum, how does one calculate the size of the female population in any given year (expressed, for simplicity, in years after the birth of the first woman)?

And in any given year, what proportion of the female population will be what age? I’m assuming that these proportions will remain constant, though I may be wrong.

Re: Complicated maths question

Posted: Thu Jan 12, 2023 11:49 pm
by Age
Maia wrote: Thu Jan 12, 2023 9:00 pm Starting with one woman, who gives birth to twin daughters every year from the age of 25 to 50, and then dies, followed by exactly the same thing happening to all of her offspring, and all of their offspring, and so on, ad infinitum, how does one calculate the size of the female population in any given year (expressed, for simplicity, in years after the birth of the first woman)?

And in any given year, what proportion of the female population will be what age? I’m assuming that these proportions will remain constant, though I may be wrong.
How one calculates the size of the female population in any given year is just through 'calculation', itself.

But maybe you might be seeking some 'formula', which one could use, that might provide a quick and easy way to work out the female population size, and their ages, in any given year.

Re: Complicated maths question

Posted: Thu Jan 12, 2023 11:55 pm
by Maia
Age wrote: Thu Jan 12, 2023 11:49 pm
Maia wrote: Thu Jan 12, 2023 9:00 pm Starting with one woman, who gives birth to twin daughters every year from the age of 25 to 50, and then dies, followed by exactly the same thing happening to all of her offspring, and all of their offspring, and so on, ad infinitum, how does one calculate the size of the female population in any given year (expressed, for simplicity, in years after the birth of the first woman)?

And in any given year, what proportion of the female population will be what age? I’m assuming that these proportions will remain constant, though I may be wrong.
How one calculates the size of the female population in any given year is just through 'calculation', itself.

But maybe you might be seeking some 'formula', which one could use, that might provide a quick and easy way to work out the female population size, and their ages, in any given year.
Yes, some sort of formula, if there is one.

Re: Complicated maths question

Posted: Fri Jan 13, 2023 1:13 am
by Impenitent
how many men? no new men on the horizon...

-Imp

Re: Complicated maths question

Posted: Fri Jan 13, 2023 2:59 am
by attofishpi
Maia wrote: Thu Jan 12, 2023 9:00 pm Starting with one woman, who gives birth to twin daughters every year from the age of 25 to 50, and then dies, followed by exactly the same thing happening to all of her offspring, and all of their offspring, and so on, ad infinitum, how does one calculate the size of the female population in any given year (expressed, for simplicity, in years after the birth of the first woman)?

And in any given year, what proportion of the female population will be what age? I’m assuming that these proportions will remain constant, though I may be wrong.
Here is a Python function that calculates the size of the female population in a given year:

def population_size(year):
if year < 0:
return 0
elif year == 0:
return 1
else:
return 2**(year-1) + population_size(year-1)

---
You can call the function and pass in the year you want to calculate the population size for. For example, to calculate the population size in year 10:

print(population_size(10))
---
This function uses recursion to calculate the population size. It starts with the base case of 0 population if the year is less than 0, and a population of 1 if the year is 0. For all other years, it calculates the population size as 2^(year-1) + the population size of the previous year. This is because in the first year, one woman gives birth to 2 daughters, in the second year those 2 daughters give birth to 2*2=4 daughters and so on.

Please note that the solution is not considering the age limit of the woman and assuming that the population size is double every year.

Re: Complicated maths question

Posted: Fri Jan 13, 2023 7:14 am
by Maia
attofishpi wrote: Fri Jan 13, 2023 2:59 am
Maia wrote: Thu Jan 12, 2023 9:00 pm Starting with one woman, who gives birth to twin daughters every year from the age of 25 to 50, and then dies, followed by exactly the same thing happening to all of her offspring, and all of their offspring, and so on, ad infinitum, how does one calculate the size of the female population in any given year (expressed, for simplicity, in years after the birth of the first woman)?

And in any given year, what proportion of the female population will be what age? I’m assuming that these proportions will remain constant, though I may be wrong.
Here is a Python function that calculates the size of the female population in a given year:

def population_size(year):
if year < 0:
return 0
elif year == 0:
return 1
else:
return 2**(year-1) + population_size(year-1)

---
You can call the function and pass in the year you want to calculate the population size for. For example, to calculate the population size in year 10:

print(population_size(10))
---
This function uses recursion to calculate the population size. It starts with the base case of 0 population if the year is less than 0, and a population of 1 if the year is 0. For all other years, it calculates the population size as 2^(year-1) + the population size of the previous year. This is because in the first year, one woman gives birth to 2 daughters, in the second year those 2 daughters give birth to 2*2=4 daughters and so on.

Please note that the solution is not considering the age limit of the woman and assuming that the population size is double every year.
Thanks. If you can write the above in normal English instructions, that would be a great help.

It seems incomplete though, and if the population simply doubled every year it would be an easy matter to calculate. This is not the case, however, since for the first 25 years, it remains static at one. Also, it needs to incorporate the age limit.