Someone visits a market where one hundred different types of fruit are sold. All types cost $1$ euro per pound. The utility the buyer receives from buying $m_1$ pounds of the first type of fruit he buys, $m_2$ pounds of the second type, etc. (all integer numbers) is $\prod\limits_{i=1}^n m_i$. Here $n$ is the number of different types of fruit he buys. The buyer has $100$ euros. Which fruits shouldhe buy with which quantities to maximise his utility?
I thought about maximizing $\sum\limits_{i=1}^n \ln m_i$ instead but I don't really know how to include the ordering of the utilities that the $m_i$'s result in. Could anyone please help?
You'd be right on track (except for a typo: $\sum \ln$ instead of $\ln \sum$) if we were looking for solutions in real numbers. By the integer constraint, an elementary approach seems fuitful (pun not intended).
First of all, if $n>100$ at least one $m_i$ is zero, hence the utility is zero, no matter what the buyer does. So we shall assume henceforth that $n\le 100$ and consider only solutions with $m_i\ge 1$ for all $i$. Since there are only finitely many possible buying strategies, the existence of a maximum is clear and we may simply look for a solution for which we cannot find an improvement.
Assume we have a solution where $\sum m_i<100$ (i.e. we do not spend all the money - in theory someting like this might indeed be optimal). Then picking any $i$ and replacing $m_i$ with $m_i+1$ still obeys the sum constraint, but increases the (positive!) utility by a factor of $\frac{m_i+1}{m_i}>1$. Hence - as one might have guessed - all optimal solutions spend all the oney, $\sum m_i=100$.
Assume we have solution where $m_i>m_j+1$ for some $i,j$. Then by replacing $m_i$ with $m_i-1$ and $m_j$ with $m_j+1$ we obtain another valid solution (the total fruit count does not change) and the (positive!) utility gets multiplied with $$\frac{m_i-1}{m_i}\cdot \frac{m_j+1}{m_j}=\frac{1-\frac1{m_i}}{1-\frac1{m_j+1}}>\frac{1-\frac1{m_i}}{1-\frac1{m_i}}=1.$$ Hence this situation does not occur for the optimal solution(s). We conclude that ther is an $m$ such that $m_i\in\{m,m+1\}$ for all $i$. More precisely, if there are exactly $k$ indices $i$ where $m_i=m+1$ then the utility is $$ (m+1)^km^{n-k}=m^n\cdot\left(1+\frac{1}{m}\right)^k$$ which is (for fixed $m$) strictly increasing with $k$, i.e. we want to maximize $k$. Then again, we have the constraint that $$100=(n-k)m+k(m+1) = nm+k $$ and of course $0\le k\le n$. A solution with $k=n$ is equivalent to the solution with $k=0$ and $m$ replaced with $m+1$, hence we may assume $0\le k<n$. Bu tthat brings us to division with remainder, which is unique: We must set $m=\lfloor \frac {100}n\rfloor$ and $k=100\mod n$.