where m ( C n ) is the L 1 -distance from the vector p ∈ ∈ P to the surface of the box circumscribing the noncontextuality polytope. More generally, NCNT 2 and CNT 2 are computed by means of linear programming. The same is true for other CbD-based measures of contextuality. One of them, denoted CNT 3, uses the notion of a quasi-coupling, that differs from a coupling in that the probabilities in the joint distribution of its values are replaced with arbitrary reals (allowed to be negative but summing to 1). The class of quasi-couplings S maximizing the probabilities Pr [ S q c = S q c ′ ] is always nonempty, and the minimal total variation of the signed measure in this class is a natural measure of contextuality.