 with p(X3N, P3N | i) = p(X3N, P3N, i) / pi and pi = ∫Ri p(X3N, P3N) dX3N dP3N. This gives SG = ∑i pi(SGi −k ln pi). (N.B. p(X3N, P3N, i) = 0 outside of Ri and p(X3N, P3N, i) = p(X3N, P3N) inside of Ri.)