The math is about the relative costs and benefits of altruistic behaviors. Altruistic behaviors must be a net benefit to an individual or group in terms of reproductive success, or else it would die out of a population. For a business analogy, the behavior needs to turn a profit.
In the case of kin selection in particular, the math is described by Hamilton's Rule, an inequality that must be satisfied in order for kin selection to explain a given altruistic interaction between individuals (http://en.wikipedia.org/wiki/W._D._Hamilton#Hamilton.27s_rul...).