<p>Generally the problem is unsolvable because you haven't specified the randomization procedure of the whole experiment. </p>

<p>But let Y be the value of the envelope you picked, and X the other envelope. The answer is then <span class="math-container">$E[X|Y=y]$</span> - which is a <a href="http://en.wikipedia.org/wiki/Conditional_expectation" rel="nofollow noreferrer"><em>conditional expectation</em></a> . However, assuming a most general distribution of Y, Y is uniformly drawn from all of <span class="math-container">$\mathbb{R}$</span>. But then <span class="math-container">$Pr(Y=y)=0$</span>, and by the <a href="http://en.wikipedia.org/wiki/Borel%E2%80%93Kolmogorov_paradox" rel="nofollow noreferrer"><em>Borel–Kolmogorov</em></a> paradox the expectation is unsolvable. </p>

CC BY-SA 4.0
2019-01-30T23:09:41.930Z
@JeffJo, I couldn't comment under your post due to not having sufficient reputation. I added this answer because I believe it's related to your post.
John Rambo
CC BY-SA 4.0
2019-01-30T23:02:21.133Z
2019-01-31T23:14:39.890Z
2019-01-31T23:14:39.890Z
John Rambo
<p>&quot;Is this reasoning correct&quot; No.</p>
<p>The reason why this reasoning is incorrect is that the expected value here depends on the probabilities that envelope 2 contains <span class="math-container">$2x$</span> or <span class="math-container">$x/2$</span>.  You have assumed that this is 50/50, but this cannot possibly be the case for all <span class="math-container">$x$</span>.</p>
<p>To see this, suppose that you open envelope 1 and find \$10.  You assume that envelope 2 might be as likely to contain \$5 as \$20.  Alternately, suppose that you open envelope 1 and find \$20.  You assume that envelope 2 might be as likely to contain \$10 as \$40.  The implicit assumption here is that, before we open envelope 1, <span class="math-container">$x$</span> (and hence <span class="math-container">$2x$</span>) might be just as likely to be <em>anything</em>.  However, this is not possible, as a uniform distribution over <span class="math-container">$[0,\infty)$</span> is not a valid probability distribution.  If you suppose that <span class="math-container">$x$</span> follows a valid probability distribution on <span class="math-container">$[0, \infty)$</span>.... ANY valid probability distribution, then the numbers all work out, and the expected value of switching from envelope 1 to envelope 2 is 0.</p>

CC BY-SA 4.0
2021-04-05T21:06:00.940Z
2021-04-05T23:23:08.890Z
2021-04-05T23:23:08.890Z
Him
<p>If you open envelope <strong>E1</strong>, and see that its value is <strong>E1=Y</strong>, then it is true that the other envelope <strong>E2</strong>'s value is in <strong>{E2=Y/2, E2=2Y}</strong>.</p>

<p>It is also true that the expected value of that envelope is <strong>(Y/2)*Pr(E2=Y/2)+(2Y)*Pr(E2=2Y)</strong>.</p>

<p>The error is assuming that <strong>Pr(E2=Y/2) = Pr(E2=2Y) = 1/2</strong> regardless of what <strong>Y</strong> is. A simplistic way to show this, is to assume that each envelope contains US paper money of various denominations. If <strong>Y=$1</strong>, then it is impossible for <strong>E2</strong> to be <strong>Y/2</strong>.</p>

<p>A more rigorous proof is too detailed to provide here, but a summary of it is to first assume that, for any value <strong>Z</strong>, that <strong>Pr(Z/2&lt;=E2&lt; Z)=Pr(Z&lt;=E2&lt;2Z)</strong>. This is essentially the same assumption as in the last paragraph, expanded to a range of values. But if this is true for any value of <strong>Z</strong>, it means <strong>Pr(Z*2^(N-1)&lt;=E2&lt; Z*2^(N-1))</strong> is constant for every value of <strong>N</strong>, from -inf to inf. Since that is impossible, the assumption can't be correct.</p>

<p>+++++</p>

<p>That may have been a little confusing, so let me try an example. You are given two sets of two envelopes. In one set, they contain 10 and 20 dollars. In the other, they contain 20 and 40. You pick a set, and then open one envelope in that set to find 20. You are then offered the chance to switch to the other envelope in that set. Should you?</p>

<p>Yes, should switch. The expected gain by switching to the other envelope is [(20-10)+(20-40)]/2 = +5.</p>

<p>Note that this <em>instance</em> - that is, knowing that you found 20, and not 10 or 40, fits the conditions you describe in your question. So your solution works. But the experiment itself does not fit that description. If you had found 10, or if you had found 40, the probability other envelope has 20 is 100%. The expected gains are +10, and -20, respectively. And if you average the three possible gains over the probabilities you would get the three values, you get 10/4 + 5/2 - 20/4 = 0.</p>

CC BY-SA 3.0
2016-04-01T14:44:03.437Z
Why would I assume an envelope could not have 50 cents in it? Also the question is specifically asking about times where you don't know the possible amounts that could be in it, just the possible relative amounts, so I'm not really following this.
Kitsune Cavalry
CC BY-SA 3.0
2016-04-01T14:48:04.773Z
I said it was a simplistic approach. It started with 'assume that each envelope contains US paper money.' Since you can't have 50 cents in US paper money, Pr(E2=$2|E1=$1)=1. The point is, that assuming Y/2 and 2Y are equally likely, when you don't know Y, is assuming a de facto distribution for Y that is impossible to achieve.
JeffJo
CC BY-SA 3.0
2016-04-01T14:38:26.170Z
2016-05-27T13:56:56.387Z
2016-05-27T13:56:56.387Z
JeffJo
<p>Here is an "expected utility maximization/ game theoretic" approach to the matter (with a dash of set-theoretic probability). In such a framework, the answers appear clear.</p>

<p><strong>PREMISES</strong></p>

<p>We are told in absolute honesty that, for $x$ a strictly positive monetary amount, the following two tickets were placed in a box :  $\{A=x, B= 2x\}$ with assigned identification number $1$ and $\{A=2x, B= x\}$ with assigned identification number $0$. Then a draw from a Bernoulli  $(p=0.5)$ random variable was executed, and based on the result and the event that has occurred, the amounts $x$ and $2x$ were placed in envelopes $A$ and $B$. We are not told what the value of $x$ is, or what amount went to which envelope. </p>

<p><strong>First CASE: Choose an envelope with the option to switch without opening it</strong></p>

<p>The first issue is <em>how do we choose an envelope</em>? This has to do with preferences. So <em>assume</em> that we are expected utility maximizers, with utility function $u()$.</p>

<p>We can model the probabilistic structure here by considering two dichotomous random variables, $A$ and $B$ representing the envelopes, and the amount in them. The support of each is $\{x, 2x\}$. But they are not independent. So we have to start with the joint distribution. In table form, the joint distribution, and the corresponding marginal distributions are</p>

<p>\begin{array}{| r | r |  }
  \hline                       
\text{A} \;/ \;\;\text{B} \rightarrow  &amp; x &amp; 2x &amp; \text {Marg A} \\
  \hline 
  \hline                       
  x &amp; 0 &amp; 0.5 &amp; 0.5\\
  \hline                     
2x &amp; 0.5 &amp; 0 &amp; 0.5 \\
\hline
\text{Marg B} &amp; 0.5 &amp; 0.5 &amp; 1.00 \\
  \hline  
\end{array}</p>

<p>This tells us that $A$ and $B$ have identical marginal distributions.</p>

<p>But this means that it doesn't matter how we choose envelopes, <em>because we will always get the same expected utility</em>, </p>

<p>$$0.5 \cdot u(x) + 0.5\cdot u(2x)$$</p>

<p>What we are facing here is a compound gamble (how to choose an envelope) over two identical gambles (each envelope). We can choose $A$ with probability $1$, $0$, or anything in-between (and complementarily for $B$). It doesn't matter. We will always get the same expected utility. Note that our attitude towards risk doesn't play a role here.</p>

<p>So we do choose an envelope, say $A$, and we are looking at it. What is now our expected utility? <em>Exactly the same as prior to choosing</em>. Picking an envelope in whatever way, does not affect the probabilities of what's inside.</p>

<p>We are allowed to switch. Say we do, and now we are holding envelope $B$. What is now are expected utility? <em>Exactly the same as before</em>. </p>

<p>These are the two possible states of the world for us: choose $A$ or choose $B$. Under any choice, both states of the world imply the same value to our chosen/assumed driving force (i.e. maximize expected utility). </p>

<p><strong>So here, we are indifferent to switching.</strong>, and in fact we could also randomize.</p>

<p><strong>2nd CASE: OPENING THE ENVELOPE with the option to switch after</strong>  </p>

<p>Assume now that we have picked $A$, opened it, and found inside the amount $y \in \{x, 2x\}$. Does this change things?  </p>

<p>Let's see. I wonder, what is</p>

<p>$$P(A = x \mid A \in \{x, 2x\}) = ?$$ </p>

<p>Well, $\{x, 2x\}$ is the sample space on which random variable $A$ is defined. Conditioning on the whole sample space, i.e. on the trivial sigma-algebra, does not affect neither the probabilities, nor the expected values. It is as though we wonder "what is the value of $A$ if we know that all possible values may have been realized?" No effective knowledge has been gained, so we are still at the original probabilistic structure.  </p>

<p>But I also wonder, what is </p>

<p>$$P(B = x \mid A \in \{x, 2x\}) = ?$$ </p>

<p>The conditioning statement, properly viewed as a sigma-algebra generated by the event $\big \{A \in \{x, 2x\}\big\}$, is the whole product sample space on which the random vector $(A,B)$ has been defined. From the table of the joint distribution above, we can see that the probability allocation of the joint is equivalent a.s to the probability allocation of the marginals (the "almost surely" qualification due to the presence of two events of measure zero). So here too we essentially condition the probabilities for $B$ on its whole sample space. It follows that our action to open the envelope did not affect the probabilistic structure for $B$ also.</p>

<p>Enter game theory, alongside decision making. We have opened the envelope, and we have to decide whether we will switch or not. If we don't switch we get utility $u(y)$. If we switch, then we are in the following two possible states of the world </p>

<p>$$y = x, u(A) = u(x) \implies u(B) = u(2x)$$
$$y = 2x, u(A) = u(2x)\implies u(B) = u(x)$$</p>

<p>We do not know which state actually holds, but per the above discussion, we do know that each has probability $p=0.5$ of existing.  </p>

<p>We can model this as a game where our opponent is "nature" <em>and where we know that nature plays with certainty a randomized strategy</em>: with $p=0.5$ $y=x$ and with $p=0.5$, $y=2x$. But we also now that if we do not switch, our payoff is certain. So here is our game in normal form, with our payoffs:</p>

<p>\begin{array}{| r | r |  }
  \hline                       
\text{We} \;/ \;\;\text{nature} \rightarrow  &amp;y= x &amp; y=2x  \\
  \hline                       
  \text{Switch} &amp; u(2x) &amp; u(x) \\
  \hline                     
\text{Don't Switch} &amp; u(y) &amp; u(y)  \\
  \hline
\end{array}</p>

<p>We should resist the temptation to substitute $u(x)$ and $u(2x)$ for $u(y)$. $u(y)$ is a <em>known</em> and certain payoff. The payoffs for the "Switch" strategy are not actually known (since we do not know the value of $x$). So we <em>should reverse the substitution</em>. If $y=x$ then $u(2x) = u(2y)$, and if $y=2x$ then $u(x) = u(y/2)$. So here is our game again:</p>

<p>\begin{array}{| r | r |  }
  \hline                       
\text{We} \;/ \;\;\text{nature} \rightarrow  &amp;y= x &amp; y=2x  \\
  \hline                       
  \text{Switch} &amp; u(2y) &amp; u(y/2) \\
  \hline                     
\text{Don't Switch} &amp; u(y) &amp; u(y)  \\
  \hline
\end{array}</p>

<p>Now all the payoffs in the matrix are known. Is there a pure dominant strategy?  </p>

<p>The expected payoff of strategy "Switch" is</p>

<p>$$E(V_S) = 0.5\cdot u(2y) + 0.5 \cdot u(y/2)$$</p>

<p>The expected payoff of strategy "Don't Switch" is</p>

<p>$$E(V_{DS}) = u(y)$$</p>

<p>We should switch if</p>

<p>$$E(V_S) &gt; E(V_{DS}) \implies 0.5\cdot u(2y) + 0.5 \cdot u(y/2) &gt; u(y)$$</p>

<p>And <em>now</em>, attitude towards risk becomes critical. It is not difficult to deduce that <strong>under risk-taking and risk neutral behavior, we should Switch.</strong></p>

<p>As regards <strong>risk-averse behavior</strong>, I find an elegant result:   </p>

<p>For "less concave" (strictly above) utility functions than logarithmic (say, square root), then we should still Switch.</p>

<p><strong>For logarithmic utility $u(y) = \ln y$, we are indifferent between switching or not.</strong></p>

<p>For "more concave" than (strictly below)  logarithmic utility functions, we should <em>not</em> Switch.</p>

<p>I close with the diagram of the logarithmic case</p>

<p><a href="https://i.sstatic.net/CUfRW.png" rel="noreferrer"><img src="https://i.sstatic.net/CUfRW.png" alt="enter image description here"></a></p>

<p>Assume $y=4$. Then $y/2 =2, 2y = 8$. The line $Γ-Δ-Ε$ is the line on which the expected utility from "Switch" will lie. Since nature plays a $50-50$ strategy, it will actually be at point $\Delta$, which is the middle point of $Γ-Δ-Ε$. At that point with logarithmic utility, we get exactly the same utility from "Don't Switch", i.e. $\ln(4)$ for this numerical example.</p>

CC BY-SA 3.0
2018-01-15T09:52:50.647Z
Invoking "risk aversion" through a logarithmic utility function do not resolve the paradox.  As noted by @HRSE, using Bayes theorem, the probabilities that the payoffs are $u(2y)$ and $u(y/2$ are _not_ 0.5 after seeing the amount in the first envelope.  This would only hold for a highly questionable uniform improper prior on $x$ (for $x>0$).  If using a proper prior on $x$ (reflecting one's beliefs about $x$), the solution becomes to switch if $y$ is sufficiently small and to keep the first envelope if $y$ is sufficiently large. See https://www.jstor.org/stable/2685310.
Jarle Tufto
CC BY-SA 3.0
2018-01-15T13:59:12.273Z
@JarleTufto The way I see it, the uniform prior is the correct prior, if one decides to believe the organizers of the game, when they say that the money amounts were put in the envelops following a Bernoulli draw with $p=0.5$. If one wants to be suspicious, not believe the organizers and form some other prior belief, it is of course his right, but he would have to come with some argument to convince me as to a) why the organizers are lying and b) how does he chooses the different prior he chooses. Note that my answer presupposes that we believe the organizers on the matter.
Alecos Papadopoulos
CC BY-SA 3.0
2018-01-15T14:19:11.050Z
I of course agree that you are given each envelope containing amounts $X$ and $2X$ respectively with equal probabilities of 1/2.  What I'm saying is that the implicit improper uniform prior on $X$ that you use, that is, $\pi(x) =1$, for all $x>0$ leads to the paradox because Bayes theorem then leads to $P(X=y|Y=y) = P(X=y/2|Y=y)=1/2$ where $y$ is the observed amount in the first envelope.   Using a proper prior $\pi(x)$ instead, these conditional probabilities differ and the optimal decision depends on $y$ (and of course the utility function).
Jarle Tufto
CC BY-SA 3.0
2018-01-15T14:27:08.520Z
@JarleTufto This improper prior you mention, it reflects probabilities related to what?
Alecos Papadopoulos
CC BY-SA 3.0
2018-01-15T16:28:07.710Z
The amount of money in the two envelopes are $X$ and $2X$.  The prior probability distribution represents your beliefs about about $X$ before opening any envelope.  You're either implicitly using this particular prior or you're committing the fallacy of equating reverse conditional probabilities.
Jarle Tufto
CC BY-SA 3.0
2018-01-15T17:18:21.497Z
@JarleTufto Please help me a bit more here. When you write "represents beliefs about $X$" what do you mean? A probability allocation over what the value $X$ could be? Namely, something like "$X$ equals $10$ with probability $p_1$, equals $23$ with probability $p_2$, equals  $89$ with probability $p_3$ etc? Or you mean something completely different than that?
Alecos Papadopoulos
CC BY-SA 3.0
2018-01-15T18:36:28.223Z
https://en.wikipedia.org/wiki/Bayesian_probability
Jarle Tufto
CC BY-SA 3.0
2018-01-15T19:03:23.767Z
@JarleTufto I know about Bayesian probability, this was not my question.  My question was _on what events/phenomena_ this prior is formed over. So I am asking again: is it over the values $X$ may take, or over something else?
Alecos Papadopoulos
CC BY-SA 3.0
2018-02-04T00:04:35.107Z
@JarleTufto  Once the envelope has been opened, a prior on $x$ is not improper as it can only be binary.  A uniform prior is a two-point prior in this case.  Once $y$ is seen, which is data, the uniform prior over $x$ collapses to a binary posterior which in turn becomes the prior for the next round.
Dave Harris
CC BY-SA 3.0
2018-02-04T00:04:59.210Z
@AlecosPapadopoulos see my above post to Jarle Tufto.
Dave Harris
CC BY-SA 3.0
2018-02-04T00:29:26.803Z
@DaveHarris Thank you for contributing. It is my impression that the issue here is that Jarle Tufto presupposes the existence of a prior on whether the amount seen is the "large" or the "small" one, (and then analyses correctly or incorrectly) while the set up I use does not need, and does not invoke, the existence of such a prior. I recently posted a question on this methodological issue  over at CV, https://stats.stackexchange.com/q/326484/28746
Alecos Papadopoulos
CC BY-SA 3.0
2018-02-04T05:40:33.430Z
@AlecosPapadopoulos actually an argument could be made that the problem does, in fact, have a prior built into it, but also that it is irrelevant to the solution.  For example, you know that the reward is positive.  Although you could impose an improper prior on $x$ such as $\Pr(X=x)\propto{1}$, an informed individual could add a proper prior without insult to the problem.  Again, it is irrelevant, but you could do it.  This is because you know that $x$ cannot be infinite and must be an element of the rationals as money is discrete.
Dave Harris
CC BY-SA 3.0
2018-02-04T05:44:17.980Z
@AlecosPapadopoulos you could produce a prior which is uniform over the range $(0,k]$ where $k$ is much larger than planetary output, and provide for a half normal from that point until infinity.  The issue isn't that there isn't a prior, the issue is that for any prior where $x$ is supported on the rational numbers, then the outcome is independent of the prior.  This is due to the nature of the problem as a binary likelihood.
Dave Harris
CC BY-SA 3.0
2018-02-04T05:46:36.277Z
@AlecosPapadopoulos finally, it is challenging to imagine this as a meaningful Bayesian problem because the parameters are known with certainty.  That is to say, there is a fifty-fifty chance that $X=x$.  The only parameter uncertainty is with regard to the identity of the envelope, which in Bayesian thinking would be a parameter.
Dave Harris
CC BY-SA 3.0
2016-01-08T22:35:10.097Z
2016-01-09T03:41:05.063Z
2016-01-09T03:41:05.063Z
Alecos Papadopoulos
<p>There are two envelopes. One contains <span class="math-container">$x$</span> money and the other contains <span class="math-container">$2x$</span> amount of money. The exact amount &quot;<span class="math-container">$x$</span>&quot; is unknown to me, but I know the above. I pick one envelope and I open it. I see <span class="math-container">$y$</span> money in it, obviously where <span class="math-container">$y \in \{x, 2x\}$</span>.</p>
<p>Now I am offered to keep or switch envelopes.</p>
<p>The expected value of switching is <span class="math-container">$(\frac{1}{2} \cdot 2y + \frac{1}{2} \cdot \frac{1}{2}y) = \frac{5}{4}y$</span>.
The expected value of keeping my envelope is <span class="math-container">$y$</span>.</p>
<p>It seems that I should always switch envelopes. My two questions:</p>
<blockquote>
<p>Is this reasoning correct?</p>
<p>Is it any different if I am not allowed to open the envelope and see the <span class="math-container">$y$</span> amount of money, and then I am given the option to switch indefinitely?</p>
</blockquote>

CC BY-SA 3.0
2016-01-08T06:43:28.967Z
Related: https://en.wikipedia.org/wiki/Two_envelopes_problem
Herr K.
CC BY-SA 3.0
2016-01-08T07:03:59.740Z
You cannot just take the expectation, you should start out with beliefs about x and update your beliefs according to Bayes' rule. Once you see y, your beliefs about which envelope you opened will have changed.
HRSE
CC BY-SA 3.0
2016-01-08T08:02:30.510Z
Say x is uniformly distributed between 0 and $\infty$. Then what?
Kitsune Cavalry
CC BY-SA 3.0
2016-01-08T08:18:08.533Z
@KitsuneCavalry There is no such disribution. (Please do send me a program generating such a distribution.) In fact there is no resolution which generates the pior beliefs given in your question for all values of $y$. In the link of Herr K. this is explained in https://en.wikipedia.org/wiki/Two_envelopes_problem#Simple_form_of_Bayesian_resolution
Giskard
CC BY-SA 3.0
2016-01-08T08:34:38.227Z
Alright, I'll have to take a closer look at that.
Kitsune Cavalry
CC BY-SA 3.0
2016-01-09T03:49:23.620Z
@Kitsune Cavalry The uniform distribution over the half line (or the whole line) is a well known improper prior in Bayesian statistics, see for a taste http://stats.stackexchange.com/a/97790/28746 or  http://stats.stackexchange.com/a/35794/28746
Alecos Papadopoulos
<microeconomics><expected-utility>
Envelope Paradox
Kitsune Cavalry
# Envelope Paradox

(Asked by: username_0 on 2016-01-08)

There are two envelopes. One contains $x$ money and the other contains $2x$ amount of money. The exact amount "$x$" is unknown to me, but I know the above. I pick one envelope and I open it. I see $y$ money in it, obviously where $y \in \{x, 2x\}$.

Now I am offered to keep or switch envelopes.

The expected value of switching is $(\frac{1}{2} \cdot 2y + \frac{1}{2} \cdot \frac{1}{2}y) = \frac{5}{4}y$.
The expected value of keeping my envelope is $y$.

It seems that I should always switch envelopes. My two questions:

> Is this reasoning correct?
>
> Is it any different if I am not allowed to open the envelope and see the $y$ amount of money, and then I am given the option to switch indefinitely?

**Tags:** microeconomics, expected-utility
> **Comments:**
> **username_1**: Related: https://en.wikipedia.org/wiki/Two_envelopes_problem  
> **username_2**: You cannot just take the expectation, you should start out with beliefs about x and update your beliefs according to Bayes' rule. Once you see y, your beliefs about which envelope you opened will have changed.  
> **username_0**: Say x is uniformly distributed between 0 and $\infty$. Then what?  
> **username_3**: @KitsuneCavalry There is no such disribution. (Please do send me a program generating such a distribution.) In fact there is no resolution which generates the pior beliefs given in your question for all values of $y$. In the link of Herr K. this is explained in https://en.wikipedia.org/wiki/Two_envelopes_problem#Simple_form_of_Bayesian_resolution  
> **username_0**: Alright, I'll have to take a closer look at that.  
> **username_4**: @Kitsune Cavalry The uniform distribution over the half line (or the whole line) is a well known improper prior in Bayesian statistics, see for a taste http://stats.stackexchange.com/a/97790/28746 or  http://stats.stackexchange.com/a/35794/28746  

---

## 4 answers

### Answer by username_4 on 2016-01-08. Score: 7 | Accepted answer

Here is an "expected utility maximization/ game theoretic" approach to the matter (with a dash of set-theoretic probability). In such a framework, the answers appear clear.

**PREMISES**

We are told in absolute honesty that, for $x$ a strictly positive monetary amount, the following two tickets were placed in a box : $\{A=x, B= 2x\}$ with assigned identification number $1$ and $\{A=2x, B= x\}$ with assigned identification number $0$. Then a draw from a Bernoulli $(p=0.5)$ random variable was executed, and based on the result and the event that has occurred, the amounts $x$ and $2x$ were placed in envelopes $A$ and $B$. We are not told what the value of $x$ is, or what amount went to which envelope.

**First CASE: Choose an envelope with the option to switch without opening it**

The first issue is *how do we choose an envelope*? This has to do with preferences. So *assume* that we are expected utility maximizers, with utility function $u()$.

We can model the probabilistic structure here by considering two dichotomous random variables, $A$ and $B$ representing the envelopes, and the amount in them. The support of each is $\{x, 2x\}$. But they are not independent. So we have to start with the joint distribution. In table form, the joint distribution, and the corresponding marginal distributions are

\begin{array}{| r | r | }
\hline
\text{A} \;/ \;\;\text{B} \rightarrow & x & 2x & \text {Marg A} \\
\hline
\hline
x & 0 & 0.5 & 0.5\\
\hline
2x & 0.5 & 0 & 0.5 \\
\hline
\text{Marg B} & 0.5 & 0.5 & 1.00 \\
\hline
\end{array}

This tells us that $A$ and $B$ have identical marginal distributions.

But this means that it doesn't matter how we choose envelopes, *because we will always get the same expected utility*,

$$0.5 \cdot u(x) + 0.5\cdot u(2x)$$

What we are facing here is a compound gamble (how to choose an envelope) over two identical gambles (each envelope). We can choose $A$ with probability $1$, $0$, or anything in-between (and complementarily for $B$). It doesn't matter. We will always get the same expected utility. Note that our attitude towards risk doesn't play a role here.

So we do choose an envelope, say $A$, and we are looking at it. What is now our expected utility? *Exactly the same as prior to choosing*. Picking an envelope in whatever way, does not affect the probabilities of what's inside.

We are allowed to switch. Say we do, and now we are holding envelope $B$. What is now are expected utility? *Exactly the same as before*.

These are the two possible states of the world for us: choose $A$ or choose $B$. Under any choice, both states of the world imply the same value to our chosen/assumed driving force (i.e. maximize expected utility).

**So here, we are indifferent to switching.**, and in fact we could also randomize.

**2nd CASE: OPENING THE ENVELOPE with the option to switch after**

Assume now that we have picked $A$, opened it, and found inside the amount $y \in \{x, 2x\}$. Does this change things?

Let's see. I wonder, what is

$$P(A = x \mid A \in \{x, 2x\}) = ?$$

Well, $\{x, 2x\}$ is the sample space on which random variable $A$ is defined. Conditioning on the whole sample space, i.e. on the trivial sigma-algebra, does not affect neither the probabilities, nor the expected values. It is as though we wonder "what is the value of $A$ if we know that all possible values may have been realized?" No effective knowledge has been gained, so we are still at the original probabilistic structure.

But I also wonder, what is

$$P(B = x \mid A \in \{x, 2x\}) = ?$$

The conditioning statement, properly viewed as a sigma-algebra generated by the event $\big \{A \in \{x, 2x\}\big\}$, is the whole product sample space on which the random vector $(A,B)$ has been defined. From the table of the joint distribution above, we can see that the probability allocation of the joint is equivalent a.s to the probability allocation of the marginals (the "almost surely" qualification due to the presence of two events of measure zero). So here too we essentially condition the probabilities for $B$ on its whole sample space. It follows that our action to open the envelope did not affect the probabilistic structure for $B$ also.

Enter game theory, alongside decision making. We have opened the envelope, and we have to decide whether we will switch or not. If we don't switch we get utility $u(y)$. If we switch, then we are in the following two possible states of the world

$$y = x, u(A) = u(x) \implies u(B) = u(2x)$$
$$y = 2x, u(A) = u(2x)\implies u(B) = u(x)$$

We do not know which state actually holds, but per the above discussion, we do know that each has probability $p=0.5$ of existing.

We can model this as a game where our opponent is "nature" *and where we know that nature plays with certainty a randomized strategy*: with $p=0.5$ $y=x$ and with $p=0.5$, $y=2x$. But we also now that if we do not switch, our payoff is certain. So here is our game in normal form, with our payoffs:

\begin{array}{| r | r | }
\hline
\text{We} \;/ \;\;\text{nature} \rightarrow &y= x & y=2x \\
\hline
\text{Switch} & u(2x) & u(x) \\
\hline
\text{Don't Switch} & u(y) & u(y) \\
\hline
\end{array}

We should resist the temptation to substitute $u(x)$ and $u(2x)$ for $u(y)$. $u(y)$ is a *known* and certain payoff. The payoffs for the "Switch" strategy are not actually known (since we do not know the value of $x$). So we *should reverse the substitution*. If $y=x$ then $u(2x) = u(2y)$, and if $y=2x$ then $u(x) = u(y/2)$. So here is our game again:

\begin{array}{| r | r | }
\hline
\text{We} \;/ \;\;\text{nature} \rightarrow &y= x & y=2x \\
\hline
\text{Switch} & u(2y) & u(y/2) \\
\hline
\text{Don't Switch} & u(y) & u(y) \\
\hline
\end{array}

Now all the payoffs in the matrix are known. Is there a pure dominant strategy?

The expected payoff of strategy "Switch" is

$$E(V\_S) = 0.5\cdot u(2y) + 0.5 \cdot u(y/2)$$

The expected payoff of strategy "Don't Switch" is

$$E(V\_{DS}) = u(y)$$

We should switch if

$$E(V\_S) > E(V\_{DS}) \implies 0.5\cdot u(2y) + 0.5 \cdot u(y/2) > u(y)$$

And *now*, attitude towards risk becomes critical. It is not difficult to deduce that **under risk-taking and risk neutral behavior, we should Switch.**

As regards **risk-averse behavior**, I find an elegant result:

For "less concave" (strictly above) utility functions than logarithmic (say, square root), then we should still Switch.

**For logarithmic utility $u(y) = \ln y$, we are indifferent between switching or not.**

For "more concave" than (strictly below) logarithmic utility functions, we should *not* Switch.

I close with the diagram of the logarithmic case

[![enter image description here](https://i.sstatic.net/CUfRW.png)](https://i.sstatic.net/CUfRW.png)

Assume $y=4$. Then $y/2 =2, 2y = 8$. The line $Γ-Δ-Ε$ is the line on which the expected utility from "Switch" will lie. Since nature plays a $50-50$ strategy, it will actually be at point $\Delta$, which is the middle point of $Γ-Δ-Ε$. At that point with logarithmic utility, we get exactly the same utility from "Don't Switch", i.e. $\ln(4)$ for this numerical example.

> **Comments:**
> **username_8**: Invoking "risk aversion" through a logarithmic utility function do not resolve the paradox.  As noted by @HRSE, using Bayes theorem, the probabilities that the payoffs are $u(2y)$ and $u(y/2$ are _not_ 0.5 after seeing the amount in the first envelope.  This would only hold for a highly questionable uniform improper prior on $x$ (for $x>0$).  If using a proper prior on $x$ (reflecting one's beliefs about $x$), the solution becomes to switch if $y$ is sufficiently small and to keep the first envelope if $y$ is sufficiently large. See https://www.jstor.org/stable/2685310.  
> **username_4**: @JarleTufto The way I see it, the uniform prior is the correct prior, if one decides to believe the organizers of the game, when they say that the money amounts were put in the envelops following a Bernoulli draw with $p=0.5$. If one wants to be suspicious, not believe the organizers and form some other prior belief, it is of course his right, but he would have to come with some argument to convince me as to a) why the organizers are lying and b) how does he chooses the different prior he chooses. Note that my answer presupposes that we believe the organizers on the matter.  
> **username_8**: I of course agree that you are given each envelope containing amounts $X$ and $2X$ respectively with equal probabilities of 1/2.  What I'm saying is that the implicit improper uniform prior on $X$ that you use, that is, $\pi(x) =1$, for all $x>0$ leads to the paradox because Bayes theorem then leads to $P(X=y|Y=y) = P(X=y/2|Y=y)=1/2$ where $y$ is the observed amount in the first envelope.   Using a proper prior $\pi(x)$ instead, these conditional probabilities differ and the optimal decision depends on $y$ (and of course the utility function).  
> **username_4**: @JarleTufto This improper prior you mention, it reflects probabilities related to what?  
> **username_8**: The amount of money in the two envelopes are $X$ and $2X$.  The prior probability distribution represents your beliefs about about $X$ before opening any envelope.  You're either implicitly using this particular prior or you're committing the fallacy of equating reverse conditional probabilities.  
> **username_4**: @JarleTufto Please help me a bit more here. When you write "represents beliefs about $X$" what do you mean? A probability allocation over what the value $X$ could be? Namely, something like "$X$ equals $10$ with probability $p_1$, equals $23$ with probability $p_2$, equals  $89$ with probability $p_3$ etc? Or you mean something completely different than that?  
> **username_8**: https://en.wikipedia.org/wiki/Bayesian_probability  
> **username_4**: @JarleTufto I know about Bayesian probability, this was not my question.  My question was _on what events/phenomena_ this prior is formed over. So I am asking again: is it over the values $X$ may take, or over something else?  
> **username_9**: @JarleTufto  Once the envelope has been opened, a prior on $x$ is not improper as it can only be binary.  A uniform prior is a two-point prior in this case.  Once $y$ is seen, which is data, the uniform prior over $x$ collapses to a binary posterior which in turn becomes the prior for the next round.  
> **username_9**: @AlecosPapadopoulos see my above post to Jarle Tufto.  
> **username_4**: @DaveHarris Thank you for contributing. It is my impression that the issue here is that Jarle Tufto presupposes the existence of a prior on whether the amount seen is the "large" or the "small" one, (and then analyses correctly or incorrectly) while the set up I use does not need, and does not invoke, the existence of such a prior. I recently posted a question on this methodological issue  over at CV, https://stats.stackexchange.com/q/326484/28746  
> **username_9**: @AlecosPapadopoulos actually an argument could be made that the problem does, in fact, have a prior built into it, but also that it is irrelevant to the solution.  For example, you know that the reward is positive.  Although you could impose an improper prior on $x$ such as $\Pr(X=x)\propto{1}$, an informed individual could add a proper prior without insult to the problem.  Again, it is irrelevant, but you could do it.  This is because you know that $x$ cannot be infinite and must be an element of the rationals as money is discrete.  
> **username_9**: @AlecosPapadopoulos you could produce a prior which is uniform over the range $(0,k]$ where $k$ is much larger than planetary output, and provide for a half normal from that point until infinity.  The issue isn't that there isn't a prior, the issue is that for any prior where $x$ is supported on the rational numbers, then the outcome is independent of the prior.  This is due to the nature of the problem as a binary likelihood.  
> **username_9**: @AlecosPapadopoulos finally, it is challenging to imagine this as a meaningful Bayesian problem because the parameters are known with certainty.  That is to say, there is a fifty-fifty chance that $X=x$.  The only parameter uncertainty is with regard to the identity of the envelope, which in Bayesian thinking would be a parameter.  

---

### Answer by username_5 on 2019-01-30. Score: 1

Generally the problem is unsolvable because you haven't specified the randomization procedure of the whole experiment.

But let Y be the value of the envelope you picked, and X the other envelope. The answer is then $E[X|Y=y]$ - which is a [*conditional expectation*](http://en.wikipedia.org/wiki/Conditional_expectation) . However, assuming a most general distribution of Y, Y is uniformly drawn from all of $\mathbb{R}$. But then $Pr(Y=y)=0$, and by the [*Borel–Kolmogorov*](http://en.wikipedia.org/wiki/Borel%E2%80%93Kolmogorov_paradox) paradox the expectation is unsolvable.

> **Comments:**
> **username_5**: @JeffJo, I couldn't comment under your post due to not having sufficient reputation. I added this answer because I believe it's related to your post.  

---

### Answer by username_6 on 2021-04-05. Score: 1

"Is this reasoning correct" No.

The reason why this reasoning is incorrect is that the expected value here depends on the probabilities that envelope 2 contains $2x$ or $x/2$. You have assumed that this is 50/50, but this cannot possibly be the case for all $x$.

To see this, suppose that you open envelope 1 and find \$10. You assume that envelope 2 might be as likely to contain \$5 as \$20. Alternately, suppose that you open envelope 1 and find \$20. You assume that envelope 2 might be as likely to contain \$10 as \$40. The implicit assumption here is that, before we open envelope 1, $x$ (and hence $2x$) might be just as likely to be *anything*. However, this is not possible, as a uniform distribution over $[0,\infty)$ is not a valid probability distribution. If you suppose that $x$ follows a valid probability distribution on $[0, \infty)$.... ANY valid probability distribution, then the numbers all work out, and the expected value of switching from envelope 1 to envelope 2 is 0.


---

### Answer by username_7 on 2016-04-01. Score: 0

If you open envelope **E1**, and see that its value is **E1=Y**, then it is true that the other envelope **E2**'s value is in **{E2=Y/2, E2=2Y}**.

It is also true that the expected value of that envelope is **(Y/2)\*Pr(E2=Y/2)+(2Y)\*Pr(E2=2Y)**.

The error is assuming that **Pr(E2=Y/2) = Pr(E2=2Y) = 1/2** regardless of what **Y** is. A simplistic way to show this, is to assume that each envelope contains US paper money of various denominations. If **Y=$1**, then it is impossible for **E2** to be **Y/2**.

A more rigorous proof is too detailed to provide here, but a summary of it is to first assume that, for any value **Z**, that **Pr(Z/2<=E2< Z)=Pr(Z<=E2<2Z)**. This is essentially the same assumption as in the last paragraph, expanded to a range of values. But if this is true for any value of **Z**, it means **Pr(Z\*2^(N-1)<=E2< Z\*2^(N-1))** is constant for every value of **N**, from -inf to inf. Since that is impossible, the assumption can't be correct.

+++++

That may have been a little confusing, so let me try an example. You are given two sets of two envelopes. In one set, they contain 10 and 20 dollars. In the other, they contain 20 and 40. You pick a set, and then open one envelope in that set to find 20. You are then offered the chance to switch to the other envelope in that set. Should you?

Yes, should switch. The expected gain by switching to the other envelope is [(20-10)+(20-40)]/2 = +5.

Note that this *instance* - that is, knowing that you found 20, and not 10 or 40, fits the conditions you describe in your question. So your solution works. But the experiment itself does not fit that description. If you had found 10, or if you had found 40, the probability other envelope has 20 is 100%. The expected gains are +10, and -20, respectively. And if you average the three possible gains over the probabilities you would get the three values, you get 10/4 + 5/2 - 20/4 = 0.

> **Comments:**
> **username_0**: Why would I assume an envelope could not have 50 cents in it? Also the question is specifically asking about times where you don't know the possible amounts that could be in it, just the possible relative amounts, so I'm not really following this.  
> **username_7**: I said it was a simplistic approach. It started with 'assume that each envelope contains US paper money.' Since you can't have 50 cents in US paper money, Pr(E2=$2|E1=$1)=1. The point is, that assuming Y/2 and 2Y are equally likely, when you don't know Y, is assuming a de facto distribution for Y that is impossible to achieve.  

---

