Old article-"pirate money"

Source: Internet
Author: User

Keywords: logic, pirate, gold

(This post is adapted from ianstewart's fierce pirate logic in the Scientific American magazine.)

You have heard of the pirates. This is a group of desperate people who snatch money at sea and seize their lives. What they are doing is licking blood on the head of a knife. In our impressions, they usually blind one eye and use a black cloth or a black eye mask to cover the bad eyes. They also have a good habit of burying treasures in the ground, and always draw a treasure map to facilitate future generations to explore. But do you know that they are the most democratic group in the world. All who participate in piracy are unruly men who do not want to listen to commands. Everything on the ship is usually settled by a vote. The only privilege of a captain is to have his own set of tableware-but when he is not in use, other pirates can borrow it. The only punishment on the ship is to be thrown into the sea to feed the fish.

Now there are several pirates on the ship who want to snatch several gold coins. Naturally, such problems are solved by voting. The voting rules are as follows: first, the most ferocious pirates propose an allocation scheme, and then everyone will vote one by one. If 50% or more of the pirates agree to this scheme, the scheme will be allocated, if less than 50% of the pirates agree, the ones who propose the scheme will be thrown into the sea to feed the fish, and the ones who are the most ferocious will propose the scheme, and so on.

Let's make some assumptions about the pirates first.

1) each pirate has a different fierce nature, and all the pirates know the fierce nature of others. That is to say, every pirate knows the position of himself and others in the sequence of proposed solutions. In addition, every pirate has good mathematics and logic, and is rational. Finally, private transactions between pirates do not exist, because they do not believe anything except themselves.
2) A gold coin cannot be separated.
 

3) Of course, every pirate is not willing to be thrown into the sea to feed fish. This is the most important thing.
4) Of course every pirate wants to get as many gold coins as possible.
5) every pirate is a real-world player. If he gets one gold coin in a solution, there are two possibilities in the next solution: one is to get many gold coins, he will agree with the current plan without obtaining a gold coin, and will not be lucky. All in all, they believe that two birds are in the forest, not like a bird in the hand.
6) At last, every pirate liked the fact that other pirates were thrown into the sea to feed fish. Without harming his own interests, he will try to vote for his companions to feed the fish.

Now, what if 10 pirates want to divide 100 gold coins?

To solve such problems, we always push back from the last situation, so that we can know what is a good or bad decision in the last step. Then we can use this knowledge to determine what to do in the last step, and so on. If we start from the beginning to solve the problem, we will be easily blocked by the problem: "If I make such a decision, what will the following pirate do ?"

In this case, we should first consider the situation where there are only two pirates (all other pirates have been thrown into the sea to feed fish ). Note that they are P1 and P2, and P2 is fierce. The best solution of P2 is of course: He had 100 gold coins and P1 had 0 gold coins. His vote is enough for 50%.

Take a step forward. Now add a more fierce pirate P3. P1 knows -- P3 knows that he knows -- if the P3 scheme is rejected, the game will only continue from P1 and P2, and P1 won't get a gold coin. So P3 knows that as long as P1 is given a little sweetness, P1 will agree with his plan (of course, if P1 is not given a sweetness, nothing will be obtained anyway, p1 prefers to vote for P3 to feed fish ). So the optimal solution for P3 is: P1 gets one, P2 gets nothing, and P3 gets 99.

P4 is similar. He only needs two votes. If he gives P2 a gold coin, he can vote for the scheme, because P2 won't get anything in the next P3 scheme. P5 is also the same reasoning method, but he wants to persuade his two companions, so he will leave 98 gold coins for each P1 and P3 that he cannot get in the P4 scheme.

According to this, the best solution of P10 is: he gets 96 pieces, and gives each P2, P4, P6, and P8.

Below is a table of the above reasoning (Y indicates consent, N indicates opposition ):

P1 P2
0 100
N y

P1 P2 p3
1 0 99
Y n y

P1 P2 P3 P4
0 1 0 99
N y

P1 P2 P3 P4 P5
1 0 1 0 98
Y n y

......

P1 P2 P3 P4 P5 P6 P7 P8 P9 p10
0 1 0 1 0 1 0 1 0 96
N y

Now we will promote the issue of money sharing:

1) to change the rules, the voting plan must receive more than 50% votes (only those who receive the 50% votes will be thrown into the sea to feed the fish ), so how can we solve the problem of 10 pirates with 100 gold coins?
2) do not change the rules. What will happen if 500 pirates are assigned 100 gold coins?
3) if every pirate has one gold coin for saving, he can use it in the allocation scheme. If he is thrown into the sea to feed the fish, so his savings will be placed in the heap of gold coins to be allocated. What then?

Through small changes to the rules, there can be many changes to the piracy bonus issue, but the most interesting is probably 1) and 2) (The rule is still 50% votes, this post only discusses the two cases.

First consider 1 ). Currently, only P1 and P2 are worse than P2: one vote is not enough, but even if he gives 100 gold coins to P1, p1 will also throw him into the sea. But P2 is critical, because if P3 is allocated, P2 will agree even if one of his gold coins is not given to P2, so that P3 will have this iron ticket! The best solution for P3 is to swallow 100 gold coins.

P4 needs three tickets, and P3 must be opposed to it. If P2 is not given any sweetness, P2 will also oppose it because P2 can be saved in the P3 solution, why not drop P4 in the sea? Therefore, you should give P1 and P2 a gold coin respectively, so that P4 will have three votes including his own one vote. P4 solution: P1, P2 1 gold coin per person, his own 98.

The P5 situation is complicated. He also needs three votes. P4 will oppose him, so you don't have to give it. If you give P3 a gold coin, you can make him support his own scheme, because in the next P4 scheme, he won't get anything. The problem is P1 and P2: only one of them supports this. However, it is impossible to give only one gold coin. In the P4 plan, they must have one gold coin, So if you choose one of them and give two gold coins, the other will be sorry, no. In this way, the P5 solution is: 97 on your own, 1 on P3, 2 on P1 or P2.

The P6 scheme is built on P5, as long as one gold coin is not beneficial to every P5 scheme. It should be noted that P1 and P2 should be regarded as illegal in the P5 scheme: they may have two, but they may not have one, so as long as P6 gives them one gold coin, according to the "two birds in the forest, not like a bird in the hand" principle, they can support the P6 solution. So P6's solution is the only one: P1, P2, P4, one gold coin for each person, P6 took 97.

In this way, the P9 solution is: P3, P5, P7, one gold coin for each person, and then select one of P1, P2, P4, and P6 to give two gold coins, p9 has 95 items. Finally, the P10 solution is the only one: P1, P2, P4, P6, p8, one gold coin per person, P10 get 95.

2) is the most interesting (note: we can return to the 50%-vote rule ). The reasoning process in the original question was established until 200 pirates were established: the P200 gave each even number one gold coin to the pirate, including himself, and other pirates could not get anything. Since P201, it has become a little difficult to continue reasoning: P201 has to leave nothing to itself in order not to be thrown into the sea, from P1 to p199, each of the odd-numbered pirates received one gold coin, winning 100 votes and adding his own one vote. P202 cannot get anything. He must use the 100 gold coins to buy 100 pirates who cannot get anything from P201. Note that this solution is not the only one: in the P201 solution, no gold coins are obtained for all the odd-numbered pirates, with 101 (including P201). Therefore, there are 101 Solutions.

P203 had to get 102 votes. Except for his one vote, he had only 100 gold coins, so he could only buy 100 votes, so the poor guy was thrown into the sea to feed the fish. However, P203 is a very important role, because P204 knows that if his solution is not passed, P203 will also be finished, so he has an iron ticket for P203. So P204 can breathe a sigh of relief: his own vote, plus a P203 vote, and then with 100 gold coins to buy indeed 100 votes, he will be saved! 100 pirates who are lucky enough to get one gold coin can be any 100 of P1 to P202: Because the even number in P202 cannot get anything, if P204 gives one gold coin to one of them, the pirate will certainly agree with this scheme. What about the odd number pirate, it is only possible to benefit from the P202 Scheme (the possibility is 100/101), so according to the principle of "two birds in the forest, not like a bird in the hand", if one gold coin can be obtained, he will also agree with this plan.

Next, P205 won't put the hopes on the two tickets P203 and P204, because even if he is thrown into the sea, P203 and P204 can survive through the P204 solution. Although p206 can rely on P205 iron, with his own one vote and 100 gold coins to get 100 votes, only 102 votes, so he was also thrown into the sea to feed fish. P207 is not good enough, he needs 104 votes, and his own and P205 and p206 iron votes plus 100 gold coins to get only 100 votes-had to go to the sea.

P208 is lucky. He also needs 104 votes, but P205, p206, and p207 will all vote for his plan! With his own one vote and his 100 vote, he finally escaped the fate of fish.

In this way, we have a new logic that can be pushed continuously. A pirate can leave nothing to himself, buy 100 votes, and then rely on a part of the iron vote that will surely be dropped by the Pirate of the sea, so as to let his solution pass. The lucky ones are P201, P202, P204, P208, p216, p232, p264, p328, and p456 ...... We can see that the number is 200 plus a power of 2.

Which of the following are the beneficiaries? Obviously, the iron ticket does not need (cannot) gold coins. Therefore, only the last lucky number and the previous pirates can get one gold coin. So we came to the conclusion that the first 44 most ferocious pirates were thrown into the sea, and p456 gave each of the 500 pirates from P1 to p328 one gold coin.

In this way, the most ferocious pirates are thrown into the sea, and nothing is fierce. Only the most gentle pirates can get one gold coin. As Matthew says: "Blessed are gentle people, because they will bear the earth !"

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.