
\sum_{p_{A},p_{B},q_{A},r_{B}}\lambda\left(v\right)=\Pr\left[\mathbf{Q}_{C}=q_{C},\mathbf{R}_{C}=r_{C}\right].
\end{array}\label{eq:CbD exmaple}$$ The noncontextuality hypothesis for $\mathbf{P}_{A},\mathbf{Q}_{A},\mathbf{R}_{B}$ and $\mathbf{P}_{B},\mathbf{Q}_{C},\mathbf{R}_{C}$ is that among these jpds $\lambda$ we can find at least one for which $\Pr\left[\mathbf{P}_{A}\not=\mathbf{P}_{B}\right]=\Pr\left[\mathbf{Q}_{A}\not=\mathbf{Q}_{C}\right]=\Pr\left[\mathbf{R}_{B}\not=\mathbf{R}_{C}\right]=0,$ which is equivalent to $\Delta=\Pr\left[\mathbf{P}_{A}\not=\mathbf{P}_{B}\right]+\Pr\left[\mathbf{Q}_{A}\not=\mathbf{Q}_{C}\right]+\Pr\left[\mathbf{R}_{B}\not=\mathbf{R}_{C}\right]=0.$ Such a jpd need not exist, and then the smallest possible value $\Delta_{\min}$ of $\Delta$ for which a jpd of $\left(\mathbf{P}_{A},\mathbf{P}_{B},\mathbf{Q}_{A},\mathbf{Q}_{C},\mathbf{R}_{B},\mathbf{R}_{C}\right)$ exists can be taken as a measure of contextuality.[^3]

The CdB approach has its precursors in the literature: various aspects of the contextual indexation of random variables and probabilities of the kind shown are considered in Refs. [@larsson_kochen-specker_2002; @dzhafarov_qualified_2014; @Simon-Brukner-Zeilinger; @Winter2014; @svozil_how_2012; @dzhafarov_all-possible-couplings_2013; @Khr2005; @Khr2008; @Khr2009]. The principal difference, however, is in the use of minimization of $\Delta$ under the assumption that a jpd exists. This is a well-defined mathematical problem, solvable in principle for any set of distributions observed empirically. We will now compare and interrelate the two approaches, NP and CbD, by applying them to the Leggett-Garg and the EPR-Bell setups.

Leggett-Garg 
=============

Let us consider Leggett and Garg’s $\pm1$-valued random variables, $\mathbf{Q}_{1}$, $\mathbf{Q}_{2}$, and $\mathbf{Q}_{3}$ [@leggett_quantum_1985]. Applying the NP approach, we seek signed probabilities $\mu$ for $\left(\mathbf{Q}_{1},\mathbf{Q}_{2},\mathbf{Q}_{3}\right)$ that are consistent with the observed correlati