Utilitarianism: Ethical theory to the effect that the right act - which it is good to do - is that act which one can do that will probably produce the greatest amount of pleasure or happiness (or some other kind of - supposed - good).
There are several formulations, and the original idea derives from Bentham and James and John Stuart Mill. It is thoroughly considered by Sidgwick. The original formulations of utilitarianism were formulated in terms of pleasure.
A classical objection to it is that even if the amount of (probable) pleasure (or happiness, or whatever else one thinks worth maximizing) that follows an act is precisely the same or indeed larger for a pig than for Socrates, few humans would prefer to maximize a pig's happiness at the cost of a human being's.
Later formulations of utilitarianism were in terms of happiness or indeed good, i.e. one should seek to maximize the sum of happiness or goodness in the world, and in these senses, as in the earlier senses, utilitarians should strive for the greatest happiness (or pleasure or good) of the greatest number.
All kinds of utilitarianism thus formulated are open to an objection I first read somewhere in a text by the mathematician Von Neumann: That it is unlikely such a double maximum can be achieved normally, apart from rare conditions - for which reason utilitarianism formulates an end that is hardly practicable, which invalidates it as an ethical theory or rule.
Furthermore, even if one believes that an idea like the greatest happiness (or pleasure or good) of the greatest number does give at least a useful clue to what might be good or bad to do, the problem remains that terms like 'happiness' and 'pleasure' are so vague, general, and dependent on personal circumstances, needs, tastes and education that they are hard to use consistently and in the same sense for different persons, or even for the same person at different times (say, when starving or when well fed).