For example, "unconscionable contracts" are unenforceable [1], custody disputes are resolved based on the "best interests of the child" test [2], and a cop's reasonable suspicion is judged by the "totality of the circumstances" [3].
All of these and many more require (some more explicitly than others) the judge to determine what is "fair" so that he or she can fairly apply law and precedent to a specific set of facts. This is much more common than you might think (and than many in the legal community would like to admit).
If you find this topic interesting, I would encourage you to read about the differences between deductive reasoning (like math) and inductive reasoning (like fairness). Some court decisions truly are deductive, but most are not.
[1] https://en.wikipedia.org/wiki/Unconscionability
[2] http://pediatrics.aappublications.org/content/134/Supplement...
[3] https://en.wikipedia.org/wiki/Totality_of_the_circumstances
a) All students applying to the school have the same chance to get a spot: 50%
b) The best 10 students (by some definition of 'best', e.g. grades or an entry exam) get in.
c) The 10 students with the richest parents get in.
d) The 10 students that live closest to the school get in.
We could go further: when 15 of the applicants are boys and 5 are girls (or vice versa), wouldn't it be more fair when 5 of each are chosen? How about racial distributions?
Ultimately how you define fairness is subjective. Obviously once you have defined fairness you can attempt to measure it using mathematics / statistics.
In all of optimization theory, the objective function is subjectively chosen.