The thinking power of a multi-headed dragon depends on how many heads it has. The thinking power of a group of dragons is the product of the number of heads on the individual dragons. A particular group has 100 heads available, how many dragons with what number of heads will maximise the thinking power of the group?
Here, n must be an integer but if we think of this as a continuous variable, we can take the derivative and set it equal to 0. Specifically, so and so . Setting that equal to 0 we must have either , which is impossible, or so that so that x= 100/e= 36.788[tex] which rounds to 37 dragons. Now, 37 does not divide 100 evenly- it is about 2.7 so we cannot have our "ideal" of all dragons with the same number of heads. I would suggest allocating the 100 heads to 37 dragons, giving some 2 heads, others 3 heads.
That is the as solving the pair of equations x+ y= 37, 2x+ 3y= 100 where x is the number of dragons with 2 heads, y the number with 3 heads.