Hack Jam Log Book is a log of progress made in and around a weekly hack session. Topics include natural language processing, high energy electronics, linguistics, interface design, &c. Enjoy.

Recent Posts:

Archives:

2.10.08

 

Hack Jam: 1.10.08

Topics of discussion: the two envelope problem, the livescribe Pulse, slackware bootup times.

Adam brought up a neat examination of a mircocosm within the two envelopes problem:

Select a random number from the positive reals. Now select another. What are the chances that the second is greater than the first?

(Note that what follows is from my mouth -- it is not necessarily Adam's opinion or intention with this example.)

I see several resolutions to this problem. The first cheats, so we'll start there.

Make your first pick; call that number A. Due to the uncountably infinite nature of the reals, there are as many real numbers between zero and a as there are between A and the infinite (think of a function with a vertical asymptote, like tangent --- tan(x) for x from 0 to pi/4 maps to y from 0 to infinity). Therefore, it is equally likely that your next selection will be greater as it will be less --- any A divides R+ into two equal parts, so the answer to our original question is 1/2.

Why does this result cheat? Because the paradox returns if we change from R, the reals, to the natural numbers (1, 2, 3...). Then the infinity trick fails; there is only one number between 0 and 2, and still an infinite number between 2 and infinity.

We can also employ a different cheat --- redefining probability. Mathematicians that subscribe to "frequency probability" define probability as the number of occurances divided by the number of trials. If you flip a coin 100 times, and it comes up heads 57 times, then the probability of it coming up heads is .57. As the number of trials (flips) approaches infinite, then the frequency definition equates to the classical definition of probability. Using the frequency definition solves one big part of the paradox: the expected value of a random selection between one and infinity.

That expected value is infinite --- but no matter how many times you make the selection, your actual return will be a finite number --- 0% of your expected value. Even if you take billions of trials and average them, your actual return will never be infinite. It helps here to keep in mind that 'infinity' is not a number, it is a limit. Our random selection will not return 'infinity' no matter what; just very large numbers.

So how does frequency probability dissolve that paradox? By rejecting the problem definition. If you were able to to 10 trials of selecting a random natural (or real) number between zero and infinity, one of those selections would be the highest. As far as frequency probability is concerned, that number is the maximum possible value. The infinite never enters the equation; and if you change the infinity in the original problem to some number, the answer becomes easily 1/2.

This leads me to believe that the entire paradox stems from the even simpler problem: select a random positive natural number. Such a thing is certainly physically impossible, but I don't want to reject it just for that. But untli the paradox of expected value versus average return is resolved, I think that the original envelopes paradox is contained in many respects in this (admittedly more abstract) simpler question.



My updates:

In the last week I got Hack Jam Log Book up and running.

For next Wednesday, I call getting a livescribe Pulse running via virtualization on a linux box.

Comments:
Infinity is weird. The catch here I think is the distribution of random numbers. The following all assumes an even distrobution among all positive real numbers. With this assumption, the 1/2 probability track doesn't work; while there is a one to one mapping of the points from 0 to A and A to infinity, those mappings don't preserve an even distribution of points.

My approach to this question runs this way: Call the first random number A. Now partition the real number line into bins of length A (so from 0 to A, A to 2A, 2A to 3A, and so forth). Now what are the odds that a randomly chosen number is in the 0 to A bin? With an infinite number of bins and a random number generator that gives each bin an equal weight, the odds that a number falls into any one bin goes to zero. Therefore, the odds that the second number is bigger than the first is one.

This makes a kind of sense; the expected value of selecting a number is infinite, A is finite, therefore I expect the next number to be bigger.

But lets make this nasty and take it back to the two envelopes problem. Lets say I pick two numbers as above, A and B, and put them in two envelopes. You get one envelope and see the number inside. Do you want to switch?

The two envelopes problem depends on the random number distribution used. With an even distribution, it does turn out that it doesn't matter if you swap (this is version where you open your envelope, then decide whether to swap or not). You open your envelope, and have new information that your number is x. It is twice as likely that x is the bigger number of the two*, so your expected value for switching remains x. As the wikipedia article you link points out, if a distribution where any pair {X, 2X} is equally likely is used, you're back to better to swap mode.

*Consider the relative odds of picking any number between 1 to 2 versus any number between 2 to 4. Now generalize this to picking any number between n to n*h versus 2n to 2(n*h) and have h go to 1.
 
I dig what you're saying --- I am not happy with either of my proposed solutions. But I still have a problem with that infinite expected value. Even if the probability of increase is one (which is still so counterintuitive to me that I'm hesitant to accept it...), even if so, you still don't receive your expected value. Ever. Given monotonic increase, if you perform an infinite number of trials, you approach an infinite return, but...

I don't know.
 
Post a Comment

Subscribe to Post Comments [Atom]





<< Home

This page is powered by Blogger. Isn't yours?

Subscribe to Posts [Atom]