The bear population increases at a rate of 2% per year. There are 1573 bear this year. Write a function that models the bear population. How many bears will there be in 20 years?
Incorrect
p(x) = 1285
To model the bear population, we can use the exponential growth formula: P(t) = P0 * (1 + r)^t, where P(t) represents the population at time t, P0 is the initial population, r is the rate of growth expressed as a decimal, and t is the number of years.
In this case, the initial population P0 is given as 1573, and the growth rate r is 2% or 0.02. We need to find the population after 20 years, so t is 20.
Let's write a Python function to calculate the bear population:
```python
def bear_population(t):
P0 = 1573 # Initial population
r = 0.02 # Growth rate
population = P0 * (1 + r) ** t
return population
```
Now we can use this function to find the population after 20 years:
```python
population_after_20_years = bear_population(20)
print(population_after_20_years)
```
The output will be the estimated bear population after 20 years based on the given growth rate.
P(x) = 1573*(1.02)^x
where x is the number of years from now.
P(x) is the population in the xth year.