Thanks for offering that solution. It seems appropriate to me. I think that the issue at stake is related to the difference in programming language semantics between a probabilistic and nondeterministic semantics. Once you have decided on a nondeterministic semantics, you can’t simply start adding in probabilities and expect it to make sense. So, your solution suggests that we should have had grounded the entire problem in a probability distribution, whereas I was saying that, because we hadn’t done that, we couldn’t legitimately add probabilities into the picture at a later step. I wasn’t ruling out the possibility of a solution like yours, and it would indeed be interesting to know whether yours can be generalized in any way. In a prior draft of this post, I actually suggested that we could introduce a random variable before the envelope was chosen (although I hadn’t even attempted to work out the details). It was only for the sake of brevity that I omitted suggesting that idea.
My interest is more in the philosophy of language and how language can be deceptive — which is clearly happening in some way in statement of this problem — and what we can do to guard ourselves against that. What bothers me is that, even when I claimed to have spotted where where and how the false step occurred, nobody wanted to believe that I spotted it, or at least they they didn’t believe that it mattered. That’s rather disturbing to me because this problem involves a relatively simple use of language. And I think that humans are in a bit a trouble if we can’t even get on the same page about something this simple… because we’ve got very serious problems right now in regard to A.I. that are much more complicated and tricky than this to deal with than this one.
But I do like your solution, and I’m glad that it’s documented here if nowhere else.
And for anyone who reads this, I apologize if the tone of my post was off-putting. I deliberately chose a slightly provocative title simply to draw attention to this post. I don’t mind being corrected if I’m mistaken or have misspoken.
Take any probability distribution defined on the set of all values (x,y) where x and y are non-negative reals and y=2x. It can be discrete, continuous, or a mixture.
Let p(x) be the marginal distribution over x. This method of defining p avoids the distinction between choosing x and then doubling it, or choosing y and then halving it, or any other method of choosing (x,y) such that y=2x.
Assume that p has an expected value, denoted by E(p).
The expected value of switching when the amount in the first envelope is in the range [x−dx/2,x+dx/2] consists of two parts:
(i) The first envelope contains the smaller amount. This has probability p(x)dx/2+O(dx2). The division by 2 comes from the 50% chance of choosing the envelope with the smaller amount.
(ii) The first envelope contains the larger amount. This has probability p(x/2)dx/4+O(dx2). The extra factor of 2 comes from the fact that when the contents are in an interval of length dx, half of that (the amount chosen by the envelope-filler) is in an interval of length dx/2.
In the two cases the gain from switching is respectively x+O(dx) or −x/2+O(dx).
The expected gain given the contents is therefore xp(x)/2−(x/2)p(x/2)/4+O(dx).
Multiply this by dx, let dx tend to 0 (eliminating the term in O(dx2)) and integrate over the real line:
∫∞0(xp(x)/2−(x/2)p(x/2)/4)dx
=∫∞0xp(x)/2dx−∫∞0(x/2)p(x/2)/4dx
The first integral is E(p)/2. In the second, substitute y=x/2 (therefore dx=2dy), giving ∫∞0yp(y)/2dy=E(p)/2. The two integrals cancel.
Thanks for offering that solution. It seems appropriate to me. I think that the issue at stake is related to the difference in programming language semantics between a probabilistic and nondeterministic semantics. Once you have decided on a nondeterministic semantics, you can’t simply start adding in probabilities and expect it to make sense. So, your solution suggests that we should have had grounded the entire problem in a probability distribution, whereas I was saying that, because we hadn’t done that, we couldn’t legitimately add probabilities into the picture at a later step. I wasn’t ruling out the possibility of a solution like yours, and it would indeed be interesting to know whether yours can be generalized in any way. In a prior draft of this post, I actually suggested that we could introduce a random variable before the envelope was chosen (although I hadn’t even attempted to work out the details). It was only for the sake of brevity that I omitted suggesting that idea.
My interest is more in the philosophy of language and how language can be deceptive — which is clearly happening in some way in statement of this problem — and what we can do to guard ourselves against that. What bothers me is that, even when I claimed to have spotted where where and how the false step occurred, nobody wanted to believe that I spotted it, or at least they they didn’t believe that it mattered. That’s rather disturbing to me because this problem involves a relatively simple use of language. And I think that humans are in a bit a trouble if we can’t even get on the same page about something this simple… because we’ve got very serious problems right now in regard to A.I. that are much more complicated and tricky than this to deal with than this one.
But I do like your solution, and I’m glad that it’s documented here if nowhere else.
And for anyone who reads this, I apologize if the tone of my post was off-putting. I deliberately chose a slightly provocative title simply to draw attention to this post. I don’t mind being corrected if I’m mistaken or have misspoken.
Here’s the general calculation.
Take any probability distribution defined on the set of all values (x,y) where x and y are non-negative reals and y=2x. It can be discrete, continuous, or a mixture.
Let p(x) be the marginal distribution over x. This method of defining p avoids the distinction between choosing x and then doubling it, or choosing y and then halving it, or any other method of choosing (x,y) such that y=2x.
Assume that p has an expected value, denoted by E(p).
The expected value of switching when the amount in the first envelope is in the range [x−dx/2,x+dx/2] consists of two parts:
(i) The first envelope contains the smaller amount. This has probability p(x)dx/2+O(dx2). The division by 2 comes from the 50% chance of choosing the envelope with the smaller amount.
(ii) The first envelope contains the larger amount. This has probability p(x/2)dx/4+O(dx2). The extra factor of 2 comes from the fact that when the contents are in an interval of length dx, half of that (the amount chosen by the envelope-filler) is in an interval of length dx/2.
In the two cases the gain from switching is respectively x+O(dx) or −x/2+O(dx).
The expected gain given the contents is therefore xp(x)/2−(x/2)p(x/2)/4+O(dx).
Multiply this by dx, let dx tend to 0 (eliminating the term in O(dx2)) and integrate over the real line:
∫∞0(xp(x)/2−(x/2)p(x/2)/4)dx
=∫∞0xp(x)/2dx−∫∞0(x/2)p(x/2)/4dx
The first integral is E(p)/2. In the second, substitute y=x/2 (therefore dx=2dy), giving ∫∞0yp(y)/2dy=E(p)/2. The two integrals cancel.