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?
Suppose there were only two dragons, one with n heads, the other with 100- n. Then the "thinking power" would be n(100- n)= 100n- n^2. The maximum of that will come where 100- 2n= 0 or n= 50 and would be . If there were three dragons, with , and heads, the "thinking power" is . The maximum of that will come where and . Obviously, neither nor is acceptable so we must have and . From the first equation, . Putting that into the second equation, so that , and, of course, the third dragon has heads. The "thinking power" is now which is about 37037. Do you see the point? For a given number of dragons, the maximum "thinking power" occurs when all dragons have the same number of heads (try to show that algebraically). If there are n dragons, each having 100/n heads, then their "thinking power" is .
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.