Welcome to Project Lovelace! We're still in early development so there are still tons of bugs to find and improvements to make.
If you have any suggestions, complaints, or comments please let us know on Discourse, Discord, or GitHub!
Bergmann's rule says that animals living in colder climates tend to be larger in size. Swedish scientists measured
the body mass of different moose populations in Sweden and found that the further north you go, the bigger the moose
get! Taking their data we can fit a line through it to predict the body mass of a moose at some latitude using the
equation
$$ \text{mass} = a \times \text{latitude} + b $$
where $a = 2.757$ and $b = 16.793$.
Submit some code with a function moose_body_mass(latitude) that returns the expected body mass of a moose
living at the input latitude using the equation from above.
Input:
Latitude
Output:
The expected body mass of a moose living at the input latitude.
Example
Input latitude: 60.5
Output body mass: 183.5915
Difficulty
Timesink
Function
moose_body_mass(latitude)
You must be logged in to view your submissions.
Notes
Bergmann's rule is a generalization and so it doesn't apply to every species. In fact many counter-examples to
Bergmann's rule exist but it seems to hold true in many cases (Meiri and Dayan, 2003).
The original explanation given by Bergmann (1847) for why animals are larger in colder climates is due to the need to
conserve heat. Since larger animals have a lower surface area to volume ratio, they lose less body heat per
unit mass helping to keep them warmer when it's cold. More recent studies don't support this hypothesis though
(Ashton et al., 2000).
This is the original article by Bergmann in German at over a 100 pages long! Google translates the title to English
as "About the relation of the heat economy of animals to their size".
Let us know what you think about this problem! Was it too hard? Difficult to understand? Also feel free to
discuss the problem, ask questions, and post cool stuff on Discourse. You should be able see a discussion
thread below. Would be nice if you don't post solutions in there but if you do then please organize and
document your code well so others can learn from it.