The theory of insurance