Must-Read: The market's social welfare function: take each individual's utility and sum them up. Only, first, take the inverse of their marginal utility of income, and weight their utility by that before summing.
The desires of those who have the least need for goods and services therefore get the greatest weight. The market thus has a very interesting "operationalization" of the principle of "the greatest good of the greatest number":
Welfare Economics and Existence of an Equilibrium for a Competitive Economy:
(1960):A competitive equilibrium is a maximum point of a social welfare function...
...which is a linear combination of the utility functions of consumers, with the weights in the combination in inverse proportion to the marginal utilities of income. Then the existence of an equilibrium is equivalent to the existence of a maximum point of this special social welfare function. Therefore, we can prove the former by showing the latter...