2

I am trying to understand the resolution to the two envelope problem. While I am still working my way through it and so far the progress has been good I am stuck at a claim that one of the sources makes. The source is this

Problem:

A wealthy eccentric places two envelopes in front of you. She tells you that both envelopes contain money, and that one contains twice as much as the other, but she does not tell you which is which. You are allowed to choose one envelope, and to keep all the money you find inside. The paradox can be expressed numerically. Let A and B be the amounts in envelope 1 and 2 respectively; their expected values are $E(A)$ and $E(B)$. For all n, it seems that $p(B>A|A=n) = 0.5$, so that $E(B|A=n) = 1.25n$. It follows that $E(B)=1.25E(A)$, and therefore that $E(B) > E(A)$ if either expected value is greater than zero. The same reasoning shows that $E(A) > E(B)$, but the conjunction is impossible, and in any case $E(A) = E(B)$ by symmetry. Again, what has gone wrong?

The source then discusses the resolution provided in P. Castell and D. Batens, `The Two-Envelope Paradox: The Infinite Case'. Analysis 54:46-49. Let $g$ be the $pdf$ from which the two numbers in the two envelopes are sampled. Castell and D. Batens make their argument by first finding the $p(B>A|A=n)$ and they claim: $$p(B>A|A=n) = g(n)/(g(n) + g(n/2))$$

The source points to a fallacy in this

Excerpt:

Unfortunately Castell and Batens' proof is mistaken, and in fact there exist proper distributions for which the paradoxical reasoning is possible. The error lies in their assumption, early in the paper, that $p(B>A|A=n) = g(n)/(g(n) + g(n/2))$. This seems intuitively reasonable, but in fact $p(B>A|A=n) = 2g(n)/(2g(n) + g(n/2))$, which is significantly larger in general.To see this, note that if $A$ is in the range $n \pm dx$, then $B$ is either in the range $2n \pm 2dx$ or in the range $n/2 \pm dx/2$. The probability of the first, relative to the initial distribution, is $g(n)dx$; the probability of the second is $g(n/2)dx/2$. The probabilities that $B$ is greater or less than $A$ therefore stand in the ratio $2g(n):g(n/2)$, not $g(n):g(n/2)$, as Castell and Batens suppose.

The reasoning by Castell and D. Batens seems perfectly sound to me. The sampling process it occurs to me would be this (taking the simple case where $g = 1/10$ and numbers are sampled from: You sample a number ($A$) as per $g$ then sample second number ($B$) as per $g$. You keep only the cases where the $A$ was $4$ and that becomes your sample space. I see no reason why $B$ would be anything other 1/2 chance for being $2$ and 1/2 chance for being $8$.

Please help me understand what is wrong with the argument given by Castell and Batens and how is $p(B>A|A=n) = 2g(n)/(2g(n) + g(n/2))$

Ben
  • 91,027
  • 3
  • 150
  • 376
MiloMinderbinder
  • 1,622
  • 2
  • 15
  • 31

1 Answers1

1

I don't think your description of the sampling process matches what Chalmers has in mind. He says:

Let the relevant probability density function be g, where the probability that the smaller amount falls between a and b is integral[a,b] g(x) dx.

So the eccentric doesn't sample both $A$ and $B$ from $g$; instead they sample one envelope from $g$, then put twice that much money in the other envelope.

fblundun
  • 3,732
  • 1
  • 5
  • 18
  • But isnt it that even if we consider the first number being the only random variable. We would get (2,4) envelope equally as likely as (4,8) envelope. We could get $p(B>A|A=4) = 0.5 = g(4)/(g(4) + g(2)$ – MiloMinderbinder Jan 26 '21 at 14:46
  • A concrete example may help. Suppose the lower amount is sampled uniformly from the interval $[0, 1]$, so $g$ is $1$ on this interval. Try using Bayes' Theorem to calculate $P(B>A|A \in [0.3, 0.31])$. You should get two thirds rather than one half. – fblundun Jan 26 '21 at 16:54
  • It depends upon if i take $p(B>A|A ∈ [0.3,0.31])$ to be having the density $g$ or $g/2$. I think it should be $g/2$ but that would require dealing with infinity like in the case of Hilbert's grand hotel paradox. I tried to see this by coding it up. count = 0. t = 0. for i in range(1000000): x = np.random.uniform(); if (x>0.31) or (x<0.3): continue; t+=1; y = 2*x; A,B = np.random.choice([x,y],size=[2],replace=False); count+=int(B>A); p = count/t; I get p = 0.5. Can you help me understand a bit more? – MiloMinderbinder Jan 27 '21 at 09:34
  • The `continue` statement in your code is in the wrong place. Instead of generating x and discarding the sample when x doesn't fall in the interval, you should generate x, pick either x or 2x at random, and discard the sample when the chosen number doesn't fall in the interval. – fblundun Jan 27 '21 at 09:55
  • Thank you for your help, sir. And sorry I couldn't reply on time. I was travelling. With the changes you mention it indeed renders that P(B>A|A∈[0.3,0.31]) is 2/3. However, I cannot see what is wrong with the way I am sampling. I have revised my code for clarity: A = np.random.randint(2,11, size=1000000); B = np.random.randint(2,11, size=1000000); flag1 = np.isin((A/B),[0.5,2]); flag2 = A == 4; flag = np.logical_and(flag1,flag2); a = A[flag]; b = B[flag]; print(pd.Series(b).value_counts()); This way i get P(B>A|A∈[0.3,0.31]) as 0.5. Can you please help me understand this more? – MiloMinderbinder Jan 30 '21 at 03:42
  • Your code repeatedly samples 2 random numbers from g until it finds a pair where one is twice the other. Instead, it should take 1 sample from g, then use that number and twice that number. To see that these are different, note that using the correct procedure it is possible for an envelope to contain a value at which g is 0, such as 1.5 in my example. – fblundun Jan 30 '21 at 16:13
  • Note also that Chalmers is talking about a probability density function, implying that the distribution of the smaller amount is continuous. If the distribution of the smaller amount is instead discrete then the Castell and Batens formula works. – fblundun Jan 30 '21 at 17:54