A friend of mine came to me with the two envelopes problem, I hadn't heard of this problem before and it goes like this: someone puts an amount `x' in an envelope and an amount `2x' in another. You choose one envelope randomly, you open it, and there are inside, say ?10. Now, should you keep the ?10 or swap envelopes and keep whatever is inside the other envelope? I told my friend that swapping is irrelevant since your expected earnings are 1.5x whether you swap or not. He said that you should swap, since if you have ?10 in your hands, then there's a 50% chance of the other envelope having ?20 and 5% chance of it having ?5, so your expected earnings are ?12.5 which is more than ?10 justifying the swap. I told my friend that he was talking non-sense. I then proceeded to write a simple R script (below) to simulate random money in the envelopes and it convinced me that the expected earnings are simply 1.5 * E(x) where E(x) is the expected value of x, a random variable whose distribution can be set arbitrarily. I later found out that this is quite an old and well understood problem, so I got back to my friend to explain to him why he was wrong, and then he insisted that in the definition of the problem he specifically said that you happened to have ?10 and no other values, so is still better to swap. I thought that it would be simply to prove in my simulation that from those instances in which ?10 happened to be the value seen in the first envelope, then the expected value in the second envelope would still be ?10. I run the simulation and surprisingly, I'm getting a very slight edge when I swap, contrary to my intuition. I think something in my code might be wrong. I have attached it below for whoever wants to play with it. I'd be grateful for any feedback. # Envelopes simulation: # # There are two envelopes, one has certain amount of money `x', and the other an # amount `r*x', where `r' is a positive constant (usaully r=2 or r=0.5). You are # allowed to choose one of the envelopes and open it. After you know the amount # of money inside the envelope you are given two options: keep the money from # the current envelope or switch envelopes and keep the money from the second # envelope. What's the best strategy? To switch or not to switch? # # Naive explanation: imagine r=2, then you should switch since there is a 50% # chance for the other envelope having 2x and 50% of it having x/2, then your # expected earnings are E = 0.5*2x + 0.5x/2 = 1.25x, since 1.25x > x you # should switch! But, is this explanation right? # # August 2008, Mario dos Reis # Function to generate the envelopes and their money # r: constant, so that x is the amount of money in one envelop and r*x is the # amount of money in the second envelope # rdist: a random distribution for the amount x # n: number of envelope pairs to generate # ...: additional parameters for the random distribution # The function returns a 2xn matrix containing the (randomized) pairs # of envelopes generateenv <- function (r, rdist, n, ...) { env <- matrix(0, ncol=2, nrow=n) env[,1] <- rdist(n, ...) # first envelope has `x' env[,2] <- r*env[,1] # second envelope has `r*x' # randomize de envelopes, so we don't know which one from # the pair has `x' or `r*x' i <- as.logical(rbinom(n, 1, 0.5)) renv <- env renv[i,1] <- env[i,2] renv[i,2] <- env[i,1] return(renv) # return the randomized envelopes } # example, `x' follows an exponential distribution with E(x) = 10 # we do one million simulations n=1e6) env <- generateenv(r=2, rexp, n=1e6, rate=1/10) mean(env[,1]) # you keep the randomly assigned first envelope mean(env[,2]) # you always switch and keep the second # example, `x' follows a gamma distributin, r=0.5 env <- generateenv(r=.5, rgamma, n=1e6, shape=1, rate=1/20) mean(env[,1]) # you keep the randomly assigned first envelope mean(env[,2]) # you always switch and keep the second # example, a positive 'normal' distribution # First write your won function: rposnorm <- function (n, ...) { return(abs(rnorm(n, ...))) } env <- generateenv(r=2, rposnorm, n=1e6, mean=20, sd=10) mean(env[,1]) # you keep the randomly assigned first envelope mean(env[,2]) # you always switch and keep the second # example, exponential approximated as an integer rintexp <- function(n, ...) return (ceiling(rexp(n, ...))) # we use ceiling as we don't want zeroes env <- generateenv(r=2, rintexp, n=1e6, rate=1/10) mean(env[,1]) # you keep the randomly assigned first envelope mean(env[,2]) # you always switch and keep the second i10 <- which(env[,1]==10) mean(env[i10,1]) # Exactly 10 mean(env[i10,2]) # ~ 10.58 - 10.69 after several trials
i haven't looked at your code and I'll try when I have time but, as you stated, that's an EXTREMELY famous problem that has tried to be posed in a bayesian way and all sorts of other things have been done to try solve it. Note that if you change the utility function so that its log(X) rather than X then it is seen that the expected values are the same and you don't get the 1.5X versus X weirdness. When someone showed me that, I gave up and just walked away from it by telling myself that it has something to do with utility and percentage weirdness , sort of like when something in the store is marked down 50% and then up 50% but it doesn't get back to the original price. ( that's not right but we spent like a month talking about the problem and I got sick of it ). Also, some have argued that the sample space is ill stated because once you see X, that doesn't tell you about the chances of other X because of the infinite sample space and that's not realistic. At the time, I looked around a lot but couldn't find better answers than those. You're brining back bad memories !!!!! On Mon, Aug 25, 2008 at 3:40 PM, Mario wrote:> A friend of mine came to me with the two envelopes problem, I hadn't > heard of this problem before and it goes like this: someone puts an > amount `x' in an envelope and an amount `2x' in another. You choose > one envelope randomly, you open it, and there are inside, say ?10. > Now, should you keep the ?10 or swap envelopes and keep whatever is > inside the other envelope? I told my friend that swapping is > irrelevant since your expected earnings are 1.5x whether you swap or > not. He said that you should swap, since if you have ?10 in your > hands, then there's a 50% chance of the other envelope having ?20 and > 5% chance of it having ?5, so your expected earnings are ?12.5 which > is more than ?10 justifying the swap. I told my friend that he was > talking non-sense. I then proceeded to write a simple R script (below) > to simulate random money in the envelopes and it convinced me that the > expected earnings are simply 1.5 * E(x) where E(x) is the expected > value of x, a random variable whose distribution can be set > arbitrarily. I later found out that this is quite an old and well > understood problem, so I got back to my friend to explain to him why > he was wrong, and then he insisted that in the definition of the > problem he specifically said that you happened to have ?10 and no > other values, so is still better to swap. I thought that it would be > simply to prove in my simulation that from those instances in which > ?10 happened to be the value seen in the first envelope, then the > expected value in the second envelope would still be ?10. I run the > simulation and surprisingly, I'm getting a very slight edge when I > swap, contrary to my intuition. I think something in my code might be > wrong. I have attached it below for whoever wants to play with it. I'd > be grateful for any feedback. > > # Envelopes simulation: > # > # There are two envelopes, one has certain amount of money `x', and > the other an > # amount `r*x', where `r' is a positive constant (usaully r=2 or > r=0.5). You are > # allowed to choose one of the envelopes and open it. After you know > the amount > # of money inside the envelope you are given two options: keep the > money from > # the current envelope or switch envelopes and keep the money from the > second > # envelope. What's the best strategy? To switch or not to switch? > # > # Naive explanation: imagine r=2, then you should switch since there > is a 50% > # chance for the other envelope having 2x and 50% of it having x/2, > then your > # expected earnings are E = 0.5*2x + 0.5x/2 = 1.25x, since 1.25x > x > you > # should switch! But, is this explanation right? > # > # August 2008, Mario dos Reis > > # Function to generate the envelopes and their money > # r: constant, so that x is the amount of money in one envelop and r*x > is the > # amount of money in the second envelope > # rdist: a random distribution for the amount x > # n: number of envelope pairs to generate > # ...: additional parameters for the random distribution > # The function returns a 2xn matrix containing the (randomized) pairs > # of envelopes > generateenv <- function (r, rdist, n, ...) > { > env <- matrix(0, ncol=2, nrow=n) > env[,1] <- rdist(n, ...) # first envelope has `x' > env[,2] <- r*env[,1] # second envelope has `r*x' > > # randomize de envelopes, so we don't know which one from > # the pair has `x' or `r*x' > i <- as.logical(rbinom(n, 1, 0.5)) > renv <- env > renv[i,1] <- env[i,2] > renv[i,2] <- env[i,1] > > return(renv) # return the randomized envelopes > } > > # example, `x' follows an exponential distribution with E(x) = 10 > # we do one million simulations n=1e6) > env <- generateenv(r=2, rexp, n=1e6, rate=1/10) > mean(env[,1]) # you keep the randomly assigned first envelope > mean(env[,2]) # you always switch and keep the second > > # example, `x' follows a gamma distributin, r=0.5 > env <- generateenv(r=.5, rgamma, n=1e6, shape=1, rate=1/20) > mean(env[,1]) # you keep the randomly assigned first envelope > mean(env[,2]) # you always switch and keep the second > > # example, a positive 'normal' distribution > # First write your won function: > rposnorm <- function (n, ...) > { > return(abs(rnorm(n, ...))) > } > env <- generateenv(r=2, rposnorm, n=1e6, mean=20, sd=10) > mean(env[,1]) # you keep the randomly assigned first envelope > mean(env[,2]) # you always switch and keep the second > > # example, exponential approximated as an integer > rintexp <- function(n, ...) return (ceiling(rexp(n, ...))) # we use > ceiling as we don't want zeroes > env <- generateenv(r=2, rintexp, n=1e6, rate=1/10) > mean(env[,1]) # you keep the randomly assigned first envelope > mean(env[,2]) # you always switch and keep the second > i10 <- which(env[,1]==10) > mean(env[i10,1]) # Exactly 10 > mean(env[i10,2]) # ~ 10.58 - 10.69 after several trials > > ______________________________________________ > R-help at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide > http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code.
You are simulating the answer to a different question. Once you know that one envelope contains 10, then you know conditional on that information that either x=10 and the other envelope holds 20, or 2*x=10 and the other envelope holds 5. With no additional information and assuming random choice we can say that there is a 50% chance of each of those. A simple simulation (or the math) shows:> tmp <- sample( c(5,20), 100000, replace=TRUE ) > mean(tmp)[1] 12.5123 Which is pretty close to the math answer of 12.5. If you have additional information (you believe it unlikely that there would be 20 in one of the envelopes, the envelope you opened has 15 in it and the other envelope can't have 7.5 (because you know there are no coins and there is no such thing as a .5 bill in the local currency), etc.) then that will change the probabilities, but the puzzle says you have no additional information. Your friend is correct in that switching is the better strategy. Another similar puzzle that a lot of people get confused over is: "I have 2 children, one of them is a girl, what is the probability that the other is also a girl?" Or even the classic Monty Hall problem (which has many answers depending on the motivation of Monty). Hope this helps, (p.s., the above children puzzle is how I heard the puzzle, I actually have 4 children (but the 1st 2 are girls, so it was accurate for me for a while). -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare greg.snow at imail.org (801) 408-8111> -----Original Message----- > From: r-help-bounces at r-project.org > [mailto:r-help-bounces at r-project.org] On Behalf Of Mario > Sent: Monday, August 25, 2008 1:41 PM > To: r-help at r-project.org > Subject: [R] Two envelopes problem > > A friend of mine came to me with the two envelopes problem, I > hadn't heard of this problem before and it goes like this: > someone puts an amount `x' in an envelope and an amount `2x' > in another. You choose one envelope randomly, you open it, > and there are inside, say ?10. Now, should you keep the ?10 > or swap envelopes and keep whatever is inside the other > envelope? I told my friend that swapping is irrelevant since > your expected earnings are 1.5x whether you swap or not. He > said that you should swap, since if you have ?10 in your > hands, then there's a 50% chance of the other envelope having > ?20 and 5% chance of it having ?5, so your expected earnings > are ?12.5 which is more than ?10 justifying the swap. I told > my friend that he was talking non-sense. I then proceeded to > write a simple R script (below) to simulate random money in > the envelopes and it convinced me that the expected earnings > are simply > 1.5 * E(x) where E(x) is the expected value of x, a random > variable whose distribution can be set arbitrarily. I later > found out that this is quite an old and well understood > problem, so I got back to my friend to explain to him why he > was wrong, and then he insisted that in the definition of the > problem he specifically said that you happened to have ?10 > and no other values, so is still better to swap. I thought > that it would be simply to prove in my simulation that from > those instances in which ?10 happened to be the value seen in > the first envelope, then the expected value in the second > envelope would still be ?10. I run the simulation and > surprisingly, I'm getting a very slight edge when I swap, > contrary to my intuition. I think something in my code might > be wrong. I have attached it below for whoever wants to play > with it. I'd be grateful for any feedback. > > # Envelopes simulation: > # > # There are two envelopes, one has certain amount of money > `x', and the other an # amount `r*x', where `r' is a positive > constant (usaully r=2 or r=0.5). > You are > # allowed to choose one of the envelopes and open it. After > you know the amount # of money inside the envelope you are > given two options: keep the money from # the current envelope > or switch envelopes and keep the money from the second # > envelope. What's the best strategy? To switch or not to switch? > # > # Naive explanation: imagine r=2, then you should switch > since there is a 50% # chance for the other envelope having > 2x and 50% of it having x/2, then your # expected earnings > are E = 0.5*2x + 0.5x/2 = 1.25x, since 1.25x > x you # should > switch! But, is this explanation right? > # > # August 2008, Mario dos Reis > > # Function to generate the envelopes and their money # r: > constant, so that x is the amount of money in one envelop and > r*x is the > # amount of money in the second envelope > # rdist: a random distribution for the amount x # n: number > of envelope pairs to generate # ...: additional parameters > for the random distribution # The function returns a 2xn > matrix containing the (randomized) pairs # of envelopes > generateenv <- function (r, rdist, n, ...) { > env <- matrix(0, ncol=2, nrow=n) > env[,1] <- rdist(n, ...) # first envelope has `x' > env[,2] <- r*env[,1] # second envelope has `r*x' > > # randomize de envelopes, so we don't know which one from > # the pair has `x' or `r*x' > i <- as.logical(rbinom(n, 1, 0.5)) > renv <- env > renv[i,1] <- env[i,2] > renv[i,2] <- env[i,1] > > return(renv) # return the randomized envelopes } > > # example, `x' follows an exponential distribution with E(x) > = 10 # we do one million simulations n=1e6) env <- > generateenv(r=2, rexp, n=1e6, rate=1/10) > mean(env[,1]) # you keep the randomly assigned first envelope > mean(env[,2]) # you always switch and keep the second > > # example, `x' follows a gamma distributin, r=0.5 env <- > generateenv(r=.5, rgamma, n=1e6, shape=1, rate=1/20) > mean(env[,1]) # you keep the randomly assigned first envelope > mean(env[,2]) # you always switch and keep the second > > # example, a positive 'normal' distribution # First write > your won function: > rposnorm <- function (n, ...) > { > return(abs(rnorm(n, ...))) > } > env <- generateenv(r=2, rposnorm, n=1e6, mean=20, sd=10) > mean(env[,1]) # you keep the randomly assigned first envelope > mean(env[,2]) # you always switch and keep the second > > # example, exponential approximated as an integer rintexp <- > function(n, ...) return (ceiling(rexp(n, ...))) # we use > ceiling as we don't want zeroes env <- generateenv(r=2, > rintexp, n=1e6, rate=1/10) > mean(env[,1]) # you keep the randomly assigned first envelope > mean(env[,2]) # you always switch and keep the second i10 <- > which(env[,1]==10) > mean(env[i10,1]) # Exactly 10 > mean(env[i10,2]) # ~ 10.58 - 10.69 after several trials > > ______________________________________________ > R-help at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide > http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. >
Hi again, Oops, I meant the expected value of the swap is: 5*0.5 + 20*0.5 = 12.5 Too late, must get to bed. Jim
On 26/08/2008 7:54 AM, Jim Lemon wrote:> Hi again, > Oops, I meant the expected value of the swap is: > > 5*0.5 + 20*0.5 = 12.5 > > Too late, must get to bed.But that is still wrong. You want a conditional expectation, conditional on the observed value (10 in this case). The answer depends on the distribution of the amount X, where the envelopes contain X and 2X. For example, if you knew that X was at most 5, you would know you had just observed 2X, and switching would be a bad idea. The paradox arises because people want to put a nonsensical Unif(0, infinity) distribution on X. The Wikipedia article points out that it can also arise in cases where the distribution on X has infinite mean: a mathematically valid but still nonsensical possibility. Duncan Murdoch
Duncan: Just one more thing which Heinz alerted me to. Suppose that we changed the game so that instead of being double or half of X, we said that one envelope will contain X + 5 and the other contains X-5. So someone opens it and sees 10 dollars. Now, their remaining choices are 5 and 15 so the expectation of switching is the same = 10. So, in this case, we don't know the distribution of X and yet the game is fair. This is why , although I like your example, I still think the issue has something to do with percentages versus additions. In finance, the cumulative return is ( in non continuous time ) over some horizon is a productive of the individual returns over whatever intervals you want to break the horizon into. In order to make things nicer statistically ( and for other reasons too like making the assumption of normaility somkewhat more plausible ) , finance people take the log of this product in order to to transform the cumulative return into an additive measure. So, I think there's still something going on with units as far as adding versus multiplying ? but I'm not sure what and I do still see what you're saying in your example. Thanks. Mark On Tue, Aug 26, 2008 at 11:44 AM, Mark Leeds wrote:> Hi Duncan: I think I get you. Once one takes expectations, there is an > underlying assumption about the distribution of X and , in this > problem, we > don't have one so taking expectations has no meaning. > > If the log utility "fixing" the problem is purely just a coincidence, > then > it's surely an odd one because log(utility) is often used in economics > for > expressing how investors view the notion of accumulating capital > versus the > risk of losing it. I'm not a economist but it's common for them to > use log utility to prove theorems about optimal consumption etc. > Thanks because I think I see it now by your example below. > > Mark > > > > > > -----Original Message----- > From: Duncan Murdoch [mailto:murdoch at stats.uwo.ca] Sent: Tuesday, > August 26, 2008 11:26 AM > To: Mark Leeds > Cc: r-help at r-project.org > Subject: Re: [R] Two envelopes problem > > On 8/26/2008 9:51 AM, Mark Leeds wrote: >> Duncan: I think I see what you're saying but the strange thing is >> that if >> you use the utility function log(x) rather than x, then the expected > values >> are equal. > > > I think that's more or less a coincidence. If I tell you that the two > envelopes contain X and 2X, and I also tell you that X is 1,2,3,4, or > 5, and you open one and observe 10, then you know that X=5 is the > content of the other envelope. The expected utility of switching is > negative using any increasing utility function. > > On the other hand, if we know X is one of 6,7,8,9,10, and you observe > a 10, then you know that you got X, so the other envelope contains 2X > = 20, and the expected utility is positive. > > As Heinz says, the problem does not give enough information to come to > a decision. The decision *must* depend on the assumed distribution of > X, and the problem statement gives no basis for choosing one. There > are probably some subjective Bayesians who would assume a particular > default prior in a situation like that, but I wouldn't. > > Duncan Murdoch > > Somehow, if you are correct and I think you are, then taking the >> log , "fixes" the distribution of x which is kind of odd to me. I'm >> sorry > to >> belabor this non R related discussion and I won't say anything more >> about > it >> but I worked/talked on this with someone for about a month a few >> years > ago >> and we gave up so it's interesting for me to see this again. >> >> Mark >> >> -----Original Message----- >> From: r-help-bounces at r-project.org >> [mailto:r-help-bounces at r-project.org] > On >> Behalf Of Duncan Murdoch >> Sent: Tuesday, August 26, 2008 8:15 AM >> To: Jim Lemon >> Cc: r-help at r-project.org; Mario >> Subject: Re: [R] Two envelopes problem >> >> On 26/08/2008 7:54 AM, Jim Lemon wrote: >>> Hi again, >>> Oops, I meant the expected value of the swap is: >>> >>> 5*0.5 + 20*0.5 = 12.5 >>> >>> Too late, must get to bed. >> >> But that is still wrong. You want a conditional expectation, >> conditional on the observed value (10 in this case). The answer >> depends on the distribution of the amount X, where the envelopes >> contain X and 2X. For example, if you knew that X was at most 5, you >> would know you had just observed 2X, and switching would be a bad >> idea. >> >> The paradox arises because people want to put a nonsensical Unif(0, >> infinity) distribution on X. The Wikipedia article points out that >> it can also arise in cases where the distribution on X has infinite >> mean: a mathematically valid but still nonsensical possibility. >> >> Duncan Murdoch >> >> ______________________________________________ >> R-help at r-project.org mailing list >> https://stat.ethz.ch/mailman/listinfo/r-help >> PLEASE do read the posting guide > http://www.R-project.org/posting-guide.html >> and provide commented, minimal, self-contained, reproducible code. > > ______________________________________________ > R-help at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide > http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code.
So if I put $10 and $20 into the envelopes, then told you that the values were multiples of $10, it would be wrong for you to assess probabilities on $100, $1,000,000 and so on? :-) But what if you reasoned that there were far more multiples of 10 above 20 than below 20? What if I was really evil and the multiples of 10 that I always put in the envelopes were 0x$10 and 0x$10. When you opened an empty envelope, what are the odds the other has $1,000,000? What are the odds it has $10? It seems the information given can be misleading. Robert Farley Metro www.Metro.net -----Original Message----- From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org] On Behalf Of Duncan Murdoch Sent: Tuesday, August 26, 2008 05:15 To: Jim Lemon Cc: r-help at r-project.org; Mario Subject: Re: [R] Two envelopes problem On 26/08/2008 7:54 AM, Jim Lemon wrote:> Hi again, > Oops, I meant the expected value of the swap is: > > 5*0.5 + 20*0.5 = 12.5 > > Too late, must get to bed.But that is still wrong. You want a conditional expectation, conditional on the observed value (10 in this case). The answer depends on the distribution of the amount X, where the envelopes contain X and 2X. For example, if you knew that X was at most 5, you would know you had just observed 2X, and switching would be a bad idea. The paradox arises because people want to put a nonsensical Unif(0, infinity) distribution on X. The Wikipedia article points out that it can also arise in cases where the distribution on X has infinite mean: a mathematically valid but still nonsensical possibility. Duncan Murdoch ______________________________________________ R-help at r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
>>> Duncan Murdoch <murdoch at stats.uwo.ca> 26/08/2008 16:17:34 >>> >>If this is indeed the case, switch; the expected gain is >>positive because _you already have the information that you hold the >> median value of the three possibilities_. The tendency whenpresented> >with the problem is to reason as if this is the case.>No, you don't know that A is the median. That doesn't even makesense,>based on the context of the question: there is no 3-valued random >variable here.This is my point; apologies if I put it badly. The fact is that you _don't_ hold the median value and that this is indeed a silly way of looking at it. My assertion was that this is the way many folk DO look at it, and that this results in an apparent paradox. In fact, you inadvertently gave an example when you said>The unopened envelope can hold only two values, given >that yours contains A.True - for a rather restricted meaning of 'true'. As written, it implicitly allows three values; A for the envelope you hold, and two more (2A and 0.5A) for the alternatives you permit. The usual (and incorrect) expected gain calculation uses all three; 2A-A for one choice and 0.5-A for the other. To do that at all, we must be playing with three possible values for the contents of an envelope. This clearly cannot be the case if there are only two possible values, as we are told in posing the problem. The situation is that you hold _either_ A _or_ 2A and the other envelope holds (respectively) 2A or A. We just don't know what A is until we open both envelopes. So for a given pair of envelopes, it is the choice of coefficient (1 or 2) that is random. If I were to describe this in terms of a random variable I would have to assume an unknown but - for this run - fixed value A multiplied by a two-valued random variable with possible values 1 and 2, would I not? We surely can't have both 0.5 and 2 in our distribution at the same time, because the original proposition said there were only two possibilities and they differ by a factor of 2, not 4.>You have no basis for putting a probability distribution on those >values, because you don't know the distribution of X.But we do know; or at least we know the distribution of the coefficient. We have two envelopes of which one is selected at random, and the ratio of values is 2. On that basis, assigning a 50:50 probability of ending up with A or 2A on first selection seems uncontroversial. But I'm more than willing to have my intuition corrected - possibly off-line, of course, since this stopped being R a while back! Steve E ******************************************************************* This email and any attachments are confidential. Any use...{{dropped:8}}
beautiful. now, i think i got it. the fact that the calculation works in the additive case doesn't make the calculation correct. the expected value calculation is kind of assuming that the person putting the things in the envelopes chooses what's in the second envelope AFTER knowing what's already in the other one. But, if he/she does know and still chooses half or double with 50/50 chance, then one can't use the original wealth as the reference point/ initial expected value because the envelope chooser isn't using it. I think it's best for me to think about it like that but your example is good to fall back on when I get confused again 2 years from now. Thank you very much for your patience and explanation. On Tue, Aug 26, 2008 at 2:06 PM, Duncan Murdoch wrote:> On 8/26/2008 1:12 PM, markleeds at verizon.net wrote: >> Duncan: Just one more thing which Heinz alerted me to. Suppose that >> we changed the game so that instead of being double or half of X, >> we said that one envelope will contain X + 5 and the other contains >> X-5. So someone opens it and sees 10 dollars. Now, their remaining >> choices >> are 5 and 15 so the expectation of switching is the same = 10. So, >> in this case, we don't know the distribution of X and yet the game is >> fair. > > No, you can't do that calculation without knowing the distribution. > Take my first example again: if X is known in advance to be 1,2,3,4, > or 5, then an observation of 10 must be X+5, so you'd expect 0 in the > other envelope. The conditional expectation depends on the full > distribution, and if you aren't willing to state that, you can't do > the calculation properly. > > Duncan Murdoch > > > >> This is >> why , although I like your example, I still think the issue has >> something to do with percentages versus additions. >> >> In finance, the cumulative return is ( in non continuous time ) over >> some horizon is a productive of the individual returns over whatever >> intervals >> you want to break the horizon into. In order to make things nicer >> statistically ( and for other reasons too like making the assumption >> of normaility somkewhat more plausible ) , finance people take the >> log of this product in order to to transform the cumulative return >> into an additive measure. >> So, I think there's still something going on with units as far as >> adding versus multiplying ? but I'm not sure what and I do still see >> what you're saying in >> your example. Thanks. >> >> Mark >> >> >> >> On Tue, Aug 26, 2008 at 11:44 AM, Mark Leeds wrote: >> >>> Hi Duncan: I think I get you. Once one takes expectations, there is >>> an >>> underlying assumption about the distribution of X and , in this >>> problem, we >>> don't have one so taking expectations has no meaning. >>> >>> If the log utility "fixing" the problem is purely just a >>> coincidence, then >>> it's surely an odd one because log(utility) is often used in >>> economics for >>> expressing how investors view the notion of accumulating capital >>> versus the >>> risk of losing it. I'm not a economist but it's common for them to >>> use log utility to prove theorems about optimal consumption etc. >>> Thanks because I think I see it now by your example below. >>> >>> Mark >>> >>> >>> >>> >>> >>> -----Original Message----- >>> From: Duncan Murdoch [mailto:murdoch at stats.uwo.ca] Sent: Tuesday, >>> August 26, 2008 11:26 AM >>> To: Mark Leeds >>> Cc: r-help at r-project.org >>> Subject: Re: [R] Two envelopes problem >>> >>> On 8/26/2008 9:51 AM, Mark Leeds wrote: >>>> Duncan: I think I see what you're saying but the strange thing is >>>> that if >>>> you use the utility function log(x) rather than x, then the >>>> expected >>> values >>>> are equal. >>> >>> >>> I think that's more or less a coincidence. If I tell you that the >>> two envelopes contain X and 2X, and I also tell you that X is >>> 1,2,3,4, or 5, and you open one and observe 10, then you know that >>> X=5 is the content of the other envelope. The expected utility of >>> switching is negative using any increasing utility function. >>> >>> On the other hand, if we know X is one of 6,7,8,9,10, and you >>> observe a 10, then you know that you got X, so the other envelope >>> contains 2X = 20, and the expected utility is positive. >>> >>> As Heinz says, the problem does not give enough information to come >>> to a decision. The decision *must* depend on the assumed >>> distribution of X, and the problem statement gives no basis for >>> choosing one. There are probably some subjective Bayesians who >>> would assume a particular default prior in a situation like that, >>> but I wouldn't. >>> >>> Duncan Murdoch >>> >>> Somehow, if you are correct and I think you are, then taking the >>>> log , "fixes" the distribution of x which is kind of odd to me. I'm >>>> sorry >>> to >>>> belabor this non R related discussion and I won't say anything more >>>> about >>> it >>>> but I worked/talked on this with someone for about a month a few >>>> years >>> ago >>>> and we gave up so it's interesting for me to see this again. >>>> >>>> Mark >>>> >>>> -----Original Message----- >>>> From: r-help-bounces at r-project.org >>>> [mailto:r-help-bounces at r-project.org] >>> On >>>> Behalf Of Duncan Murdoch >>>> Sent: Tuesday, August 26, 2008 8:15 AM >>>> To: Jim Lemon >>>> Cc: r-help at r-project.org; Mario >>>> Subject: Re: [R] Two envelopes problem >>>> >>>> On 26/08/2008 7:54 AM, Jim Lemon wrote: >>>>> Hi again, >>>>> Oops, I meant the expected value of the swap is: >>>>> >>>>> 5*0.5 + 20*0.5 = 12.5 >>>>> >>>>> Too late, must get to bed. >>>> >>>> But that is still wrong. You want a conditional expectation, >>>> conditional on the observed value (10 in this case). The answer >>>> depends on the distribution of the amount X, where the envelopes >>>> contain X and 2X. For example, if you knew that X was at most 5, >>>> you would know you had just observed 2X, and switching would be a >>>> bad idea. >>>> >>>> The paradox arises because people want to put a nonsensical Unif(0, >>>> infinity) distribution on X. The Wikipedia article points out that >>>> it can also arise in cases where the distribution on X has infinite >>>> mean: a mathematically valid but still nonsensical possibility. >>>> >>>> Duncan Murdoch >>>> >>>> ______________________________________________ >>>> R-help at r-project.org mailing list >>>> https://stat.ethz.ch/mailman/listinfo/r-help >>>> PLEASE do read the posting guide >>> http://www.R-project.org/posting-guide.html >>>> and provide commented, minimal, self-contained, reproducible code. >>> >>> ______________________________________________ >>> R-help at r-project.org mailing list >>> https://stat.ethz.ch/mailman/listinfo/r-help >>> PLEASE do read the posting guide >>> http://www.R-project.org/posting-guide.html >>> and provide commented, minimal, self-contained, reproducible code.