{'fraction_non_alphanumeric': 0.048102405986385134, 'fraction_numerical': 0.012748783149434445, 'mean_word_length': 4.310642995124644, 'pattern_counts': {'":': 0, '<': 1, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Violations of locality and free choice are equivalent resources in Bell experiments

Bell inequalities rest on three fundamental assumptions: realism, locality, and free choice, which lead to nontrivial constraints on correlations in very simple experiments. If we retain realism, then violation of the inequalities implies that at least one of the remaining two assumptions must fail, which can have profound consequences for the causal explanation of the experiment. We investigate the extent to which a given assumption needs to be relaxed for the other to hold at all costs, based on the observation that a violation need not occur on every experimental trial, even when describing correlations violating Bell inequalities. How often this needs to be the case determines the degree of, respectively, locality or free choice in the observed experimental behavior. Despite their disparate character, we show that both assumptions are equally costly. Namely, the resources required to explain the experimental statistics (measured by the frequency of causal interventions of either sort) are exactly the same. Furthermore, we compute such defined measures of locality and free choice for any nonsignaling statistics in a Bell experiment with binary settings, showing that it is directly related to the amount of violation of the so-called Clauser-Horne-Shimony-Holt inequalities. This result is theory independent as it refers directly to the experimental statistics. Additionally, we show how the local fraction results for quantum-mechanical frameworks with infinite number of settings translate into analogous statements for the measure of free choice we introduce. Thus, concerning statistics, causal explanations resorting to either locality or free choice violations are fully interchangeable.

T he study of experimental correlations provides a window into the underlying causal mechanisms, even when their exact nature remains obscured. In his seminal works (1)(2)(3)(4)(5), John Bell showed that seemingly innocuous assumptions about the structure of causal relationships leave a mark on the observed statistics. The first assumption, called realism (or counterfactual definiteness), presents the worldview in which physical objects and their properties exist, whether they are observed or not. Note that realism allows a standard notion of causality (6,7), which in turn provides us with the language to express the remaining two assumptions. The locality assumption is a statement that physical (or causal) influences propagate in accord with the spatio-temporal structure of events (i.e., neither backward in time nor instantaneous causation). The free choice assumption asserts that the choice of measurement settings can be made independently from anything in the (causal) past. These three assumptions are enough to derive testable constraints on correlations called Bell inequalities.
Surprisingly, nature violates Bell inequalities (8)(9)(10)(11)(12)(13)(14)(15) which means that if the standard causal (or realist) picture is to be maintained at least one of the remaining two assumptions, that is locality or free choice, has to fail. It turns out that rejecting just one of those two assumptions is always enough to explain the observed correlations, while maintaining consistency with the causal structure imposed by the other. Either option poses a challenge to deep-rooted intuitions about reality, with a full range of viable positions open to serious philosophical dispute (16)(17)(18). Notably, quantum theory in its operational formulation does not provide any clue regarding the causal structure at work, leaving such questions to the domain of interpretation. It is therefore interesting to ask about the extent to which a given assumption needs to be relaxed, if we insist on upholding the other one (while always maintaining realism). In this paper, we seek to compare the cost of locality and free choice on an equal footing, without any preconceived conceptual biases. As a basis for comparison we choose to measure the weight of a given assumption in terms of the following question: How often a given assumption, i.e. locality or free choice, can be retained, while safeguarding the other assumption, in order to fully reproduce some given experimental statistics within a standard causal (or realist) approach? This question presumes that a Bell experiment is performed trial-by-trial and the observed statistics can be explained in the standard causal model (or hidden variable) framework (1)(2)(3)(4)(5)(6)(7)(19)(20)(21), which subsumes realism. It means that the remaining two assumptions of locality and free choice translate into conditional independence between certain variables in the model,

Significance Statement
Faced with a violation of Bell inequalities, a committed realist might pursue an explanation of the observed correlations on the basis of violations of the locality or free choice (sometimes called measurement independence) assumptions. The question of whether it is better to abandon (partially or completely) locality or free choice has been strongly debated since the inception of Bell inequalities, with ardent supporters on either side. We offer a comprehensive treatment that allows a comparison of both assumptions on an equal footing, demonstrating a deep interchangeability. This advances the foundational debate and provides quantitative answers regarding the weight of each assumption for causal (or realist) explanations of observed correlations. whose causal structure is determined by their spatio-temporal relations (6,22) (for some alternative approach endorsing indefinite causal structures see e.g. (23,24), or (25) for discussion of retrocausality). Modelling of the experiment implies that in each run of the experiment all variables (including unobserved or hidden ones) always take definite values and the statistics accumulates over many trials. This leaves open the possibility that the violation of the assumptions do not have to occur on each run of the experiment to explain the given statistics. We can thus put flesh on the bones of the above question and seek the maximal proportion of trials in which a given assumption can be retained, while safeguarding the other assumption, so as to fully reproduce some given statistics. In the following, we shall denote so defined measure of locality (safeguarding freedom of choice) as µ L and measure of free choice (safeguarding locality) as µ F . Also, without stating this in every instance, we note that in all subsequent discussion realism is assumed. * There has been some previous research on this theme. A measure of locality analogous to µ L was first proposed by Elitzur, Popescu and Rohrlich (27) to quantify non-locality in a singlet state. Note, it seems that the original idea of a bound for such a locality measure was expressed earlier, in (28), but a bound was not worked out. In any case, Elitzur, Popescu, and Rohrlich's measure was dubbed local fraction (or content) and shown (with improvements in (29)(30)(31)) to vanish in the limit of an infinite number of measurement settings. A substantial step was made in (32) where the local fraction is explicitly calculated for any pure two-qubit state for an arbitrary choice of settings. We note that those results concern measure µ L only for the specific case of quantum-mechanical predictions. In this paper we go beyond this framework and consider the case of general experimental statistics (see (33) for extension to the idea of contextuality). To avoid confusion, the term local fraction for measure µ L will be only used in relation to the quantum case. Furthermore, we propose a similar treatment of the free choice assumption quantified by measure µ F . Natural as it may seem, this approach has not been pursued in the literature, with some other measures proposed to this effect (34-42) (all retaining locality as a principle, but departing from the original notion of free choice introduced by Bell (6, 22)).
We aim to comprehensively consider the extent to which a given assumption, i.e. locality or free choice, can be preserved through partial violation of the other assumption. To accomplish this, we provide similar definitions and discuss on an equal footing both measures of locality µ L and free choice µ F . Then, we derive the following results. First, we prove a general structural theorem about causal models explaining any given experimental statistics in a Bell experiment (for any number of settings) showing that such defined measures are necessarily equal, µ L = µ F . This result consolidates those two disparate concepts demonstrating their deep interchangeability. Second, we explicitly compute both measures for any non-signalling statistics in a two-setting and two-outcome Bell scenario. This enables a direct interpretation to the amount of violation of the Clauser-Horne-Shimony-Holt (CHSH) inequalities (43). Third, we consider the special case of the quantum statistics with * As noted, realism is subsumed in the standard notion of causality, which is implicit in the definition of locality and free choice (1)(2)(3)(4)(5)(6). So, henceforth, referring to the standard causal framework implies the realist approach. We also remark that, although, "realism" goes under different guises in the literature (e.g. "counterfactual definiteness", '"local causality", "hidden causes", etc.), for our purposes those distinctions are irrelevant and the underlying mathematics remains the same, i.e. it boils down to the hidden variable framework (which beyond physics is frequently referred to as the structural causal models (7)). See (3,26) for some discussion. infinite number of settings, utilising existing results for the local fraction µ L , which thus translate on the newly developed concept of the measure of free choice µ F . Fig. 1 summarises the results in the paper.

Results
Bell experiment and Fine's theorem. Let us consider the usual Bell-type scenario with two parties, called Alice and Bob, playing the roles of agents conducting experiments on two separated systems (whose nature is irrelevant for the argument). We assume that on each side there are two possible outcomes labelled respectively a, b = ±1 and M possible measurement settings labelled respectively x, y ∈ M where M ≡ {1, 2 , . . . , M}. A Bell experiment consists of a series of trials in which Alice and Bob each choose a setting and make a measurement registering the outcome. After many repetitions, they compare their results described by the set of M × M distributions {P ab|xy } xy , where P ab|xy denotes the probability of obtaining outcomes a, b, given measurements x, y were made on Alice and Bob's side respectively. For conciseness, following the terminology in (5), we will call {P ab|xy } xy a "behaviour". Note that without assuming anything about the causal structure underlying the experiment any behaviour is admissible (as long as the distributions are normalised, i.e. ∑ a,b P ab|xy = 1 for each x, y ∈ M). In particular, quantum theory gives a prescription for calculating the experimental statistics P ab|xy for each choice of settings x, y ∈ M based on the formalism of Hilbert spaces. It is instructive to recall the special case of two measurement settings on each side x, y ∈ M = {0, 1} for which Bell derived his seminal result. Briefly, this can be expressed by saying that any local hidden variable model with free choice has to satisfy the following four CHSH inequalities (43) where S 1 = ab 00 + ab 01 + ab 10 − ab 11 , [2] S 2 = ab 00 + ab 01 − ab 10 + ab 11 , [3] S 3 = ab 00 − ab 01 + ab 10 + ab 11 , [4] S 4 = − ab 00 + ab 01 + ab 10 + ab 11 , [5] with ab xy = ∑ a,b ab P ab|xy being correlation coefficients for a given choice of settings x, y. Interestingly, by virtue of Fine's theorem (44,45), this is also a sufficient condition for a nonsignalling behaviour {P ab|xy } xy to be explained by a local hidden variable model with freedom of choice (for non-signalling see Eqs. (16) and (17)). It is crucial to observe that, although locality and freedom of choice are two disparate concepts with different ramifications for our understanding of the experiment, they are in a certain sense interchangeable. If locality is dropped with Alice and Bob freely choosing their settings, then the boxes, by influencing one another, can produce any behaviour {P ab|xy } xy . Similarly, a violation of the free choice assumption can be used to reproduce any behaviour {P ab|xy } xy , without giving up locality. It is straightforward to see how this might work if one of the two assumptions fails on every experimental trial. † However, such a complete renouncement of assumptions so central to our view of nature may seem excessive, especially when the CHSH inequalities are violated only by a little amount (less than the maximal algebraic bound of |S i | 4), leaving room for a possible explanation of the experimental statistics by rejecting one of the assumptions sometimes only.
Here we assess the cost of such a partial violation by asking how often a given assumption can be retained in order to account for a behaviour {P ab|xy } xy . We will investigate both cases in parallel: (♠) full freedom of choice with occasional nonlocality (communication), and (♣) the possibility of retaining full locality at a price of compromising freedom of choice (by controlling or rigging measurement settings) on some of the trials. We shall use the least frequency of violation, required to model some statistics with a hypothetical simulation, as a natural figure of merit, guided by the principle that the less the violation the better. Notably, such simulations should not restrict possible distributions of measurement settings P xy . In other words, we define a measure of locality µ L as the maximal fraction of trials in which Alice and Bob do not need to communicate trying to simulate a given behaviour {P ab|xy } xy , optimised over all conceivable strategies with freely chosen settings. [♠] Similarly, we define a measure of free choice µ F as the maximal fraction of trials in which Alice and Bob can grant free choice of settings in trying to simulate a given behaviour {P ab|xy } xy , optimised over all conceivable local strategies. [♣] In the quantum-mechanical context the measure µ L is called a local fraction (27)(28)(29)(30)(31)(32). By analogy, when considering the quantum-mechanical statistics the measure µ F might be called a free fraction. This provides an equal basis for comparing the two assumptions within the standard causal (or realist) approach, which we formalise in the following section.
Causal models, locality and free choice. The appropriate framework for the discussion of locality and free choice is † For the simulation of a given behaviour {P ab|xy }xy in a Bell experiment one may proceed as follows. Upon rejection of locality, in each trial the system on Alice's side, one may not only use input x but also y to generate outcomes (and similarly for the box on Bob's side) that comply with the appropriate distribution. On the other hand, when freedom of choice is abandoned, both settings x, y may be specified in advance on each trial and the boxes can be instructed to provide the outcomes needed to simulate the appropriate distribution. It is however unclear how this might work with occasional violation of the respective assumptions. provided by hidden variable models (1)(2)(3)(4)(5). First, a hidden variables model allows a formal statement of the realism assumption, understood to mean that properties of a physical system exist irrespective of an act of measurement (counterfactual definiteness). Second, hidden variable models provide the causal language in which the locality and free choice assumptions are expressed (6,7). The locality assumption conveys the requirement that the propagation of physical (or causal) influences have to follow the spatio-temporal structure of events (i.e., preserve the arrow of time and respect that actions at a distance require time). The free choice assumption concerns the choice of measurement settings which are deemed cusally unaffected by anything in the past (and thus it is sometimes called measurement independence). ‡ Both assumptions take the form of conditional independencies between certain variables in a hidden variables model.
To make this idea more concrete, let us consider a given set of probability distributions (behaviour) {P ab|xy } xy which describes the statistics in a Bell experiment. Without loss of generality, by conditioning on λ in some a priori unknown hidden variable space Λ, one can always write (4, 5, 7) P ab|xy = ∑ λ∈Λ P ab|xyλ · P λ|xy , [6] where P λ|xy and P ab|xyλ are valid (i.e. normalised) conditional probability distributions. The role of the hidden variable (cause in the past) λ ∈ Λ, distributed according to some P λ , is to provide an explanation of the observed experimental statistics. This means that at each run of the experiment the outcomes are described by the distribution P ab|xyλ with λ ∈ Λ fixed in a given trial, so that the accumulated experimental statistics P ab|xy obtains by sampling from some distribution P λ|xy over the whole hidden variable space Λ. It is customary to say that the choice of space Λ and probability distribution P λ along with conditional distributions P ab|xyλ and P λ|xy satisfying Eq. (6) specify a hidden variable (HV) model of a given behaviour {P ab|xy } xy .

[ ]
Note that such a model implicitly describes the distribution of settings chosen by Alice and Bob through the standard formula P xy = ∑ λ∈Λ P xy|λ · P λ . [7] So far the framework is general enough to accommodate any causal explanation of the statistics observed in the experiment. The assumptions of locality and free choice take the form of constraints on conditional distributions in ( ). For a local hidden variable (LHV) model, we require the following factorisation § P ab|xyλ = P a|xλ · P b|yλ , [8] for each x, y ∈ M and all λ ∈ Λ. The freedom of choice assumption consists of requiring that λ does not contain any information about variables x, y representing Alice and Bob's ‡ As noted, the free choice assumption is sometimes called measurement independence. Instead of on the agent, measurement independence is focussed on the measurement devices and possible correlations between their settings, which can affect the observed statistics. Regardless of interpretation, the mathematics remains the same, with the source of correlations traced to some common factor (in the causal past). § Locality can be seen as a conjunction of two conditions: parameter independence P a|xyλ = P a|xλ & P b|xyλ = P b|yλ , and outcome independence P a|bxyλ = P a|xyλ & P b|axyλ = P b|xyλ . One can show that such defined locality entails the factorisation condition P ab|xyλ = P a|xλ · P b|yλ (46).

Fig. 2. Causal model with some non-locality (communication).
In a Bell scenario, with free choice of settings, correlations between Alice and Bob's outcomes have two possible explanations: common cause in the past or causal influence between the parties. In any causal model the space of hidden variables (representing common causes) splits into two disjoint parts Λ = Λ L ∪ Λ NL distinguished by whether, for a given λ ∈ Λ , causal influence occurs or not, Eq. (10). Then, locality is measured by the proportion of events when locality is maintained, which is equal to the probability choice of measurement settings. This boils down to the independence condition (6,22) P λ|xy = P λ (or equivalently P xy|λ = P xy ) , [9] holding for x, y ∈ M and all λ ∈ Λ. In the following, we will abbreviate a hidden variable model with freedom of choice as FHV model. The crucial point is the distinction between local vs non-local as well as free vs non-free situations in the individual runs of the experiment modelled by Eq. (6). This means that each condition Eq. (8) and Eq. (9) should be considered separately for each λ ∈ Λ, i.e. whenever the respective condition does not hold for a given λ the assumption fails on the corresponding experimental trials. Such a distinction leads to a natural splitting of the underlying HV space into two unique partitions Λ = Λ L ∪ Λ NL and Λ = Λ F ∪ Λ NF . The first one divides Λ by the locality property while the second one divides Λ by the free choice property Figs. 2 and 3 illustrate the causal structures for two extreme cases: FHV and LHV models (in general built on different HV spaces Λ and Λ ). The first one grants full freedom of choice (Λ = Λ F ) while allowing for partial violation of locality (Λ ⊃ Λ L ). The second one retains full locality (Λ = Λ L ) while admitting some violation of free choice (Λ ⊃ Λ F ).
Thus, for a given experimental trial (with λ ∈ Λ fixed) the constraints in Eqs. (10) and (11) indicate, respectively, whether some non-local influence between the parties takes In a Bell scenario, with locality assumption, correlations between the outcomes on Alice and Bob's side can be explained by a common cause affecting choice or not (the latter implies freedom of choice). In any causal model the space of hidden variables (representing common causes) splits into two disjoint parts Λ = Λ F ∪ Λ NF distinguished by whether, for a given λ ∈ Λ , the choice is free or not, Eqs. (11). Then, the parties enjoy freedom of choice only on the trials when λ ∈ Λ F , which happens with a frequency equal to the probability accumulated over subset place (λ ∈ Λ NL ) and whether some influence from the past on the measurement settings occurs (λ ∈ Λ NF ). In other words, in a hypothetical simulation scenario these possibilities correspond to, respectively, communication or rigging measurement settings. How often this has to happen depends on the distribution P λ . This picture lends itself to quantifying the degree of locality and freedom choice in a given HV model.

Remark 1.
For a given HV model ( ) locality is measured by Prob (λ ∈ Λ L ) ≡ ∑ λ∈Λ L P λ , and similarly freedom of choice is measured by This remark captures the intuition of measuring locality and freedom of choice by considering the proportion of trials when the respective property is maintained across the whole experimental ensemble. We note that this quantity is modeldependent, since it is a property of a particular HV model adopted to explain some given experimental statistics {P ab|xy } xy (including the distribution of measurement settings P xy , cf. Eq. (7)). The concepts just introduced allow a precise expression for the informal definitions (♠) and (♣) given above. Definition 1. For a given behaviour {P ab|xy } xy the measure of locality µ L and freedom of choice µ F are defined as where the maxima are taken respectively over all hidden variable models with freedom of choice (FHV) or all local hidden variable models (LHV) simulating given behaviour {P ab|xy } xy , with a fixed distribution of settings P xy , minimized over any choice of the latter.
This definition follows the intuition of, respectively, locality or free choice as properties that can be relaxed only to the extent that is required to maintain the other assumption in every experimental situation (i.e., for any distribution of measurement settings P xy ). Formally, the measures µ L and µ F count the maximal frequency of, respectively, local or free choice events optimised over all protocols simulating {P ab|xy } xy without violating of the other assumption, cf. Remark 1. The minimum over all P xy amounts to the worst case scenario, which takes into account the possibility that P xy is a priori unspecified (i.e., this amount of freedom is enough to simulate an experiment with any arbitrary choice of distribution P xy in compliance with Eq. (7)).
At first glance, even if conceptually appropriate, such a definition might seem too general to provide a manageable notion, due to the range of experimental scenarios that need to be taken into account (i.e. arbitrariness of P xy ). However, the situation considerably simplifies because of the following lemma (see Methods section for further discussion and proof). This lemma also provides additional support for Definition 1.
Lemma 1. In both Eqs. (12) and (13) in Definition 1 the first minimum can be omitted, i.e. we have where the respective maxima are taken for some fixed nontrivial distribution P xy (i.e., the expression is insensitive to this choice provided all settings are probed, P xy = 0 for all x, y).
It is in this way that the present measure of locality µ L extends the notion of local fraction (27)(28)(29)(30)(31)(32) to arbitrary experimental behaviour {P ab|xy } xy . Remarkably, the twin concept, which is the measure of free choice µ F has not been considered at all. Perhaps the reason for this omission is the issue of arbitrariness of the distribution P xy , for which there are non-trivial constraints when freedom of choice is violated (note that for the measure µ L this problem does not occur). Those concerns can be dismissed only after the proper treatment in Lemma 1. This allows a so defined measure of freedom µ F on a par with the more familiar measure of locality µ L .
So far the concepts of violation of locality and freedom of choice, and the corresponding measures µ L and µ F , have been kept separate. This is expected given their disparate character. First, each concept plays a different role in the description of an experiment and hence offers a different explanation for any observed correlations, this is, direct influence (communication during the experiment) vs measurement dependence (employing common past for rigging measurement settings). Second, on the level of causal modelling those assumptions are expressed differently, Eq. (8) vs Eq. (9). Third, violating free choice gives rise to subtle issues regarding constraints on the distribution of settings P xy (as noted, these concerns are addressed in Lemma 1).
Having brought all those issues to the spotlight, it is surprising that the assumption of locality and free choice are intrinsically connected. We now present the key result in this paper showing the exchangeability of both concepts, while maintaining the same degree of locality and freedom of choice so defined. It holds for any number of settings x, y ∈ M = {0, 1, ... , M} (see Methods for the proof).
This is a general structural theorem about causal modelling of a given behaviour {P ab|xy } xy . It means that the resources measured by the frequency of causal interventions of either sort, required to explain an experimental statistics, are equally costly. Thus, as far as the statistics is concerned, causal explanations resorting either to violation of locality or free choice (or measurement dependence) should be kept on an equal footing. Preference should be guided by a better understanding of a particular situation (design of the experiment as well as ontological commitments in its description).
Let us emphasise two features of Theorem 1. First, this is a theory-independent result in the sense that it applies directly to experimental statistics irrespective of the design or theoretical framework behind the experiment (with the quantum predictions being just one example). Second, the connection between those two seemingly disparate quantities µ L and µ F has a practical advantage: knowledge of one suffices to compute the other. Both features are illustrated by the following results.
Non-signalling behaviour with binary settings. Consider the case of Bell's experiment with only two measurement settings on each side x, y ∈ M = {0, 1}. Let us recall that non-signalling of some given behaviour {P ab|xy } xy means that Alice cannot infer Bob's measurement setting (whether it is y = 0 or 1) from the statistics on her side alone, i.e.
and similarly on Bob's side (whether Alice chooses x = 0 or 1), i.e. P b|0y = ∑ a P ab|0y = ∑ a P ab|1y = P b|1y for all b, y . [17] Now we can state another result which explicitly computes both measures µ L and µ F in a surprisingly simple form (see Methods for the proof).
Theorem 2. For a given non-signalling behaviour {P ab|xy } xy with binary settings x, y ∈ M = {0, 1} both measures of locality µ L and free choice µ F from Definition 1 are equal to where S max = max {|S i | : i = 1, ... , 4} is the maximum absolute value of the four CHSH expressions in Eqs. (2)-(5).
We thus obtain a systematic method for assessing the degree of locality and free choice directly from the observed statistics {P ab|xy } xy without reference to the specifics of the experiment (the only requirement is non-signalling of the observed distributions). In this sense, this is a general theory-independent statement.
Overall, Theorem 2 allows an interpretation of the amount of violation of the CHSH inequalities in Bell-type experiments as a fraction of trials violating locality (granted freedom of choice) or equivalently trials without freedom of choice (given locality).
The quantum case: Binary settings and beyond. Let us restrict our attention to the special case of the quantum statistics. Notably, various aspects of non-locality have been extensively researched in relation to the quantum-mechanical predictions, see (4, 5) for a review. This includes the notion of local fraction (27)(28)(29)(30)(31)(32), which is the same as measure µ L here defined for a general behaviour {P ab|xy } xy . As noted, it may be thus surprising that the equally natural measure of freedom µ F has not been explored. Theorem 1 bridges the gap between those two seemingly disparate notions: there is no actual need for separate study. We next review some crucial results for the local fraction in the quantum-mechanical framework, which allows us to make similar statements for the measure of freedom µ F .
We first observe that Theorem 2 can be readily applied to the quantum-mechanical statistics (where non-signalling holds). In a Bell experiment, quantum probabilities obtain through the standard formula P ab|xy = Tr [ ρ P a x ⊗ P b y ] where ρ is a (bipartite) mixed state with two PVMs {P a=±1  Apparently, for less entangled states the amount of freedom increases, reaching the maximal value µ F = 1 for separable states. This is a consequence of the result in (32), which explicitly computes the local fraction µ L for all pure two-qubit states. Stated for measure µ F this takes the following form.
Theorem 4. For a pure two-qubit state, which by appropriate choice of the basis can always be written in the form |ψ = cos θ 2 |00 + sin θ 2 |11 with θ ∈ [0, π 2 ], the amount of freedom is equal µ F = cos θ, whatever the choice and number of settings on Alice and Bob's side.
Note that both Theorem 3 and Theorem 4 assume a specific form of behaviour {P ab|xy } xy as obtained by the rules of quantum theory. The theorems should be contrasted with Theorem 2 which is a theory-independent statement, not limited to a particular theoretical framework.

Discussion
The ingenuity of Bell's theorem lies in the fundamental nature of the premises from which the result is derived. Within the standard causal (or realist) approach, it is hard to assume less about two agents than having free choice and their systems being localised in space. Yet in some experiments nature refutes the possibility that both assumptions are concurrently true (8)(9)(10)(11)(12)(13)(14)(15). It is not easy to reject either one of them without carefully rethinking the role of observers and how cause-and-effect manifests in the world. ¶ Our objective in this paper is this: instead of pondering the question of how this could be possible, we ask about the extent to which a given assumption has to be relaxed in order to maintain the other. Expressed more colloquially, it is natural for a realist to ask what is the cost of trading one concept for the other: Is it possible to save free choice by giving up on some locality? Or, maybe is it better to forego a modicum of free choice in exchange for locality? These questions can be compared on equal footing by computing a proportion of trials across the whole experimental ensemble in which a given assumption must fail, when the other holds at all times. Surprisingly, the answer can be obtained by looking at the observed statistics alone (avoiding the specifics of the experimental setup). The first question was formulated in the quantum-mechanical context by Elitzur, Popescu and Rohrlich (27) who introduced the notion of local fraction further elaborated in (29-32) (see (28) for an early indication of these ideas). Here, we generalise this notion to arbitrary experimental statistics (see also (33)). Furthermore, we answer the second question by adopting a similar approach to measuring the amount of free choice (which by analogy may be called free fraction). The first main result, Theorem 1, compares such defined measures in the general case (arbitrary statistics with any number of settings), showing that both assumptions are equally costly. This demonstrates a deeper symmetry between locality and free choice, which may come as a surprise, given our intuition of a profound difference in the role these concepts play in the description of an experiment.
In this paper, the notions of locality and free choice are understood in the usual sense required to derive Bell's theorem (6,22). They are expressed in the standard causal model framework (which subsumes realism) as unambiguous yes-no criteria for each experimental trial (i.e. when all past variables are fixed), determining whether there is a causal link between certain variables in a model (without pondering its exact nature). The measures µ L and µ F count the fraction of trials when such a connection needs to be established, breaking locality or free choice respectively, in order to explain the observed statistics. This problem is prior to a discussion of how this actually occurs, which is particularly relevant when the exact nature of the phenomenon under study is obscured. Theorem 1 shows no intrinsic reason for a realist to favour one assumption vs the other. The minimal frequency of the required causal influences of either sort, measured by µ L and µ F , is exactly the ¶ We note that the conventional understanding of causality and the language of counterfactuals has recently gained a solid mathematical basis; see e.g. the work of J. Pearl (7). However, in view of the apparent difficulties with embedding quantum mechanics in that framework, the standard approach to causality based on Reichenbach's principle or claims regarding spatio-temporal structure of events might need reassessment; see e.g. indefinite causal structures (23,24) or retrocausality (25). same. Notably, this is a general result which holds for any behaviour {P ab|xy } xy . What remains is explicit calculation of those measures for a given experimental statistics.
The second main result, Theorem 2, evaluates both measures µ L and µ F for any non-signalling behaviour in a Bell experiment with two outcomes and two settings. It provides a direct interpretation to the amount of violation of the CHSH inequalities (43). The key motivation behind this result is that the degree by which the inequalities are violated has not been given tangible interpretation so far, beyond its use as a binary test of whether the inequalities are obeyed or not in study of Bell non-locality. Furthermore, Theorem 2 has the advantage of being theory-independent in the sense of being applicable to the experimental statistics regardless of its theoretical origin (i.e., beyond the quantum-mechanical framework). This makes it suitable for quantitative assessment of the degree of locality and free choice across different experimental situations, with prospective applications beyond physics, e.g. in neuroscience, cognitive psychology, social sciences or finance (48)(49)(50)(51)(52).
We also state two results, Theorem 3 and Theorem 4, for the measure of free choice µ F in the case of the quantum statistics generated by the pure two-qubit states. Both are direct translation, via Theorem 1, of the corresponding results for the local fraction µ L (27)(28)(29)(30)(31)(32).
It is worth noting a related idea of quantifying non-locality through the amount of information transmitted between the parties that is required to reproduce quantum correlations (under free choice assumption). Together with the development of the specific models (53)(54)(55)(56)(57), this has led to various results regarding communication complexity in the quantum realm (58). However, in this paper we take a different perspective on measuring non-locality by changing the question from "how much" to "how often" communication needs to be established between the parties to simulate given correlations. Theorem 2 gives the exact bound in the case of non-signalling statistics in the two-setting and two-outcome Bell experiment. In the quantum case, such a simulation requires communication in at least 41 % of trials (because of Tsirelson's bound (47)) and for maximally entangled states increases to 100 % of trials when the number of settings is arbitrary (cf . Theorems 3 and 4).
Natural as it may seem, the idea of measuring freedom of choice by measure µ F has not been developed in the literature. The reason for this omission can be traced to the conceptual and technical issues with handling arbitrariness of the distribution of settings P xy . Those concerns are properly addressed in the present paper with Lemma 1, which considerably simplifies and supports Definition 1. We note that various measures have been developed as a means of quantifying freedom of choice (or measurement independence, as it is sometimes called). They include maximal distance between distributions (35, 37), mutual information (38,42) or measurement dependent locality (39)(40)(41). Furthermore, some explicit models simulating correlations in a singlet state with various degrees of measurement dependence have been proposed (34,36) and analysed (e.g. see (42) for comparison of causal vs retrocausal models). However, these attempts depart from the original understanding of the free choice as introduced by Bell (6, 22) (strict independence of choice from anything in the past) in favour of more sophisticated information-theoretic accounts. Notably, the proposed measure of free choice builds on the Bell's original framework assessing the maximal frequency with which such a freedom can be retained in a model strictly consistent with locality. It thus benefits from a direct interpretation within the established causal framework of Bell inequalities and has a clear-cut operational meaning.
Regarding Theorem 3, which rules out any freedom of choice so defined, it is interesting to take an adversarial perspective on the problem of free choice in relation to quantum cryptography and device independent certification (59,60). In this narrative an eavesdropper controls the devices trying to simulate the quantum statistics of a Bell test, which is impossible as long as the parties enjoy freedom of choice. However, any breach of the latter, i.e. control of measurement settings, shifts the balance in favour of the eavesdropper in her malicious task. Taking the view that any causal influence comes with a cost or danger of being uncovered there are two diverging strategies that reduce the cost/risk to be considered: (a) resort to the use of control of choice as seldom as possible during the experiment, or (b) minimise the intensity of each act of control. Theorem 3 completely rules out the first possibility when simulating quantum statistics, i.e., the eavesdropper needs to manipulate both settings on each trial in order to simulate the quantum statistics. The question about the intensity of the control is left open in our discussion, but amenable to information-theoretic methods (35)(36)(37)(38)(39)(40)(41)(42). This gives additional security criteria for quantum cryptography and device independent certification by forcing the eavesdropper to a more challenging sort of attack (not only can she not miss a trial, but the control has to be subtle enough).
We remark that the main Theorem 1 readily extends to the case of larger number of parties and outcomes {P abc...|xyz... } xyz... . This should be also possible for Theorem 2 when characterisation of the local polytope is known, cf. (61)(62)(63)(64)(65)(66)(67). Yet another valuable avenue for research in that case consists of completing the analysis to include signalling scenarios (68,69). As for the quantum case, we considered the simplest Bell-type scenario with two parties involved in the experiment, but extensions may prove even more surprising (see (5) for a technical review of the vast field of Bell non-locality). In particular, in threeparty scenarios the methods discussed presently can be used to eliminate freedom of choice already for two settings per party sharing the GHZ state (cf. Mermin inequalities which saturate in that case (70)). We should also mention an intriguing result (71) for a triangle quantum network in which non-locality can be proved with all measurements fixed. Remarkably, there is nothing to choose in that setup, but there is another assumption of preparation independence which plays a crucial role in the argument.
In this paper we are trying to remain impartial as to which assumptionlocality or free choice -is more important on the fundamental level. This is certainly a strongly debated subject in general, both among physicists and philosophers, with strong supporters on each side (16)(17)(18). As just one example depreciating the role of freedom of choice let us quote Albert Einstein || : "Human beings, in their thinking, feeling and acting are not free agents but are as causally bound as the stars in their motion." As a counterbalance, it is hard to resist the objection that was eloquently stated by Nicolas Gisin (72): "But for me, the situation is very clear: not only does free will exist, but it is a prerequisite for science, philosophy, and our very ability to think rationally in a meaningful way." Without entering into this || Statement to the Spinoza Society of America. September 22, 1932. AEA 33-291. debate, we remark that both assumptions are interchangeable on a deeper level. Namely, for a given experimental statistics {P ab|xy } xy in a Bell-type experiment the measure of locality µ L and measure of free choice µ F are exactly the same. This makes an even stronger case regarding the inherent impossibility of inferring causal structure from experimental statistics alone.

Materials and Methods
In order to facilitate the following discussion we begin with two technical lemmas. See SI Appendix for the proofs.
The first one holds for a Bell experiment with arbitrary number of settings x, y ∈ M = {1, 2, 3, ... , M}.  We are now ready to proceed with the proofs.
Proof of Lemma 1. Suppose we have a HV model ( ) of some behaviour {P ab|xy } xy for some nontrivial distribution of settings P xy . The latter obtains via Eq. (7) from the conditional probabilities P xy|λ which are related to probabilities specified by the model, P λ|xy and P λ , by the usual Bayes' rule. The point at issue is whether a given HV model can simulate any other distribution of settingsP xy via Eq. (7) by changing P xy|λ P xy|λ , while keeping the remaining components of the HV model ( ) intact. This requires consistency with Bayes' rule, i.e. P xy|λ = P λ|xy ·Pxy P λ , [20] which should be a well-defined probability distribution for each λ. Since distributions P λ|xy and P λ are fixed by the HV model ( ), then the distribution of settingsP xy is arbitrary as long as the expression in Eq. (20) is less then 1 for each λ ∈ Λ (normalisation is trivially fulfilled). Now, whenever freedom of choice from Eq. (9) holds, this condition is always satisfied, and hence such a HV model can be trivially adjusted for any distributionP xy (by redefiningP xy|λ :=P xy in compliance with Eq. (20), and keeping all the remaining components of the HV model ( ) unchanged). Of course, for FHV models in the definition of µ L in Eq. (12) this is the case, which thus entails the simpler expression for µ L in Eq. (14). Clearly, such a simple argument falls apart for models without freedom of choice, like those in the definition of µ F in Eq. (13), when P λ|xy and P λ do not cancel out and the probability in Eq. (20) may be ill-defined. In that case, some deeper intervention into the model is required as shown below.
Let us take some LHV model ( ) simulating a given behaviour {P ab|xy } xy with nontrivial distribution of settings P xy . Then the related HV space decomposes as Λ = Λ F Λ NF and the degree of freedom is measured by p F := ∑ λ∈Λ F P λ , cf. Remark 1. Now, consider a restriction of the model to the respective subspaces Λ F and Λ NF which amounts to the following rescaling P F λ := 1 p F P λ , P F λ|xy := 1 p F P λ|xy , P F ab|xyλ := P ab|xyλ , [21] for λ ∈ Λ F , and similarly P NF λ := 1 1−p F P λ , P NF λ|xy := 1 1−p F P λ|xy , P NF ab|xyλ := P ab|xyλ , [22] for λ ∈ Λ NF . Both are LHV models with marginals P F ab|xy = ∑ λ∈Λ F P F ab|xyλ · P F λ|xy , [23] P NF ab|xy = ∑ λ∈Λ NF P NF ab|xyλ · P NF λ|xy , [24] which provide a convex decomposition of the original behaviour {P ab|xy } xy , i.e. P ab|xy = p F · P F ab|xy + (1 − p F ) · P NF ab|xy . [25] The crucial point is a careful adjustment of these two models to recover some arbitrary distribution of settingsP xy , while maintaining the respective marginals Eqs. (23) and (24). For the first one (restriction to Λ F ) the situation is trivial as explained above: since it is a FHV model, then it suffice to redefineP F xy|λ :=P xy (in compliance with Eq. (20)) and leave all rest intact. As for the second one (restriction to Λ NF ), we can use Lemma 2 for constructing another HV spaceΛ NF with a LHV model without any free choice, that simulates behaviour {P NF ab|xy } xy with the required distribution of settingsP xy . Then, such modified models can be stitched back together on the compound HV spaceΛ := Λ F Λ NF with respective weights p F and 1 − p F . This guarantees reconstruction of the original behaviour {P ab|xy } xy (see Eq. (25)) with the new distribution of settingsP xy . The model is local and has the same degree of freedom equal to p F (the first component has full freedom of choice, while in the second one it is entirely missing).
The above construction shows that for every LHV model of some behaviour {P ab|xy } xy there is always another one adjusted for any other distribution of settingsP xy with the same degree of freedom. This justifies the simpler expression for µ F in Eq. (15) and hence concludes the proof of Lemma 1.
Proof of Theorem 1. Note that Lemma 1 Eqs. (14) and (15) can be taken as a definition of measures µ L and µ F . This is very convenient, since it allows a discussion free from any concerns about the distribution of settings P xy (this is particularly relevant in the case of µ F as explained above).
It is instructive to observe that the calculation of both measures µ L and µ F can be succinctly formulated as a convex optimisation problem. Suppose, we can decompose some given behaviour {P ab|xy } xy as a mixture P ab|xy = p L · P L ab|xy + (1 − p L ) · P NL ab|xy , [26] where {P L ab|xy } xy is a local behaviour with full freedom of choice (i.e., has a LHV+FHV model), and {P NL ab|xy } xy is a free behaviour (i.e., has a FHV model). And similarly, suppose that P ab|xy = p F · P F ab|xy + (1 − p F ) · P NF ab|xy [27] where {P F ab|xy } xy is a local behaviour with full freedom of choice (i.e., has a LHV+FHV model), and {P NF ab|xy } xy is a local behaviour (i.e., has a LHV model). In both cases we assume that 0 p L , p F 1, and both Eq. (26) and Eq. (27) have to hold for all a, b = ±1 and x, y ∈ M. Then, we have Remark 2. Measures µ L and µ F evaluate the maxima over all possible decompositions in Eqs. (26) and (27) of behaviour {P ab|xy } xy , i.e. µ L = max decomp. (26) p L , [28] µ F = max decomp. (27) p F . [29] Proof. We will justify only Eq. (28), since the argument for Eq. (29) is analogous. Let us observe that every HV model ( ) of behaviour {P ab|xy } xy as described by Eq. (6) splits into two components (cf. Eq. (10)) P ab|xy = ∑ λ∈Λ L P ab|xyλ · P λ p L · P L ab|xy + ∑ λ∈Λ NL P ab|xyλ · P λ|xy (1−p L ) · P NL ab|xy , [30] which defines decomposition of the type in Eq. (26) with p L := ∑ λ∈Λ L P λ . Therefore, by Eq. (14), we get µ L max decomp. (26) p L .
To see the reverse, we note that every decomposition of the type in Eq. (26) implies existence of a LHV+FHV model of behaviour {P L ab|xy } xy on some HV spaceΛ L and a FHV model of behaviour {P NL ab|xy } xy on some HV spaceΛ NL . Those two models, when combined on a compound HV space Λ :=Λ L Λ NL with the respective weights p L and 1 − p L , provide a HV model of behaviour {P ab|xy } xy . Since the local domain of such a model containsΛ L , then from Eq. (14) we have µ L p L , which entails µ L max decomp. (26) p L . This concludes the proof of Eq. (28). Now, in order to prove Theorem 1 it is enough to show that for every decomposition of the type in Eq. (26)  Consider some arbitrary decomposition Eq. (26) of behaviour {P ab|xy } xy . Then, by linearity, the four CHSH expressions Eqs. (2)-(5) decompose as well, i.e. we get where S L i and S NL i are calculated for the respective behaviours {P L ab|xy } xy and {P NL ab|xy } xy . Since the first one is a local behaviour with full freedom of choice (i.e. having a LHV+FHV model), then from the CHSH inequalities Eq. (1) we have |S L i | 2. For the second one there is nothing interesting to be said other than noting the maximal algebraic bound |S NL i | 4. As a consequence, the following inequality obtains and we get p L 1 2 (4 − |S i |). Thus, by assumed arbitrariness of decomposition, Eq. (26) gives the upper bound on expression in Eq. (28) µ L 1 2 (4 − |S i |) , [33] where S max = max {|S i | : i = 1, ... , 4}. By Lemma 3 we conclude that the bound is tight, which ends the proof of Theorem 2.

Supporting Information Text
In this Supplement we prove two technical results Lemma 2 and Lemma 3 from the Methods section in the main manuscript. We also give an alternative self-standing proof of Theorem 3.
[The numbering of equations follows the main text.]

PROOF OF LEMMA 2
For reference we quote Lemma 2 from the main manuscript that we will shortly prove. Here, the choice of settings is arbitrary x, y ∈ M = {1, 2 , . . . , M}.
Lemma 2. For any behaviour {P ab|xy } xy and distribution of settings P xy there exists a local hidden variable model (LHV) which fully violates the freedom of choice assumption (i.e., ifΛ is the relevant HV space, then we haveΛ =Λ L =Λ NF ; cf. Eqs. (10) and (11)).

PROOF OF LEMMA 3
In the following we consider a Bell experiment with binary settings x, y ∈ M = {0 , 1}.
Proof. This is a direct consequence of a simple algebraic inequality involving the four expressions S 1 , ... , S 4 which follow the pattern of Eqs. (2)-(5), i.e., It is straightforward to check that for −1 a, b, c, d 1, whenever i = j we have ± S i ± S j 4 and ± S i ∓ S j 4 (since in each case four out of eight terms cancel out). Clearly, in compact form this is equivalent to the inequality |S i | + |S j | 4 which concludes the proof.
As an immediate consequence of Remark 3, note that for any behaviour {P ab|xy } xy at most one out of four CHSH inequalities in Eq. (1) can be violated at the same time.
Without loss of generality, in the following proof we consider a given behaviour {P ab|xy } xy with binary choice of settings x, y ∈ M = {0, 1} for which only the first CHSH inequality is violated, i.e., we assume that S max = S 1 > 2 , [48] Fig. S1. Decomposition in Lemma 3. A two-dimensional section of the nonsignalling polytope for the two-setting and two-outcome Bell scenario. It is spanned by sets of local deterministic behavioursP (j) and non-local PR-boxesP (k) . The subset of local behaviours (depicted as the inner green rectangle) is fully characterised by the CHSH inequalities Eq. (1). For each non-signalling behaviour P which breaks the local bound, one finds a convex decomposition P = p ·P + (1 − p) ·P (k) with p = 1 2 (4 − S max ) for some local behaviourP and a PR-boxP (k) . On the picture, we have S max = S 1 > 2 and k = 1. and consequently |S i | < 2 for i = 2, 3, 4 . It is straightforward to appreciate that all other cases reduce to this one by relabelling the indices. * Decomposition of Lemma 3 (proof). Let us start by recalling the concept of a PR-box (due to Popescu-Rohrlich [1]) which is a non-signalling behaviour {P ab|xy } xy saturating the CHSH expressions. To be more precise, only one of the expressions Eqs. (2)-(5) can reach its maximal/minimal valueS i = ± 4 and then the rest must be equal to zero (cf. Remark 3). There are eight possible PR-boxes out of which we select just two cases for illustratioñ andP (2) All the remaining boxes {P (k) ab|xy } xy for k = 3, ... , 8 obtain by relabelling the indices x, y. These two behaviours saturate the first CHSH expression Eq. (2), i.e.
and similarly the remaining six boxes saturate the other three CHSH expressions Eqs. (3)-(5) (in particular we haveS (k) 1 = 0 for k = 3, ... , 8). In what follows, PR-boxes will be used because * To change signs: (a → −a) ⇒ (S i → −S i ). To switch between expressions: of their role in the description of the non-signalling polytope in a two-setting and two-outcome Bell scenario [2].
For reference let us quote Lemma 3 from the main manuscript that we will shortly prove; see [3] for a related result. See Fig. S1 for illustration. Lemma 3. Each non-signalling behaviour {P ab|xy } xy with binary settings x, y ∈ M = {0, 1} can be decomposed as a convex mixture of a local behaviour {P ab|xy } xy and a PR-box {P ab|xy } xy in the form P ab|xy = p ·P ab|xy + (1 − p) ·P ab|xy , [52] with p = 1 2 (4 − S max ) for all x, y ∈ {0, 1}. [In the case S 1 > 2, the PR-box is that of Eq. (49)].
By linearity of the CHSH expresions, from Eq. (53) we get S i = 1 p S i − 1−p pS (1) i . It follows that where the last inequality for i = 1 is due to Remark 3. Now, it is straightforward to check that for p = 1 2 (4 − S 1 ) all four CHSH expressions satisfy the local bound, i.e. we have |S 1 | = 2 and |S i | 2 for i = 1.

DIRECT PROOF OF THEOREM 3
We start by considering a wide class of upper bounds on the measure free choice µ F . This result will be used to prove Theorem 3 with the help of correlations saturating the so called chained Bell inequalities (for a special choice of measurement settings on a Bell state).
Upper bounds on measure of free choice µ F . Let x, y ∈ M with the choice of settings M unspecified for the time being. Our analysis will proceed with algebraic expressions which take the following form S = ∑ x,y α xy · ab xy , [58] where α xy ∈ {0, ± 1} are some arbitrary coefficients and ab xy ≡ ∑ a,b ab P ab|xy is the usual correlation function. For each such expression S we will look at two auxiliary quantities. The first one counts the number of non-zero terms in Eq. (58), i.e., The second one is the upper bound of Eq. (58) with the correlation coefficients replaced by a product, i.e., † S loc = max −1 ax 1 −1 by 1 ∑ x,y α xy · a x b y . [60] Note that both S # and S loc depend only on the coefficients α xy (and not on the correlation functions ab xy ).
In the following, we consider an arbitrary HV model of a given set behaviour {P ab|xy } xy obtained in a Bell experiment † A closer inspection of Eq. (60) reveals the maximum is attained at one of the extremal points ax , by = ± 1 (since the expression ∑x,y αxy · ax by is a linear function for each variable ax , by).
(with x, y ∈ M). The decomposition Eq. (11) entails splitting of Eq. (6) into two components P ab|xy = ∑ λ∈Λ F P ab|xyλ · P λ + ∑ λ∈Λ NF P ab|xyλ · P λ|xy , [61] which describe fundamentally different situations with and without freedom of choice, i.e. corresponding to the hidden variable λ being respectively in the free domain (Λ F ) or nonfree domain (Λ NF ). This can be used to write the correlation coefficients in the form ab xy = ∑ λ∈Λ F ab xyλ · P λ + ∑ λ∈Λ NF ab xyλ · P λ|xy , [62] where ab xyλ ≡ ∑ a,b ab P ab|xyλ is the correlation coefficient for fixed λ. Hence, the expression S defined in Eq. (58) splits into two parts α xy · ab xyλ · P λ + [63] ∑ λ∈Λ NF ∑ x,y α xy · ab xyλ · P λ|xy . [64] Note that in the first term probability P λ factors out due to the condition in Eq. (11) defining the free domain Λ F . So far, the causal structure of the HV model has not been constrained. Now, we make the locality assumption Eq. (8) which entails the following factorisation ab xyλ = a xλ b yλ , with a xλ = ∑ a a P a|xλ and b yλ = ∑ b b P b|yλ . Then the expression in Eq. ( where we use the fact that conditional probabilities P λ|xy are normalised and Λ = Λ F ∪ Λ NF (cf. Eq. (11)) , which entails 1 = ∑ λ∈Λ P λ|xy = ∑ λ∈Λ F P λ + ∑ λ∈Λ NF P λ|xy [67] for each x, y ∈ M. Putting everything together, from Eqs. ∑ λ∈Λ F P λ S # − S S # − S loc . [68] Since this inequality should be satisfied by any LHV model reproducing given behaviour {P ab|xy } xy in a Bell experiment (irrespective of the distribution of settings P xy ), then we get upper bound on the the measure of free choice defined in Eq. (13) µ F S # − S S # − S loc .
[69] Crucially, the bound in Eq. (69) holds for any expression S as defined in Eq. (58). Let us emphasise that the numbers S # and S loc are determined solely by the choice of coefficients α xy , while S itself depends on the observed experimental statistics {P ab|xy } xy through the correlation coefficients ab xy , see Eqs. (58) - (60).