FacebookTwitter
Hatrack River Forum   
my profile login | search | faq | forum home

  next oldest topic   next newest topic
» Hatrack River Forum » Active Forums » Books, Films, Food and Culture » 2nd Puzzle Solved by Dagonee (and Pop)! (A third puzzle is available) (Page 1)

  This topic comprises 2 pages: 1  2   
Author Topic: 2nd Puzzle Solved by Dagonee (and Pop)! (A third puzzle is available)
Mike
Member
Member # 55

 - posted      Profile for Mike   Email Mike         Edit/Delete Post 
What follows is a puzzle. It has an elegant solution that is not too difficult to find, but it is not immediately obvious why the solution is correct. Here we go:

There is a group of 100 people, whom we will call seekers. Each seeker has a wallet, which they give to the Wallet Master. The Wallet Master goes to a room which we will call the locker room, which happens to have 100 lockers in it, and puts one wallet in each locker. He chooses the order at random. The 100 people gather in a waiting area adjoining the locker room. One at a time, the Master admits them to the locker room, where they can look inside up to 50 lockers. Once the seeker is finished, the Master escorts him to a third room and admits the next person. The seekers are not allowed to change the state of the wallets or otherwise pass information to those who have not yet entered the locker room. The seekers are allowed to confer before the wallets are taken in order to devise a strategy that maximizes the likelyhood that every seeker finds his own wallet. What is the optimal strategy and what is the probability of success?

[ June 02, 2005, 10:34 PM: Message edited by: Mike ]

Posts: 1810 | Registered: Jan 1999  |  IP: Logged | Report this post to a Moderator
dean
Member
Member # 167

 - posted      Profile for dean   Email dean         Edit/Delete Post 
Are the lockers left open when a person finds and takes his own wallet?
Posts: 1751 | Registered: Jun 1999  |  IP: Logged | Report this post to a Moderator
Xavier
Member
Member # 405

 - posted      Profile for Xavier   Email Xavier         Edit/Delete Post 
I was thinking that too dean, but then I figured that ANYTHING which gives the next person a clue to what lockers were looked in would fall under the "The seekers are not allowed to change the state of the wallets or otherwise pass information to those who have not yet entered the locker room." clause.
Posts: 5656 | Registered: Oct 1999  |  IP: Logged | Report this post to a Moderator
Mike
Member
Member # 55

 - posted      Profile for Mike   Email Mike         Edit/Delete Post 
The lockers are not left open (this would be a way of passing information to subsequent seekers, which is not allowed). Also, when a person finds his wallet he leaves it there untouched. After all, the presence of that wallet might be useful to the seekers who come after.

[Edit: Xavier is correct.]

Posts: 1810 | Registered: Jan 1999  |  IP: Logged | Report this post to a Moderator
aspectre
Member
Member # 2222

 - posted      Profile for aspectre           Edit/Delete Post 
100%. Stuff the WalletMaster into a locker before he grabs the wallets.
Posts: 8501 | Registered: Jul 2001  |  IP: Logged | Report this post to a Moderator
Mike
Member
Member # 55

 - posted      Profile for Mike   Email Mike         Edit/Delete Post 
After he grabs the wallets, actually. That way you know where to look. [Wink]

But, I'm sure you know that that's not what I had in mind. [No No]

Posts: 1810 | Registered: Jan 1999  |  IP: Logged | Report this post to a Moderator
punwit
Member
Member # 6388

 - posted      Profile for punwit   Email punwit         Edit/Delete Post 
Do the seekers have to verify to the WalletMaster that they have found their wallet before admittance to the third room?
Posts: 2022 | Registered: Mar 2004  |  IP: Logged | Report this post to a Moderator
advice for robots
Member
Member # 2544

 - posted      Profile for advice for robots           Edit/Delete Post 
I would imagine if the seekers paired up into 50 pairs beforehand, each pair could check all 100 lockers and find each other's wallets, and then compare notes afterwards.
Posts: 5957 | Registered: Oct 2001  |  IP: Logged | Report this post to a Moderator
punwit
Member
Member # 6388

 - posted      Profile for punwit   Email punwit         Edit/Delete Post 
If they don't have to claim a wallet until the exercise is complete I'd suggest that they look in the locker that corresponds to their place in line. Ascertain whose wallet is in that locker and exchange info in the third room.
Posts: 2022 | Registered: Mar 2004  |  IP: Logged | Report this post to a Moderator
Papa Moose
Member
Member # 1992

 - posted      Profile for Papa Moose   Email Papa Moose         Edit/Delete Post 
How about the first seeker takes really careful note of the wallet in the first locker. Then the second seeker takes really careful note of the wallet in the second locker. On through to 100. Once they're all in room #3, they in turn describe the wallet that was in their locker, and the seeker who recognizes it as his own takes note of the locker number. When done, each of the 100 seekers knows where his wallet is. Success rate is 100%.

[Edit -- dangit, punwit!]

Posts: 6213 | Registered: May 2001  |  IP: Logged | Report this post to a Moderator
Mike
Member
Member # 55

 - posted      Profile for Mike   Email Mike         Edit/Delete Post 
The seekers must actually open the locker (as one of their allotted 50) that contains their wallet. So, effectively yes, they have to verify with the Wallet Master before admittance to the third room.
Posts: 1810 | Registered: Jan 1999  |  IP: Logged | Report this post to a Moderator
Mike
Member
Member # 55

 - posted      Profile for Mike   Email Mike         Edit/Delete Post 
Papa: as part of the strategy, to make things easier, they can arrange to clearly label all the wallets. Say, by number, 1 to 100.
Posts: 1810 | Registered: Jan 1999  |  IP: Logged | Report this post to a Moderator
Papa Moose
Member
Member # 1992

 - posted      Profile for Papa Moose   Email Papa Moose         Edit/Delete Post 
In that case I'm curious as to how you get anything other than 50%. Unless....

They make a list that is kept in the first room. When a person goes in, they check lockers at a predetermined rate (one per minute, for example). If the seeker finds his wallet, then he spends less time before the Wallet Master comes back to room #1, so the remaining seekers can calculate, based on time spent, which locker held the previous seeker's wallet. The next seeker knows to skip the indicated locker(s).

I don't feel like taking the time to figure out what the success rate becomes, but it should be an improvement over 50%.

--Pop

Posts: 6213 | Registered: May 2001  |  IP: Logged | Report this post to a Moderator
punwit
Member
Member # 6388

 - posted      Profile for punwit   Email punwit         Edit/Delete Post 
Well you beat me that time, Pop. I was gonna suggest some sort of time lapse scenario.
Posts: 2022 | Registered: Mar 2004  |  IP: Logged | Report this post to a Moderator
Mike
Member
Member # 55

 - posted      Profile for Mike   Email Mike         Edit/Delete Post 
Random guessing would actually be much, much less than 50%. It'd be 1/2^100. Best case is just over 25%, IIRC.

Timing tricks like that count as passing information, so are not allowed. That said, the Wallet Master is a wily fellow, and resourceful. Good at evesdropping, too. He can easily take precautions against such a strategy.

Posts: 1810 | Registered: Jan 1999  |  IP: Logged | Report this post to a Moderator
punwit
Member
Member # 6388

 - posted      Profile for punwit   Email punwit         Edit/Delete Post 
What if the first one in looks until he finds the number 1 wallet, the second looks until he finds the number 2 wallet. This should provide clues for those who hold those numbers. I'm also not sure of the success ratio.
Posts: 2022 | Registered: Mar 2004  |  IP: Logged | Report this post to a Moderator
Strider
Member
Member # 1807

 - posted      Profile for Strider   Email Strider         Edit/Delete Post 
if each person must verify with the wallet master that they have infact located their own wallet, and they can only open up to 50 lockers, then isn't there a very strong likelyhood that any individual person will not be able to find his or her wallet.

No matter what kind of plan is created, the first person who walks into that room only has a 50/50 chance of finding his wallet. And I can't seem to think of a way for anyone to do any better.

Posts: 8741 | Registered: Apr 2001  |  IP: Logged | Report this post to a Moderator
Mike
Member
Member # 55

 - posted      Profile for Mike   Email Mike         Edit/Delete Post 
Nevertheless, such a way exists. Here's one thing you might not have taken into account: there is no reason the seeker must decide all at once which lockers to open.

And with that, I'm heading home. Will check back later. [Wave]

Posts: 1810 | Registered: Jan 1999  |  IP: Logged | Report this post to a Moderator
Papa Moose
Member
Member # 1992

 - posted      Profile for Papa Moose   Email Papa Moose         Edit/Delete Post 
Yeah -- without any communication, the chances don't change from 50% for each person. I think whatever method you're using to achieve 25% does pass information in some manner (or calculates the probabilities wrong).
Posts: 6213 | Registered: May 2001  |  IP: Logged | Report this post to a Moderator
Papa Moose
Member
Member # 1992

 - posted      Profile for Papa Moose   Email Papa Moose         Edit/Delete Post 
If the order of wallets is random, I still think that makes no difference, Mike.
Posts: 6213 | Registered: May 2001  |  IP: Logged | Report this post to a Moderator
Mike
Member
Member # 55

 - posted      Profile for Mike   Email Mike         Edit/Delete Post 
Nope, no tricks, no incorrect calculations. No information passing (person to person) is necessary. Using the information you gain by looking inside lockers, however, is vital. And I really am leaving now. [Smile]
Posts: 1810 | Registered: Jan 1999  |  IP: Logged | Report this post to a Moderator
Strider
Member
Member # 1807

 - posted      Profile for Strider   Email Strider         Edit/Delete Post 
well, the only thing i can think of is that you're hinting that the distribution of wallets is not entirely random. and that by opening up a few lockers and keeping track of which numbered wallets are inside you could develop some sort of method to determine where other wallets are located, i.e.-certain number will not be close to other numbers, etc...

But since you stated originally that all the wallets are randomly distributed, I don't see how this is possible.

Posts: 8741 | Registered: Apr 2001  |  IP: Logged | Report this post to a Moderator
punwit
Member
Member # 6388

 - posted      Profile for punwit   Email punwit         Edit/Delete Post 
He's indicating a plan by the seekers to check certain lockers based on the #'s found on the wallets. I'm not sure how that helps but I'll keep grinding at it.
Posts: 2022 | Registered: Mar 2004  |  IP: Logged | Report this post to a Moderator
Papa Moose
Member
Member # 1992

 - posted      Profile for Papa Moose   Email Papa Moose         Edit/Delete Post 
Ok, I can see this increasing odds, but not by all that much necessarily.

You start with the locker of your wallet number. If your wallet is there, you're done. If not, you open the locker whose number is on the wallet you just saw. Continue until you find your wallet or hit 50 turns.

Through the random placement of the wallets, there's a chance that at least one wallet will be in its own locker -- possibly more. This removes those from the lockers anyone else would open. Also, there's probably a reasonable chance that smaller "circles" are created, and if one of those circles is fewer than 50 in length, then everyone in the circle finds his own wallet. Of course, any circle over 50 guarantees that nobody in that circle will find his own. But based on the random assortment, the chances that no circle of more than 50 numbers is created must be around 25% based on Mike saying that's the best case -- but I ain't checking it.

Posts: 6213 | Registered: May 2001  |  IP: Logged | Report this post to a Moderator
Strider
Member
Member # 1807

 - posted      Profile for Strider   Email Strider         Edit/Delete Post 
if they're truly randomly distributed, it wouldn't help at all. Unless i'm misunderstanding the nature of randomness.
Posts: 8741 | Registered: Apr 2001  |  IP: Logged | Report this post to a Moderator
punwit
Member
Member # 6388

 - posted      Profile for punwit   Email punwit         Edit/Delete Post 
I'm not sure how this would increase the odds but if the first seeker checked the first locker, looked at the number on the wallet and then went to the corresponding locker and checked that number... The second seeker went to the second locker and looked at the number on that wallet... and so on.... Would that increase the odds?

edit,You beat me again, Pop

Posts: 2022 | Registered: Mar 2004  |  IP: Logged | Report this post to a Moderator
Papa Moose
Member
Member # 1992

 - posted      Profile for Papa Moose   Email Papa Moose         Edit/Delete Post 
Yeah -- you might be. But like I said, I'm not calculating it.

It's like the fact that if you have 30 people in a room, chances are that two of them have the same birthday, even though 30 is less than 10% of 365 (or 366).

I could probably figure out what exactly the chances are, but I really don't feel like doing the math.

--Pop

Posts: 6213 | Registered: May 2001  |  IP: Logged | Report this post to a Moderator
Mike
Member
Member # 55

 - posted      Profile for Mike   Email Mike         Edit/Delete Post 
Ding ding ding! And Papa Moose finds the correct strategy! [Smile]

To get an intuitive idea on how this increases the odds, try it with only 4 seekers, each allowed to look at two lockers. There are only 24 possible arrangements of wallets in the lockers, each equally likely, so it is each to check. All four should find their wallets 41 and 2/3 percent of the time.

It is harder to get an exact number for 100 seekers. This page gives some formulas that should be helpful. The basic idea of why it works is this: the location of the wallets defines a permutation. Permutations can be expressed as a product of cyclic permutations (where, for example, 4 is mapped to 7 is mapped to 3 is mapped to 4, for a cycle of length 3). If the permutation defined by the location of the wallets has no cycles longer than 50, which turns out to be not unlikely, then everyone finds his wallet.

Posts: 1810 | Registered: Jan 1999  |  IP: Logged | Report this post to a Moderator
Mike
Member
Member # 55

 - posted      Profile for Mike   Email Mike         Edit/Delete Post 
Of course, the Wallet Master knows that the seekers will be employing this strategy, so he may arrange the wallets such that there are cycles longer than 50. Or he would if I didn't say earlier that he chooses randomly. Suppose he does, though. Can anyone give me a way to get around that?

-----

quote:
Originally posted by punwit:
I'm not sure how this would increase the odds but if the first seeker checked the first locker, looked at the number on the wallet and then went to the corresponding locker and checked that number... The second seeker went to the second locker and looked at the number on that wallet... and so on.... Would that increase the odds?

edit,You beat me again, Pop

Hmm. I think this actually doesn't increase the odds for any individual seeker, which is one of the weird things about the strategy. Instead, it makes it more likely that they all succeed or that a large number (at least 51) fail. It is impossible, for example, for only 1 seeker to fail, or only 50.
Posts: 1810 | Registered: Jan 1999  |  IP: Logged | Report this post to a Moderator
Mike
Member
Member # 55

 - posted      Profile for Mike   Email Mike         Edit/Delete Post 
Here's another one. And we'll raise the stakes a little bit, too.

This time we have n prisoners. The prison guards line the prisoners up and give each one a hat, which is colored either red or blue. The prisoners are facing along the line so that each one can see the colors of the hats in front of him, but not the color of his own hat nor the colors of the hats behind him. Starting at the back of the line, each prisoner guesses the color of his hat out loud. Once all prisoners have guessed, those who guessed correctly are set free and those who guessed incorrectly are executed.

The prisoners are allowed to confer ahead of time to decide on a strategy. What strategy maximizes the guaranteed number of prisoners freed?

Posts: 1810 | Registered: Jan 1999  |  IP: Logged | Report this post to a Moderator
ketchupqueen
Member
Member # 6877

 - posted      Profile for ketchupqueen   Email ketchupqueen         Edit/Delete Post 
Do we know how many of the hats are red and how many blue? Are they half and half?
Posts: 21182 | Registered: Sep 2004  |  IP: Logged | Report this post to a Moderator
Boris
Member
Member # 6935

 - posted      Profile for Boris   Email Boris         Edit/Delete Post 
"Everyone just say ,'Blue'"

Or there's always the prison communication system. If the person in front of you must answer and the hat is red, you must belch.

Posts: 3003 | Registered: Oct 2004  |  IP: Logged | Report this post to a Moderator
Mike
Member
Member # 55

 - posted      Profile for Mike   Email Mike         Edit/Delete Post 
The guards can arrange things however they want. They could flip a coin for each prisoner, for example. Or they could decide to give everyone a red hat. Which they probably would do if they overheard Boris's suggestion and they were feeling particularly sadistic that day. So, you have to consider the worst-case scenario and minimize the executions in that case.

[Edit for Boris's edit: good thought. Cheating, though. The guards are listening in, and will shoot at the first sign of belching. [Razz] ]

Posts: 1810 | Registered: Jan 1999  |  IP: Logged | Report this post to a Moderator
ketchupqueen
Member
Member # 6877

 - posted      Profile for ketchupqueen   Email ketchupqueen         Edit/Delete Post 
The "everyone say blue" won't work very well if there are only 3 blue hats. That's why I asked about numbers.
Posts: 21182 | Registered: Sep 2004  |  IP: Logged | Report this post to a Moderator
Xavier
Member
Member # 405

 - posted      Profile for Xavier   Email Xavier         Edit/Delete Post 
Without thinking too hard about this, what if the person in back of the line picks the color which is the most present in front of him. That would work pretty well I think. Plus if there is an even amount of people ahead of you, you know that you will live if you pick what the guy behind you did.

There's a flaw here though. Its a decent solution, but I don't think its the best one.

Posts: 5656 | Registered: Oct 1999  |  IP: Logged | Report this post to a Moderator
Xavier
Member
Member # 405

 - posted      Profile for Xavier   Email Xavier         Edit/Delete Post 
The "everyone say this color" is pretty crappy. n/2 with an average distribution.
Posts: 5656 | Registered: Oct 1999  |  IP: Logged | Report this post to a Moderator
Dagonee
Member
Member # 5818

 - posted      Profile for Dagonee           Edit/Delete Post 
If the distribution of colors is known, then the last one counts everyone in front and knows his own color exactly. If everyone keeps count, they'll know everyone has gotten it right. 100% will live.

If the distribution is not known, then the one in back says the color of the guy in front. Then that guy says his own color (the color just said). The third guy says the color of the guy in front, and the fourth says the color he just discovered. Half the prisoners live automatically. The other half live half the time (the chance of two hats in a row being the same are 50/50).

So n/2 * 1 + n/2 * .5 = 75% will be expected to live.

Posts: 26071 | Registered: Oct 2003  |  IP: Logged | Report this post to a Moderator
Enigmatic
Member
Member # 7785

 - posted      Profile for Enigmatic   Email Enigmatic         Edit/Delete Post 
The best strategy in both of these situations is to develop clairvoyance before the start of the excercise.

Or to not keep any money in your wallet, so you can just leave without wasting all your time waiting in line.

Or to not get arrested.

--Enigmatic
(has all the answers)

Posts: 2715 | Registered: Apr 2005  |  IP: Logged | Report this post to a Moderator
Dan_raven
Member
Member # 3383

 - posted      Profile for Dan_raven   Email Dan_raven         Edit/Delete Post 
Easy. Every other prisoner says the color of the hat in front of him.

They have a 50/50 chance of being right and the person in front of them have a 100% chance of being right.

Should have 75% of the prisoners go free.

Posts: 11895 | Registered: Apr 2002  |  IP: Logged | Report this post to a Moderator
Mike
Member
Member # 55

 - posted      Profile for Mike   Email Mike         Edit/Delete Post 
Nice. That guarantees (n - 1)/2 (n odd) or n/2 (n even). But you can do better. [Smile]
Posts: 1810 | Registered: Jan 1999  |  IP: Logged | Report this post to a Moderator
Dagonee
Member
Member # 5818

 - posted      Profile for Dagonee           Edit/Delete Post 
Who was that "nice" aimed at, Mike?

And Dan: Too late [Razz]

Posts: 26071 | Registered: Oct 2003  |  IP: Logged | Report this post to a Moderator
Mike
Member
Member # 55

 - posted      Profile for Mike   Email Mike         Edit/Delete Post 
Dan, good thought. Guaranteed minimum is still 50%, though. You can do better. [Smile]

Edit: I am slow at posting, clearly. Our best strategy still has worst-case around 50%. Not good enough. What if you were one of those prisoners? [Razz]

Posts: 1810 | Registered: Jan 1999  |  IP: Logged | Report this post to a Moderator
Xavier
Member
Member # 405

 - posted      Profile for Xavier   Email Xavier         Edit/Delete Post 
Okay, I think that's where I was going with mine... But what about the every other guy? Can we figure out how that guy has a better chance of living? Perhaps he says the color which is the most present in front of him? For uneven distributions, I think he will live much more. I think I will program this actually...
Posts: 5656 | Registered: Oct 1999  |  IP: Logged | Report this post to a Moderator
Dagonee
Member
Member # 5818

 - posted      Profile for Dagonee           Edit/Delete Post 
Oh, sure. Compliment Mr. Danny Come Lately.

Do we know the distribution or not?

Posts: 26071 | Registered: Oct 2003  |  IP: Logged | Report this post to a Moderator
Xavier
Member
Member # 405

 - posted      Profile for Xavier   Email Xavier         Edit/Delete Post 
I am more shooting for the strategy to have most people live on average. Not the minimum. Its fun thinking about both however.
Posts: 5656 | Registered: Oct 1999  |  IP: Logged | Report this post to a Moderator
Mike
Member
Member # 55

 - posted      Profile for Mike   Email Mike         Edit/Delete Post 
You guys are too fast, dammit! [Mad]

Dag, no we don't know the distribution, see my post above about flipping coins or choosing all red.

Xavier, you can actually guarantee n - 1 live. So screw the averages. [Smile]

Posts: 1810 | Registered: Jan 1999  |  IP: Logged | Report this post to a Moderator
Astaril
Member
Member # 7440

 - posted      Profile for Astaril   Email Astaril         Edit/Delete Post 
Man, I need to type faster. I just came up with the 75% solution too, but it took me 10 minutes to type out and now I'm 3rd in line with it! Well, back to thinking...
Posts: 624 | Registered: Mar 2005  |  IP: Logged | Report this post to a Moderator
Dagonee
Member
Member # 5818

 - posted      Profile for Dagonee           Edit/Delete Post 
OK, first person counts number of blue hats. If it's even, he says red. If it's odd he says blue.

Next person counts blue hats. If his hat is blue, then the odd/even will have switched. If not, then it will be the same. So he knows his color.

Since we know the second guy got it right, everyone else should be able to do the same thing. But it's a lot to keep track of - I doubt it could be done correctly for even 10 prisoners in practice. And if only one person screws up, he and everyone after him dies.

I was trying a prime factorization thingy and realized all you needed was to factor by 2.

Edit: minimum success is n-1, and I think the first guy has a 50% chance.

Posts: 26071 | Registered: Oct 2003  |  IP: Logged | Report this post to a Moderator
Papa Moose
Member
Member # 1992

 - posted      Profile for Papa Moose   Email Papa Moose         Edit/Delete Post 
The first person's guess is based on whether or not there are an even or odd number of blue hats. If there are an even number of blue hats in front of him, he guesses blue, otherwise red. Every person in front of him can accurately determine the color of his own hat.

I can edit in the manner in which this is done, but I want to post the answer.

Edit -- Because otherwise Dagonee will beat me to it.

Edit 2 -- I want it known that I thought of my answer (the even/odd part) pretty much immediately, but I spent too much time actually reading the thread before posting my answer. Nonetheless, Dag gets credit. *sigh*

Posts: 6213 | Registered: May 2001  |  IP: Logged | Report this post to a Moderator
kojabu
Member
Member # 8042

 - posted      Profile for kojabu           Edit/Delete Post 
man I used to know the answer to this.
Posts: 2867 | Registered: May 2005  |  IP: Logged | Report this post to a Moderator
  This topic comprises 2 pages: 1  2   

   Close Topic   Feature Topic   Move Topic   Delete Topic next oldest topic   next newest topic
 - Printer-friendly view of this topic
Hop To:


Contact Us | Hatrack River Home Page

Copyright © 2008 Hatrack River Enterprises Inc. All rights reserved.
Reproduction in whole or in part without permission is prohibited.


Powered by Infopop Corporation
UBB.classic™ 6.7.2