Computing.Net > Forums > Programming > logica problem

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

logica problem

Reply to Message Icon

Name: beosuser
Date: February 15, 2006 at 14:25:36 Pacific
OS: Windows XP SP2
CPU/Ram: P4 3Ghz
Comment:

Hey, this isnt exactly a programming task, but its well, rather a logical one, so here it goes:

Five robbers have stolen 100 bearer bond certificates and they have to divide the certificates among themselves. The oldest robber proposes a distribution of the certificates. (Robber 5 is oldest, Robber 1 is youngest) He suggests that the robbers all vote and if at least fifty percent accept the proposal, the certificates are divided as proposed. Otherwise, the oldest robber will be executed, and the remaining robbers will start over again with the next oldest robber making a proposal. What solution does the eldest robber propose?

Your solution must adhere to the following constraints:

Every robber is intelligent. This means they will analyze the situation thoroughly, consider all alternatives, and act in their best interest.
Every robber is as greedy as possible.

They will not accept 20 certificates when they could get 25.
No robber is suicidal.
"At least fifty percent" means that three robbers must vote for the proposal when there are five for the proposal to pass; two must vote for the proposal if there are four robbers, etc.

Turn in a written proposal by Robber 5 similar to this:

Robber 5 gets ____ certificates.
Robber 4 gets ____ certificates



and an explanation of how you arrived at your solution. There is a single best answer, and it should adhere to the 3 constraints above. The robbers do not split the bonds evenly.

It is sometimes easier to evaluate a potential solution from the bottom up. Consider what happens when there is a single robber, then two, three, four and finally five. Look for a pattern.


Does anyone have any leads, or hints to guide me in the direcction of the answer?

thanks



Sponsored Link
Ads by Google

Response Number 1
Name: CWoodward
Date: February 15, 2006 at 16:24:08 Pacific
Reply:

This is a programming forum, not a "Please solve a riddle for me" forum. Try something like www.riddling.net

"If it jams, force it. If it breaks, it needed replacing anyway."
-Murphy's Laws


0

Response Number 2
Name: geohoffman49431
Date: February 16, 2006 at 07:53:50 Pacific
Reply:

"They will not accept 20 certificates when they could get 25." That means that none of them would be satisfied until they got all 100. For instance it would be in the oldest best interest to make at least 2 of the other robbers happy with his proposal. So he would have to give 0 to 2 of them and some equal amount to the other 2. Whatever that amount is he offers the other 2 they "could get more" So they would all vote to have him killed. This would repeat until there are 2 guys left. The second oldest would propose he get all the bonds and being half the vote he would get them.


0

Response Number 3
Name: mdow
Date: February 16, 2006 at 12:17:39 Pacific
Reply:


R5 could make the following proposal with reasonable assurance he would get the necessary votes for it to be accepted.
R5 gets 97
R4 gets 0
R3 gets 1
R2 gets 2
R1 gets 0

There would never be 5 proposals because if it gets to the fourth proposal, R2 keeps 100 and does not require any additional votes.

If there was a third proposal, the only way for R3 can be assured of R2’s vote would be to give R2 100 shares and even then he might not vote. So, on the third proposal R3 must assume that R2’s vote will be no. Also, each robber wants as much as he can get. If R3 proposes 99 for himself and 1 for R1, then R1 will vote yes because if he doesn’t, he will obviously end up with nothing at the next vote.

If there was a second proposal then the same logic applies. R3 will not accept anything less than 99 so assume he votes no and give him 0. R2 will get nothing if it goes to a third proposal, therefore he only need receive 1 share to secure his vote.

Therefore, R5 must assume that R4 will not accept anything less than 99 and therefore must be given 0. R3 will be satisfied with 1 share since if it goes to the next proposal he will get nothing. R2 could conceivably vote yes with only 1 share, but since R2 has nothing to gain by accepting 1 share at this point, then it would seem that 2 shares would secure the vote.

0 2 1 0 97
0 1 0 99 X
1 0 99 X X
0 100 X X X


0

Response Number 4
Name: SN
Date: February 16, 2006 at 19:37:44 Pacific
Reply:

Very nice mdow - But couldn't R5 offer R1 1 share instead of offering R2 2 shares? R1 can't expect to get any shares at all if R5 is eliminated and it goes to a second vote.

1 0 1 0 98

-SN


0

Response Number 5
Name: mdow
Date: February 17, 2006 at 05:26:13 Pacific
Reply:

Yes, that would be better. Good catch SN.


0

Related Posts

See More



Response Number 6
Name: basicdos
Date: February 17, 2006 at 14:29:52 Pacific
Reply:

I think number 5 is a dead man or if he is lucky hell just be broke
because when it gets down to 4 men
the 4th and 3rd oldest can vote for a 50/50 split and give the 2 youngest nothing
there is no way that number 5 can offer 4 and 3 any more then 50/50



0

Response Number 7
Name: SN
Date: February 17, 2006 at 17:40:57 Pacific
Reply:

It depends on your assumptions...mdow's answer assumes that the robbers are not willing to work together and that they know everybody else will act in their own best interests. I think that's probably a safe assumption since if they were to do as you say, R4 could refuse to honor his agreement with R3 and end up with 99.

-SN


0

Response Number 8
Name: Wolfbone
Date: February 17, 2006 at 21:40:12 Pacific
Reply:

The best logic puzzle of this kind I've ever seen is this one:

http://www.xkcd.com/blue_eyes.html


0

Response Number 9
Name: SN
Date: February 20, 2006 at 09:14:39 Pacific
Reply:

As I'm sure most people have already figured out, it's also interesting to note that this riddle can be solved more generally...With n robbers (numbered R0....Rn-1), the oldest robber gets 100-n/2 shares (integer division), and every other robber Ri gets 1 share if (n-i)%2 = 0, 0 shares otherwise.

-SN


0

Sponsored Link
Ads by Google
Reply to Message Icon






Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: logica problem

Simple (I hope) batch file problem www.computing.net/answers/programming/simple-i-hope-batch-file-problem/12736.html

Problem reading file in c++ www.computing.net/answers/programming/problem-reading-file-in-c/7826.html

Javascript addition problem. www.computing.net/answers/programming/javascript-addition-problem-/14391.html