You will follow a forest that loses the same share of what is left each year, find the time it takes to halve, and find the yearly share from two counts.
The idea. After years the cover is . The time to halve is . If the cover goes from to in years, the share kept each year is .
Your tasks.
cover_after. It gives the cover after years, from a start c0 and a yearly share r (a fraction).halving_time. It gives the years for the forest to halve at the share r.yearly_share. It gives the share lost each year (a fraction) from a start, an end and a number of years.Run your code once to unlock the worked solution.
Have you tried it?
Do the tasks in the editor first, and run the checker after each one. Its hints help when a check fails. When you are ready, compare your code with this solution.
Log in to join the discussion.
Loading…