Two envelope paradox, instead with amounts distributed uniformly. There are two envelopes, each of which has a check for a Unif(0, 1) amount of money, measured
in thousands of dollars. The amounts in the two envelopes are independent. You get to
choose an envelope and open it, and then you can either keep that amount or switch to the
other envelope and get whatever amount is in that envelope. Suppose that you use the following
strategy: choose an envelope and open it. If you observe U, then stick with that envelope with
probability U, and switch to the other envelope with probability 1 − U.
(a) Find the probability that you get the larger of the two amounts.
(b) Find the expected value of what you will receive.
 A: Since the amounts in the envelopes are independent, the amount $U_2$ in the second envelope has distribution uniform(0,1).  This is less than $u \in [0,1]$ with $u$, and less with probability $1-u$.  Given that the amount in the first envelope is $u_1$,  you will get the larger amount if either


*

*you switch (which happens with probability $1 - u_1$) and $U_2 > u_1$, or

*you don't switch (which happens with probability $u_1$) and $U_2 < u_1$.


Thus the conditional probability that you get the larger amount, given $U_1 = u_1$, is
$$ P(L | U_1 = u_1) = (1-u_1)^2 + u_1^2 = 1 - 2 u_1 + 2 u_1^2$$
and the unconditional probability is
$$ P(L) = \mathbb E[P(L | U_1)] = 1 - 2 \mathbb E[U_1] + 2 \mathbb E[U_1^2] = 2/3$$
Similarly, the conditional expectation of the amount $Y$ you receive, given $U_1 = u_1$, is
$$ \mathbb E[V |U_1 = u_1] = (1-u_1)(1/2) + u_1 (u_1) = 1/2 - u_1/2 + u_1^2$$
and $$\mathbb E[V] = \mathbb E[\mathbb E[V|U_1]] = 1/2 - \mathbb E[U_1]/2 + \mathbb E[U_1^2] = 7/12 $$
A: Let $U$ denote the amount of money in the firstly chosen envelop that is opened and $V$ the amount of money in the non-chosen envelop. Then $1_{\left(0,1\right)^{2}}(u,v)$ is the PDF of $\left(U,V\right)$.
(a) 
If $E$ denotes the event that the larger amount of money will eventually
be received then:
$P\left(E\mid U=u,V=v\right)$ takes value $u$ if $u>v$ and takes value $1-u$ otherwise. So:
$$P\left(E\right)=\int_{0}^{1}\int_{0}^{1}P\left(E\mid U=u,V=v\right)dvdu=\int_{0}^{1}\int_{0}^{u}udvdu+\int_{0}^{1}\int_{u}^{1}\left(1-u\right)dvdu$$$$=\int_{0}^{1}u^{2}du+\int_{0}^{1}\left(1-u\right)^{2}du=\frac{1}{3}+\frac{1}{3}=\frac{2}{3}$$

(b)
If $R\left(U,V\right)$ denotes what is received then $R\left(U,V\right)=U.U+\left(1-U\right).V=U^{2}+V-UV$
So:
$$\mathbb{E}R\left(U,V\right)=\mathbb{E}\left(U^{2}+V-UV\right)=\mathbb{E}U^{2}+\mathbb{E}V-\mathbb{E}U\mathbb{E}V=\frac{1}{3}+\frac{1}{2}-\frac{1}{2}\frac{1}{2}=\frac{7}{12}$$
