# Two-Envelope Problems

Let's visit a couple of fun and extremely counterintuitive problems which sit in the same family. Plenty of articles have discussed who discovered what ad nauseum so we'll just dive into the basic problems.

## The Two Envelope Paradox: Optimizing Expected Return

First, consider the following scenario. Suppose you are shown two identical envelopes, each containing some amount of money unknown to you. You are told that one contains double the money in the other (but not which is which or what the amounts are) and are instructed to choose one. The one you select is placed in front of you and its contents are revealed. You then are given a second choice: keep it or switch envelopes. You will receive the amount in the envelope you choose. Your goal is to maximize your expected payment.

Our intuition tells us that no information has been provided by opening the envelope. After all, we didn't know the two values beforehand so learning one of them tells us nothing. The probability of picking the higher envelope should be $1/2$ regardless of whether we switch or not. But you weren't asked to improve on the probability, just to maximize your expected payment. Consider the following 3 arguments:

• Let the amount in the the envelope you initially chose be $z$. If it is wrong to switch then the other envelope contains $z/2$, but if it is right to switch it contains $2z$. There are even odds of either, so your expectation if you switch is $1.25z$. This is better than the $z$ you get by sticking with the initial envelope, so it always is better to switch!

• Since we don't know anything about the numbers involved, opening the first envelope gives us no information --- so ignore that value. Call the amount in the other envelope $z'$. If it is wrong to switch then the envelope you chose contains $2z'$, and if right to switch it contains $0.5z'$. If you switch, you get $z'$ but if you don't your expectation is $1.25z'$. So it always is better NOT to switch!

• Call the amounts in the two envelopes $x$ and $2x$ (though you don't know which envelope contains which). You pick one, but there is equal probability of it being either $x$ or $2x$. The expected reward thus is $1.5x$. If you switch, the same holds true for the other envelope. So you still have an expected reward of $1.5x$. It doesn't matter what you do.

Obviously, something is wrong with our logic. One thing that is clear is that we're mixing apples and oranges with these arguments. Let's be a bit more consistent with our terminology. Let's call the value that is in the opened envelope $z$ and the values in the two envelopes $x$ and $2x$. We don't know which envelope contains each, though. When we choose the first envelope, we observe a value $z$. This value may be $x$ or $2x$.

In the 3rd argument, $P(z=x)= P(z=2x)= 0.5$. If we switch, then $< V >= P(z=x)2x+P(z=2x)x = 1.5x$. If we keep the initial envelope then $< V >= P(z=x)x+P(z=2x)2x = 1.5x$. Whether we switch or not, the expected value is $1.5x$ though we do not know what this actually is. It could correspond to $1.5z$ or $0.75z$. We must now draw an important distinction. It is correct that $P(z=x)= P(z=2x)= 0.5$ for the known $z$ and given our definition of $x$ as the minimum of the two envelopes. However, we cannot claim that $1.5x$ is $1.5z$ or $0.75z$ with equal probability! That would be tantanmount to claiming that the envelopes contain the pairs $(z/2,z)$ or $(z,2z)$ with equal probability. We defined $x$ to be the minimum value so the first equality holds, but we would need to impose a constraint on the distribution over that minimum value itself in order for the second one to hold. This is a subtle point and we will return to it shortly. Suffice it to say that if we assume such a thing we are led right to the same fallacy the first two arguments are guilty of.

Obviously, the first two arguments can't both be correct. Their logic is the same and therefore they must both be wrong. But how? Before describing the problems, let's consider a slight variant in which you are NOT shown the contents of the first envelope before being asked to switch. It may seem strange that right after you've chosen, you are given the option to switch when no additional information has been presented. Well, this really is the same problem. With no apriori knowledge of the distribution over $x$, it is immaterial whether the first envelope is opened or not before the 2nd choice is made. This gives us a hint as to what is wrong with the first two arguments.

There actually are two probability distributions at work here, and we are confounding them. The first is the underlying distribution on ordered pairs or, equivalently, the distribution of the lower element $x$. Let us call it $P(x)$. It determines which two numbers $(x,2x)$ we are dealing with. We do not know $P(x)$.

The second relevant distribution is over how two given numbers (in our case $(x,2x)$) are deposited in the envelopes (or equivalently, how the player orders the envelopes by choosing one first). This distribution unambiguously is 50-50.

The problem arises when we implicitly assume a form for $P(x)$ or attempt to infer information about it from the revealed value $z$. Without apriori knowledge of $P(x)$, being shown $z$ makes no difference at all. Arguments which rely solely on the even-odds of the second distribution are fine, but arguments which implicitly involve $P(x)$ run into trouble.

The first two arguments make precisely this sort of claim. They implicitly assume that the pairs $(z/2,z)$ or $(z,2z)$ can occur with equal probability. Suppose they couldn't. For simplicity (and without reducing the generality of the problem), let's assume that the possible values in the envelopes are constrained to $2^n$ with $n\in Z$. The envelopes thus contain $(2^n,2^{n+1})$ for some integer $n$ (though we don't know which envelope contains which value). For convenience, let's work in terms of $log_2$ of the values involved (taking care to use $2^n$ when computing expectations).

In these terms, the two envelopes contain $(n,n+1)$ for some $n=\log_2(x)$ (defined to be the lesser of the two). We open one, and see $m=\log_2(z)$. If it is the upper then the pair is $(m-1,m)$, otherwise the pair is $(m,m+1)$. To claim that these have equal probabilities means that $n=m-1$ and $n=m$ are equally probable. We made this assumption independent of the value of $m$, so it would require that all pairs $(n,n+1)$ be equally probable.

So what? Why not just assume a uniform distribution? Well, for one thing, we should be suspicious that we require an assumption about $P(x)$. The 3rd argument requires no such assumption. Even if we were to assume a form for $P(x)$, we can't assume it is uniform. Not just can't as in "shouldn't", but can't as in "mathematically impossible." It is not possible to construct a uniform distribution on $Z$.

Suppose we sought to circumvent this issue by constraining ourselves to some finite range $[M,N]$, which we supposedly know or assume apriori. We certainly can impose a uniform distribution on it. Each pair $(n,n+1)$ has probability $1/(N-M-1)$ with $n\in [M,N-1]$. But now we've introduced additional information (in the form of $N$ and $M$), and it no longer is surprising that we can do better than even-odds! We always would switch unless the first envelope contained $N$. There is no contradiction between the first two arguments because we have apriori knowledge and are acting on it. We no longer are true to the original game.

Rather than dwell on this particular case, let's solve the more general case of a given $P(x)$ (or in terms of $log_2$, $P(n)$). For any $n$ drawn according to $P(n)$, the envelopes contain $(n,n+1)$ in some order and it is equally likely that $m=n$ and $m=n+1$. If we know $P$ we can bet accordingly since it contains information. In that case, knowing $m$ (i.e. $z$) helps us. Let's suppose we don't know $P$. Then it still does not matter whether we observe the value $z$, because we don't the know the underlying distribution!

There only are two deterministic strategies: always keep, always switch. Why? Suppose that the drawn value is $n$ (unknown to us) and the observed value is $m$. Note that these don't require actual knowledge of the $m$ value, just that it has been fixed by the process of opening the envelope. Since we don't know the underlying distribution, our strategy will be independent of the actual value. Given that the value doesn't matter, we have nothing to do but always keep or always switch.

First consider the expected value with the always-keep strategy:

$$< V_K >= \sum_{n=-\infty}^\infty P(n) [P(m=n|n) 2^n + P(m=n+1|n) 2^{n+1}]$$

I.e. we sum over all possible ordered pairs $(n,n+1)$ and then allow equal probability $P(m=n+1|n)=P(m=n|n)=0.5$ for either of the two envelope orders. So we have $< V_K >= \sum P(n) (2^n+2^{n+1})/2 = 3 < 2^{n-1} >$. We immediately see that for this to be defined the probability distribution must drop faster than $2^n$ as $n$ gets large! We already have a constraint on the possible forms for $P$.

Next consider the always-switch strategy. It's easy to see that we get the same result:

$$< V_S >= \sum_{n=-\infty}^\infty P(n) [P(m=n|n) 2^{n+1} + P(m=n+1|n) 2^{n}]$$ and since $P(m=n|n)= P(m=n+1|n)$ we get the same answer.

But let's be extra pedantic, and connect this to the original formulation of the first two arguments. I.e., we should do it in terms of $m$, the observed value.

$$< V_S >= \sum_m P(m) [P(n=m|m) 2^{m+1} + P(n=m-1|m) 2^{m-1}]$$

We observe that $P(n=m|m)= P(m|n=m)P(n=m)/P(m)$ and $P(n=m-1|m)= P(m|n=m-1)P(n=m-1)/P(m)$. We know that $P(m|n=m)= P(m|n=m-1)= 0.5$. Plugging these in, we get

$$< V_S > = \sum_m [0.5 P(n=m) 2^{m+1} + 0.5 P(n=m-1) 2^{m-1}]$$

The first term gives us $\sum_n P(n) 2^n$. We can rewrite the index on the 2nd sum to get $\sum_n P(n) 2^{n-1}$, which gives us $< V_S > = \sum_m P(n) (2^n + 2^{n-1})$, the exact same expression as before!

How does this apply to the $[M,N]$ ranged example we gave before? When we discussed it, we considered the case where the underlying distribution was known. In that and all other cases, a better than even-odds strategy based on such knowledge can be computed. In our actual formulation of the game, we don't know $P(n)$ and there's no reason it couldn't be uniform on some unknown interval $[M,N]$. Suppose it was. It still seems from our earlier discussion as if we'd do better by always switching. We don't. The average amount thrown away by incorrectly switching when $m=N$ exactly offsets the average gain from switching in all other cases. We do no better by switching than by keeping.

We thus see that without knowing the underlying distribution $P(x)$, the switching and keeping strategies have the same expected reward. Of the three arguments we originally proposed, the first 2 were flawed in that they assume a particular, and impossible, underlying distribution for $x$.

At the beginning of our discussion, we mentioned that our intuition says you cannot do better than 50-50 probability-wise. Let us set aside expected rewards and focus solely on probabilities. We now see how you actually can do better than 50-50, contrary to all intuition!

## The Two Envelope Problem: Optimizing Probability of Success

Next let's consider a broader class of two-envelope problems, but purely from the standpoint of probabilities. Now the two envelopes can contain any numbers; one need not be double the other. As before, we may choose an envelope, it is opened, and we are offered the opportunity to keep it or switch. Unlike before, our goal now is to maximize the probability of picking the larger envelope.

Since we are dealing with probabilities rather than expectation values, we don't care what two numbers the envelopes contain. In fact, they need not be numbers at all --- as long as they are distinct and comparable (i.e. $a < b$ or $b < a$ but not both). To meaningfully analyze the problem we require a slightly stronger assumption, though: specifically that the set from which they be drawn (without repetition) possesses a strict linear ordering. However, it need not even possess any algebraic structure or a metric. Since we are not concerned with expectation values, no such additional structure is necessary.

Our intuition immediately tells us that nothing can be gained by switching. In fact, nothing we do should have any impact on the outcome. After all, the probability of initially picking correctly is $1/2$. Switching adds no information and lands us with an identical $1/2$ probability. And that is that, right? It turns out that, contrary to our very strong intuition about the problem, there is in fact a way to improve those odds. To accomplish this, we'll need to introduce a source of randomness. For convenience of exposition we'll assume the envelopes contain real numbers, and revisit the degree to which we can generalize the approach later.

The procedure is as follows:

• Pick any continuous probability distribution $P$ which has support on all of $R$ (i.e. $p(x)>0$ for all real $x$). Most common distributions (normal, beta, exponential, etc) are fine.
• Choose an envelope and open it. We'll denote its value $z$.
• Sample some value $d$ from our distribution $P$. If $z > d$ stick with the initial choice, otherwise switch. We'll refer to $z > d$ or $z < d$ because the probability that $z=d$ has measure $0$ and safely can be ignored.

At first, second, and $n^{th}$ glance, this seems pointless. It feels like all we've done is introduce a lot of cruft which will have no effect. We can go stand in a corner flipping a coin, play Baccarat at the local casino, cast the bones, or anything else we want, and none of that can change the probability that we're equally likely to pick the lower envelope as the higher one initially --- and thus equally likely to lose as to gain by switching. With no new information, there can be no improvement. Well, let's hold that thought and do the calculation anyway. Just for fun.

First some terminology. We'll call the value in the opened envelope $z$, and the value in the other envelope $z'$. The decision we must make is whether to keep $z$ or switch to the unknown $z'$. We'll denote by $x$ and $y$ the values in the two envelopes in order. I.e., $x < y$ by definition. In terms of $z$ and $z'$ we have $x= \min(z,z')$ and $y= \max(z,z')$. We'll denote our contrived distribution $P$ in the abstract, with pdf $p(v)$ and cdf $F(v)=\int_{-\infty}^v p(v') dv'$.

Let's examine the problem from a Bayesian perspective. There is a 50-50 chance that $(z,z')=(x,y)$ or $(z,z')=(y,x)$. So $p(z=x)=p(z=y)=0.5$. There are no subtleties lurking here. We've assumed nothing about the underlying distribution over $(x,y)$. Whatever $(x,y)$ the envelopes contain, we are equally likely to initially pick the one with $x$ or the one with $y$.

Once the initial envelope has been opened, and the value $z$ revealed, we sample $d$ from our selected distribution $P$ and clearly have $p(d < x)=F(x)$ and $p(d < y)=F(y)$ and $p(d < z)=F(z)$. The latter forms the criterion by which we will keep $z$ or switch to $z'$. Please note that in what follows, $d$ is not a free variable, but rather a mere notational convenience. Something like $p(x < d)$ is just notation for "the probability the sampled value is greater than $x$." We can apply Bayes' law to get (with all probabilities conditional on some unknown choice of $(x,y)$):

$$p(z=x|d < z)= \frac{p(d < z|z=x)p(z=x)}{p(d < z)}$$

What we really care about is the ratio:

$$\frac{p(z=x | d < z)}{p(z=y | d < z)}= \frac{p(d < z|z=x)p(z=x)}{p(d < z|z=y)p(z=y)}= \frac{F(x)}{F(y)} < 1$$

Here, we've observed that $p(d < z| z= x)= p(d < x)= F(x)$ and $F(x) < F(y)$ since by assumption $x < y$ and $F$ is monotonically increasing (we assumed its support is all of $R$). I.e., if $d < z$ there is a greater probability that $z=y$ than $z=x$. We shouldn't switch. A similar argument shows we should switch if $d>z$.

So what the heck has happened, and where did the new information come from? What happened is that we actually know one piece of information we had not used: that the interval $(x,y)$ has nonzero probability measure. I.e. there is some "space" between $x$ and $y$. We don't know the underlying distribution but we can pretend we do. Our strategy will be worse than if we did know the underlying $p(x)$, of course. We'll return to this shortly, but first let's revisit the assumptions which make this work. We don't need the envelopes to contain real numbers, but we do require the following of the values in the envelopes:

• The set of possible values forms a measurable set with a strict linear ordering.
• Between any two elements there is a volume with nonzero probability. Actually, this only is necessary if we require a nonzero improvement for any $(x,y)$. If we only require an improvement on average we don't need it. But in that scenario, the host can contrive to use a distribution which neutralizes our strategy and returns us to 50-50 odds.

What difference does $P$ itself make? We don't have any way to choose an "optimal" distribution because that would require placing the bulk of probability where we think $x$ and $y$ are likely to lie. I.e. we would require prior knowledge. All we can guarantee is that we can improve things by some (perhaps tiny) amount. We'll compute how much (for a given true underlying distribution) shortly.

Let's assume that $Q(x,y)$ is the true underlying distribution over $(x,y)$. We won't delve into what it means to "know" $Q$ since we are handed the envelopes to begin with. Perhaps the game is played many times with values drawn according to $Q$ or maybe it is a one-time affair with $(x,y)$ fixed (i.e. $Q$ a $\delta$-distribution). Ultimately, such considerations just would divert us to the standard core philosophical questions of probability theory. Suffice to say that there exists some $Q(x,y)$. By definition $Q(x,y)=0$ unless $x < y$. For convenience, we'll define a symmetrized version as well: $q(a,b)\equiv Q(a,b)+Q(b,a)$. We don't employ a factor of $1/2$ since the two terms are nonzero on disjoint domains.

Given $Q$, what gain do we get from a particular choice of $P$?

$$P(win)= \int_{x < y} dx dy Q(x,y)[p(z=x|(x,y))p(x < d) + p(z=y|(x,y))p(d < y)]$$

I.e., the probability we keep $z$ when it is $y$ and switch when it is $x$. Clearly, $p(z=x|(x,y))= p(z=y|(x,y))= 0.5$ since those are the immutable 50-50 envelope ordering probabilities. After a little rearrangement, we get:

$$P(win)= \frac{1}{2} + < F(y) - F(x) >_Q$$

Our gain is the mean value of $F(y)-F(x)$ over the joint distribution $Q(x,y)$. The more probability $P$ jams between $x$ and $y$, the more we gain should that $(x,y)$ arise. But without knowledge of the underlying joint distribution $Q(x,y)$, we have no idea how best to pick $P$. All we can do is guarantee some improvement.

How well can we do if we actually know $Q$? Well, there are two ways to use such information. We could stick to our strategy and try to pick an optimal $P$, or we could seek to use knowledge of $Q$ directly. In order to do the former, we need to exercise a little care. $Q$ is a two-dimensional distribution while $P$ is one-dimensional. How would we use $Q$ to pick $P$? Well, this is where we make use of the observed $z$.

In our previous discussion of the $(x,2x)$ envelope switching fallacy, the value of $z$ turned out to be a red-herring. Here it is not. Observing $z$ is essential here, but only for computation of probabilities. As mentioned, we assume no algebraic properties and are computing no expectations. We already know that the observation of $z$ is critical, since our algorithm pivots on a comparison between $z$ and our randomly sampled value $d$. Considering our ultimate goal (keep or switch), it is clear what we need from $Q$: a conditional probability that $z' > z$. However, we cannot directly use $Q(y|x)$ because we defined $x < y$. We want $p(z'|z)$ and we don't know whether $z < z'$ or $z' < z$. Let's start by computing the probability of $z$ (being the observed value) and of $z,z'$ (being the observed and unobserved values).

The probability of observing $z$ and the other envelope having $z'$ is the probability that the relevant ordered pair was chosen for the two envelopes multiplied by the $1/2$ probability that we initially opened the envelop containing the value corresponding to our observed $z$ rather than the other one.

$$p(z,z')= Q(min(z,z'),max(z,z'))/2= q(z,z')/2$$

To get $p(z)$ we integrate this. $p(z)= \frac{1}{2}\int Q(z,y)dy + \frac{1}{2}\int Q(x,z)dz$. This is a good point to introduce two quantities which will be quite useful going forward.

$$I_1(z)\equiv \int_{-\infty}^z Q(x,z) dx$$ $$I_2(z)\equiv \int_z^\infty Q(z,y) dy$$

In terms of these,

$$p(z)= \frac{1}{2}[I_1(z)+I_2(z)]$$

There's nothing special about calling the variables $x$ or $y$ in the integrals and it is easy to see (since each only covers half the domain) that we get what we would expect:

$$p(z)= \frac{1}{2}\int q(w,z)dw$$

What we want is the distribution $p(z'|z)= p(z,z'|z)= p(z,z')/p(z)= q(z,z')/p(z)$. This gives us:

$$p(z'|z)= \frac{q(z,z')}{\int q(w,z)dw}= \frac{q(z,z')}{I_1(z)+I_2(z)}$$

Finally, this gives us the desired quantity $p(z' > z)= \int_{z'>z} dz' p(z'|z)$. It is easy to see that:

$$p(z' < z)= \frac{I_1(z)}{I_1(z)+I_2(z)}$$ $$p(z' > z)= \frac{I_2(z)}{I_1(z)+I_2(z)}$$

As an example, consider the previous $(x,2x)$ case --- where one envelope holds twice what the other does. We observe $z$, and $z'$ must be either $2z$ or $z/2$, though we don't know with what probabilities. If we are given the underlying distribution on $x$, say $P_2(x)$, we can figure that out. $Q(x,y)= P_2(x)\delta(y-2x)$ and $q$ is the symmetrized version. $\int q(w,z)dw= \int dw [Q(w,z)+Q(z,w)]= (P_2(z/2)+P_2(2z))$. So $p(z)= \frac{1}{2}(P_2(z/2)+P_2(2z))$. This is just what we'd expect --- though we're really dealing with discrete values and are being sloppy (which ends us up with a ratio of infinities from the $\delta$ function when computing probability ratios, but we'll ignore that here). The relevant probability ratio clearly is $P_2(z/2)/P_2(2z)$. From a purely probability standpoint, we should switch if $P_2(2z)>P_2(z/2)$. If we reimpose the algebraic structure and try to compute expectations (as in the previous problem) we would get an expected value of $z$ from keeping and an expected value of $z[P_2(z/2)/2 + 2P(2z)]$ from switching . Whether this is less than or greater than $z$ depends on the distribution $P_2$.

Returning to our analysis, let's see how often we are right about switching if we know the actual distribution $Q$ and use that knowledge directly. The strategy is obvious. Using our above formulae, we can compute $p(z' < z)$ directly. To optimize our probability of winning, we observe $z$ then we switch iff $I_1(z) < I_2(z)$. If there is additional algebraic structure and expectations can be defined, then an analogous calculations give whatever switching criterion maximizes the relevant expectation value.

In terms of probabilities, full knowledge of $Q$ is the best we can do. The probability we act correctly is:

$$P'(win)= \int dz \frac{[\theta(I_1(z)-I_2(z)) I_1(z) + \theta(I_2(z)-I_1(z))I_2(z)]}{I_1(z)+I_2(z)} = \int dz \frac{\max(I_1(z),I_2(z))}{(I_1(z)+I_2(z)}$$ $$P'(win|z)= \frac{\max(I_1(z),I_2(z))}{(I_1(z)+I_2(z)}$$ Since $I_1$ and $I_2$ are monotonic (one increasing, the other decreasing), we have a cutoff value $\hat z$ (defined by $I_1({\hat z})= I_2({\hat z})$) below which we should switch and above which we should not.

How do we do with our invented $P$ instead? We could recast our earlier formula for $P(win)$ into our current notation, but it's easier to compute directly. For given $z$, the actual probability of needing to switch is $I_2(z)/(I_1(z)+I_2(z))$. Based on our algorithm, we will do so with probability $P(z < d)= 1-F(z)$. The probability of not needing to switch is $I_1(z)$ and we do so with probability $P(z > d)= F(z)$. I.e., our probability of success for given $z$ is:

$$P(win|z)= \frac{I_1(z)F(z) + I_2(z)(1-F(z))}{I_1(z)+I_2(z)}$$

For any given $z$, this is of the form $\alpha r + (1-\alpha)(1-r)$ where $r= F(z)$ and $\alpha= I_1(z)/(I_1(z)+I_2(z))$. The optimal solutions lie at one end or the other. So it obviously is best to have $F(z)=0$ when $z<{\hat z}$ and $F(z)=1$ when $z>{\hat z}$. This would be discontinuous, but we could come up with a smoothed step function (ex. a logistic function) which is differentiable but arbitrarily sharp. The gist is that we want all the probability in $F$ concentrated around $\hat z$. Unfortunately, we have no idea where $\hat z$ is!

Out of curiosity, what if we pick instead $P$ to be the conditional distribution $p(z'|z)$ itself once we've observed $z$? We'll necessarily do worse than by direct comparison using $Q$ (the max formula above), but how much worse? Well, $p(z'|z)= q(z,z')/(I_1(z)+I_2(z))$. Integrating over $z' < z$ we have $F(z)= \int_{-\infty}^z p(z'|z) dz'= I_1(z)/(I_1(z),I_2(z))$. I.e., We end up with $(I_1^2(z)+I_2^2(z))/(I_1(z)+I_2(z))^2$ as our probability of success. If we had used $1-p(z'|z)$ for our $P$ instead we would get $2I_1(z)I_2(z)/(I_1(z)+I_2(z))^2$ instead. Neither is optimal in general.

Next, let's look at the problem from an information theory standpoint. As mentioned, there are two sources of entropy: (1) the choice of the underlying pair $(x,y)$ (with $x < y$ by definition) and (2) the selection $(z,z')=(x,y)$ or $(z,z')=(y,x)$ determined by our initial choice of an envelope. The latter is a fair coin toss with no information and maximum entropy. The information content of the former depends on the (true) underlying distribrution.

Suppose we have perfect knowledge of the underlying distribution. Then any given $z$ arises with probability $p(z)=\frac{1}{2}[I_1(z)+I_2(z)]$. Given that $z$, we have a Bernoulli random variable $p(z' > z)$ given by $I_2(z)/(I_1(z)+I_2(z))$. The entropy of that specific coin toss (i.e. the conditional entropy of the Bernoulli distribution $p(z' > z | z)$) is $$H(z' > z | z)= \frac{-I_1(z)\ln I(z) - I_2(z)\ln I_2(z) + (I_1(z)+I_2(z))\ln [I_1(z)+I_2(z)]}{I_1(z)+I_2(z)}$$

With our contrived distribution $P$, we are implicitly are operating as if $p(z' > z)= 1-F(z)$. This yields a conditional entropy:

$$H'(z' > z | z)= -(1-F(z))\ln (1-F(z)) - F(z)\ln F(z)$$

There is a natural measure of the information cost of assuming an incorrect distribution. It is the Kullback Liebler Divergence (also known as the relative entropy). While it wouldn't make sense to compute it between $Q$ and $P$ (which are, among other things, of different dimension, we certainly can compare the cost for given $z$ of the difference in our Bernoulli random variables for switching --- and then integrate over $z$ to get an average cost in bits. Let's denote by $q(z' > z)$ the probability based on the true distribution and keep $p(z' > z)$ for the contrived one. I.e. $q(z' > z)= I_2(z)/(I_1(z)+I_2(z))$ and $p(z' > z)= 1-F(z)$. For given $z$, the K-L divergence is: $$D(Q || P, z)= \frac{-I_2(z)\ln [(I_1(z)+I_2(z))(1-F(z))/I_2(z)] - I_1(z)\ln [(I_1(z)+I_2(z))F(z)/I_1(z)]}{I_1(z)+I_2(z)}$$ Integrating this, we get the mean cost in bits of being wrong. $$< D(Q || P) > = \frac{1}{2}\int dz [-(I_1(z)+I_2(z))\ln [I_1(z)+I_2(z)] - I_2(z)\ln (1-F(z)) - I_1(z)\ln F(z) + I_1(z)\ln I_1(z) + I_2(z)\ln I_2(z)]$$ The first term is simply $H(z)$, the entropy of our actual distribution over $z$. In fact, the first term and last 2 terms together we recognize as $< H(z' > z|z) >$, the mean Bernoulli entropy of the actual distribution. In these terms, we have: $$< D(Q || P) > = < H(z' > z|z) > + <\frac{ -I_2(z)\ln(1-F(z)) - I_1(z)\ln F(z)}{I_1(z)+I_2(z)} >$$

where the expectations are over the unconditional actual distribution $p(z)$. The 2nd expectation on the right represents the cost of being wrong about $P$. If it was the optimal distribution with all probability centered near $\hat z$ then the term on the right would approach $0$ and there would be no entropy cost.

As an aside, this sort of probabilistic strategy should not be confused with the mixed strategies of game theory. In our case, a mixed strategy would be an apriori choice $aK+(1-a)S$ where $K$ is the always-keep strategy, $S$ is the always-switch strategy, and $0\le a\le 1$ is the probability of employing the always-keep strategy. A player would flip a biased-coin with Bernoulli probability $a$ and choose one of the two-strategies based on it. That has nothing to do with the measure-theory approach we're taking here. In particular, a mixes strategy makes no use of the observed value $x$ or its relation to the randomly sampled value. Any mixed strategy gives even-odds because the two underlying deterministic strategies both have even-odds.

K.M. Halpern