WoodCentral Forums

Est. 1998 — 27 years of woodworking knowledge

Friday puzzle -- two envelopes, part II

Posts

Friday puzzle -- two envelopes, part II

#1

Friday puzzle -- two envelopes, part II

Alex Y

As promised last week, here is a bit trickier two-envelope problem:

You are given two envelopes, and told that they contain distinct real numbers greater than 0 and less than 100. You don't know how they were chosen -- they could be random or the ages of the puzzle-master's children.

Your goal is to pick the envelope containing the larger number. Before making your pick, you may look at a number in one of the envelopes, but then must choose before looking at the other.

How can you improve your chances of picking the larger number to greater than 50%, no matter what process was used to pick the numbers in the envelopes?

P.S. The above is my simplification of the puzzle I saw originally, but since I've been known to mess up in an attempt to simplify, here is that original:

Alice secretly picks two different real numbers by an unknown process and puts them in two (abstract) envelopes. Bob chooses one of the two envelopes randomly (with a fair coin toss), and shows you the number in that envelope. You must now guess whether the number in the other, closed envelope is larger or smaller than the one you�ve seen.

Is there a strategy which gives you a better than 50% chance of guessing correctly, no matter what procedure Alice used to pick her numbers?

Re: Friday puzzle -- two envelopes, part II

#2

The easy part

Larry Barrett

If you are shown a 0, select the other envelope; if shown 100, keep envelope.

The rest of the strategy may be a little harder.

Re: Friday puzzle -- two envelopes, part II

#3

  , but

Alex Y

I originally worded it as "a number between 0 and 100", but to avoid ambiguity, I changed it to "greater than 0 and less than 100" (not "greater than or equal to...").

Sorry for taking away the easy part! ;)

Re: Friday puzzle -- two envelopes, part II

#4

Re: Friday puzzle -- two envelopes, part II

Bill Earl

I have seen what is essentially the same puzzle and the 'solution' before elsewhere, but I'm not sure I quite got it. The solution appeared (to me) to make some assumptions about the distribution (or at least the distribution of possible distributions) of the unknown numbers.

But the state robot tournament is tomorrow. Maybe I'll have some time to wrap my brain around this on Sunday.

Re: Friday puzzle -- two envelopes, part II

#5

Good luck

Alex Y

With the tournament. Do you have a web site or blog telling about your entrant?

The solution to this one makes no assumptions about the distribution of possible numbers (except the range of reals or reals >0 and <100). It will work with two numbers you supply, and someone knowing the method and the two numbers you chose could calculate my odds (>50%) of selecting the correct one.

Re: Friday puzzle -- two envelopes, part II

#6

Re: Friday puzzle -- two envelopes, part II

Jim Rutten

My answer relies on psychology which probably has no place in a math puzzle like this one but that won't keep my from pontificating. In your puzzle if you get a number between 1 and 49 choose that the other envelope has a larger number. If you get a number between 51 and 99 choose that the other envelope has a small number. That said you are now at a perfect 50% probability. But we haven't addressed the number 50. It is my belief that if any normal human being was asked to select 2 numbers in a range that they will tend towards the larger of the numbers. In some ways, it is the greed in us that wants more. Using this for my reasoning, I would say if you get the number 50 in your envelope say that the other envelope has a larger number and you will be right more than you are wrong.

Re: Friday puzzle -- two envelopes, part II

#7

Same thoughts here

Lee Schierer McKean, PA

I came up with exactly the same strategy.

Lee

Re: Friday puzzle -- two envelopes, part II

#8

No empirical evidence required

Alex Y

This is an interesting hypothesis, and I suspect it could be supported by experimentation. But the method I am looking for will work no matter how the two numbers are chosen. This psychological solution won't work very well if the numbers between 0 and 100 are all chosen as numbers in the form of a decimal, a certain number of zeros, followed by a "1". The method I have in mind will work (albeit with a very small advantage over pure guessing) if the two numbers are .001 and .000000001.

Re: Friday puzzle -- two envelopes, part II

#9

Hint

Alex Y

The strategy involves a random process, not unlike (in concept) flipping a coin.

Re: Friday puzzle -- two envelopes, part II

#10

Re: Good luck *LINK*

Bill Earl

Sounds like the same general solution. You are going to have to explain it to me because I don't quite grasp how an arbitrary mapping function allows you to compare a random number of known distribution with one of an unknown distribution. :\

The team managed 5th place out of 64 in the robot competition. That's up from 17th last year. They are a young team, but they are learning. The link is the team website. (Not yet updated with this year's results.)


Team Lightning

Re: Friday puzzle -- two envelopes, part II

#11

Solution

Alex Y

This was a tough one. If you are like me, you look for a deterministic answer or a coin flip, and don't consider other probabilistic answers.

For the 1-100 example:

Open one of the envelopes and look at the number contained therein. Then look in a random number table or use a computer to give you a random number between zero and 1, and if that number is greater than the number in the opened envelope divided by 100, then switch.

Why does this work? Say the numbers in the envelopes are 6 and 42. There is a .5 probability that you will choose the envelope with the 6 in it, and a .94 probability that the random number you choose is greater than .06, so that you will choose the other envelope. There is also a .5 probability that you will choose the envelope containing the 42, and a .42 probability that you will choose a random number less than .42 and thus keep that envelope. So the total probability of choosing the envelope with the larger number is .5*.94 + .5*.42 = 68%.

For those more algebraically inclined, substitute x and y for 6 and 42, and you will prove that the probability that x is chosen is greater than 50% if and only if x is greater than y.

The situation with two real numbers with no bounds is a bit trickier (with tiny advantages in most cases) The key is to map every real number onto a probability of that number, such that p(x) > p(y) if and only if x>y.

One such function is f(x) = 1/(1+C^(-x)), where C is any positive constant (commonly taken as e).

So pick your constant C before the first envelope is opened, then switch if the random number you generate is greater than 1/(1+c^(-x)) where x is the value in the opened envelope.

In neither case does this answer depend on the process used to choose the values in the two envelopes.

Re: Friday puzzle -- two envelopes, part II

#12

Re: Solution

Bill Earl

I think I get it now. Your simplified version makes it easier to see.

At first I thought that it would only work if the numbers were evenly distributed. But as you stated in the original problem:

You don't know how they were chosen -- they could be random or the ages of the puzzle-master's children.

Clearly, those numbers would not be evenly distributed over the range.

I had a problem with the idea of comparing the random number (even distribution) with the puzzlemaster's number (unknown distribution). But now I see that it doesn't matter. Even if the distributions are not matched, there is still a better than 50% chance that the method will choose the right result.

Thanks for the puzzle!

Re: Friday puzzle -- two envelopes, part II

#13

Re: Solution

Larry Barrett

This is interesting; I have not seen it before. Is this approach extendable to more than two choices? (seems like it would be). It also seems like it is applicable to many situations where the objective is to select the largest (or smallest) among choices, like the largest slice of pie. Thanks for the problem.

👍 This page answered my questions

Your vote helps other woodworkers quickly find the answers and techniques that actually work in the shop.