Regarding the greatest good for the greatest number, there's a rather famous short story by Ursula LeGuin that I recommend reading. It's titled " The Ones Who Walk Away From Omelas" and I believe you can find a free copy online. It's an interesting take on the idea.
Is it a book? Do I not also remember that Spock said something to the same effect in that movie where he "died" in the vacuum chamber?