Complicated maths question

General chit-chat

Moderators: AMod, iMod

Post Reply
User avatar
Maia
Posts: 1815
Joined: Thu Aug 25, 2022 8:11 am
Location: UK

Complicated maths question

Post 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.
Age
Posts: 27841
Joined: Sun Aug 05, 2018 8:17 am

Re: Complicated maths question

Post 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.
User avatar
Maia
Posts: 1815
Joined: Thu Aug 25, 2022 8:11 am
Location: UK

Re: Complicated maths question

Post 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.
Impenitent
Posts: 5775
Joined: Wed Feb 10, 2010 2:04 pm

Re: Complicated maths question

Post by Impenitent »

how many men? no new men on the horizon...

-Imp
User avatar
attofishpi
Posts: 13319
Joined: Tue Aug 16, 2011 8:10 am
Location: Orion Spur
Contact:

Re: Complicated maths question

Post 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.
User avatar
Maia
Posts: 1815
Joined: Thu Aug 25, 2022 8:11 am
Location: UK

Re: Complicated maths question

Post 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.
Post Reply