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))$