# Five pirates splitting gold with a twist

Source: This was posted on the Grey Labyrinth Forums many years ago.

The five pirates are back. But this time one of them has the dreaded Zanzibar fever, whose terrible effects are spelled out below.

• 300 gold coins need to be split between the five pirates.
• Same idea as the original: the oldest pirate proposes a split of the gold coins, and everyone votes. If more than half say yes, then that is how the coins are divided. Otherwise the oldest pirate is thrown overboard and the process is repeated with the remaining pirates. (Note the "more than half" which is different from the original version)
• The pirate infected with Zanzibar fever always acts fairly: she always proposes an even split between the remaining pirates, and only votes for such a proposal.
• Each pirate is equally likely to have Zanzibar fever, and no healthy pirate initially knows who has it.
• Voting is done by secret ballot.
• The other pirates are perfect logicians who always act to maximize their own expected earnings. If multiple strategies yield the same expected value, then they randomly select among them. For this puzzle, maximizing likelihood of survival or bloodthirstiness are not factors.

If the oldest pirate is fever-free, how should she propose to divide the gold?

Edit: I intended survival really not being a priority at all for the pirates, and that the secret vote only reveals if the plan was accepted or not, no other information. However, JS1 gives a great answer below to the case where survival is more important than any amount of money, and the secret ballot does reveal the number of yes / no votes.

• The pirates are perfect logicians, you say? Commented May 2, 2015 at 6:04
• @IanMacDonald: Of course; aren't all pirates? Maybe I need to go watch that Johnny Depp movie again ... Commented May 2, 2015 at 7:46
• "You are no doubt the worst pirate I've ever heard of!" "Ah, but you have heard of me."
– Aify
Commented May 2, 2015 at 16:15

## Preliminary work that comes in handy later

Let's first solve without any Zanzibar fever:

1 pirate : 300
3 pirates:   0/   0/ 300 (pirate 2 doesn't want to die, votes yes)
4 pirates:   1/   1/   0/ 298
5 pirates:   2/   0/   1/   0/ 297 (or 0/2/1/0/297)


Now let's solve assuming Zanzibar is still in play (and not the oldest pirate remaining):

1 pirate : 300
2 pirates: 150/ 150 (pirate 1 is Zanzibar)
3 pirates: 100/ 100/ 100 (get Zanzibar vote plus self)
(Any other split risks dying)
4 pirates: See below, tricky


And now let's solve for when the oldest pirate is the Zanzibar pirate:

1 pirate : 300
3 pirates: 100/ 100/ 100 (pirates 2&3 vote yes)


Notice that for 3 pirates, the result is a 100 split no matter which pirate is Zanzibar, as long as the Zanzibar pirate is still out there.

## TL;DR

There are actually 2 solutions that follow. I first assumed that the secret ballot would cause the number of votes to be revealed. The first solution assumes that and the answer I came up with was: 80/80/0/0/140 with pirate 5 getting 140 coins.

Then the OP commented that the secret ballot should be completely secret with the vote count not revealed. Skip to the "parrot" part to read that solution. The final answer I came up with was: 93/93/0/0/114 with pirate 5 getting 114 coins.

## Revealed vote count: the tricky part

Suppose there are four pirates, and the 4th is not the Zanzibar. The 4th pirate could propose any of these three:

4 pirates: 101/ 101/   0/  98
101/   0/ 101/  98
0/ 101/ 101/  98


Each way results in a 2/3 chance of dying, because you must offer 0 to the Zanzibar pirate to survive. Anything else results in only 1 yes vote other than your own. That isn't very good odds of survival. How about:

4 pirates:  75/  75/  75/  75


Now at first you may think that this will for sure result in a yes from the Zanzibar and two no's from the other pirates. However, if they think you are the Zanzibar pirate (this is a bluff), then recall that the outcome after the Zanzibar has been revealed is 0/0/300. Which means that pirates 1 and 2 might benefit from an even split and vote yes. But all pirates are smart and they know pirate 4 might bluff. So let's figure out how pirates 1-3 would vote knowing that pirate 4 will bluff 100% of the time.

If they all vote yes, the expected value is 75/75/75/75. If they all vote no, there are two cases:

1. Pirate 4 was the Zanzibar pirate (1/3 chance from the perspective of a non Zanzibar pirate 1-3). Votes turn out three no's indicating that only Pirate 4 could have been Zanzibar. Outcome is 0/0/300 because all three pirates realize that there are no Zanzibars left.
2. Pirate 4 was not the Zanzibar pirate. (2/3 chance). Votes turn out two no's one yes indicating that the Zanzibar pirate is still out there. This results in 100/100/100.

Total expected outcome: 66.7/66.7/166.7

So in fact pirate 1 and 2 will vote yes to a 75 split and pirate 4 should always bluff in order to keep themselves alive.

## But wait, there's more!

The above assumed all pirates voted yes or no together. It looks like pirate 3 should always vote no. But what if pirates 1-2 only vote yes with probability p? This can help because they might get a yes/no split resulting in pirate 3 not knowing if the Zanzibar pirate is still out there (and not being able to propose 0/0/300). Let's go over the cases again:

1. Pirate 4 is the Zanzibar pirate. (1/3 chance)
a) 3 no votes (1-p)^2 chance, 0/0/300
b) 2 no 1 yes votes 2*p*(1-p) chance, 100/100/100 because now pirate 3 can't tell if the Zanzibar is still out there
c) 1 no 2 yes, p^2 chance, 75/75/75/75
2. Pirate 4 is **not** the Zanzibar pirate (2/3 chance)
a) Pirate 3 is Zanzibar (1/2 chance)
a1) 2 no 1 yes votes (1-p)^2 chance, 100/100/100
a2) 2 or 3 yes votes 1-(1-p)^2 chance, 75/75/75/75
b) Pirate 3 is not Zanzibar
b1) 2 no 1 yes votes (1-p) chance, 100/100/100
b2) 2 yes 1 no votes p chance, 75/75/75/75


To make a long story short, the above simplifies to the expected value of pirates 1 and 2 being:

P1 = P2 = -(100/3)p^2 + (125/3)p + 200/3


Solving for maximum P1 gives p = 5/8. This results in the following expected values for each pirate:

P1 = 79.6875
P2 = 79.6875
P3 = 93.75
P4 = 46.875 (3/8 chance of dying btw)


## And finally we reach pirate 5

Now we know that P4's best bet is to propose 75/75/75/75 with P1 and P2 voting yes with 5/8 probabilty and P3 voting no always (except for whichever is the Zanzibar pirate of course). This results in the aforementioned split of:

79.7/79.7/93.8/46.9 (with a chance of dying)

So now, P5 needs to propose: 80/80/0/0/140

This will get votes from P1, P2, P4, and P5, minus whichever might be the Zanzibar pirate (still 3 votes to gain the majority). Note that P4 will vote yes to getting 0 gold because otherwise they run a 3/8 chance of dying.

## Notes

I assumed that by "secret ballot", this meant that the votes would be put into a ballot box without anyone being able to determine who voted which way, but that the ballots would be read aloud so that the number of yeses and no would be public information.

The original question said that maximizing chances of surviving wasn't a factor, but in my answer it was, so I'm not sure whether I did something wrong. Maybe someone can double check my math, or the OP can comment on that part of it.

I went and looked at the Grey Labyrinth forums and no one came close to suggesting the answer I gave. So I don't think they ever found the real answer over there. Is there another origin for the puzzle?

## Starting Over... With a Parrot

The OP claimed in a comment that the secret ballot was truly secret, with a parrot counting the votes. So given that fact, P4's proposed 75 split will fail because the other pirates will prefer that 3 pirates remain which results in 100/100/100. So we go back to P4 proposing one of three choices:

101/101/0/98
101/0/101/98
0/101/101/98


In 2/3 of the cases, P4 will die with the result:

100/100/100/dead


In 1/3 of the cases, P4 will stay alive with the average result:

67.3/67.3/67.3/98


So the full range of possibilities from a non-Zanzibar P1-P3 point of view:

1. P4 was the Zanzibar (1/3 chance): 100/100/100/dead. Even though only the Zanzibar would commit suicide by proposing an even split, P3 can't actually take the chance of proposing 0/0/300 because P4 could have been bluffing. Because if P3 proposed 0/0/300 with any chance, then P4 should start bluffing with some chance.
2. P4 was not the Zanzibar (2/3 chance)
a) P4 chose badly (2/3 chance): 100/100/100 (asterisk - see below)
b) P4 chose well (1/3 chance): 67.3/67.3/67.3/98

The expected outcome from a non-Zanzibar P1-P3 point of view:

92.74/92.74/92.74/21.78

The expected outcome from a non-Zanzibar P4 point of view is different:

1. P4 chose badly (2/3) chance: 100/100/100/dead
2. P4 chose well (1/3) chance: 67.3/67.3/67.3/98

89.1/89.1/89.1/32.7 with a 67% chance of death

So the full expected outcome for each non-Zanzibar pirate from his own point of view (which doesn't necessarily add to 300 because each pirate has information about himself):

92.74/92.74/92.74/32.7 with a 67% chance of death

Given the above, pirate 5 should propose: 93/93/0/0/114

Again, pirates 1,2,4,5 vote for the proposal with one of them possibly not doing so if they are the Zanzibar pirate. Pirate 4 votes yes even with 0 gold to avoid death.

Equivalent proposals are 93/0/93/0/114 and 0/93/93/0/114.

## Asterisk - Information Leakage

The asterisk from above is because once P4 chooses badly and dies, the other pirates gain some information: the pirate P4 chose to give 0 to must not be the Zanzibar pirate. Therefore, the results might not always be 100/100/100 after that. Here are the possible results:

If P3 is not the Zanzibar:

1. 101/101/0: Either P1 or P2 is the Zanzibar. P3 must propose 100/100/100 and it will pass. (2/6 chance)
2. 101/0/101: P3 knows P1 is the Zanzibar but P2 doesn't yet. P3 can offer 0/151/149 because P2 will realize P1 is the Zanzibar and know that 151 is better than the 150 he could get if he voted no. (1/6 chance)
3. 0/101/101: P3 knows P2 is the Zanzibar. P3 must offer 100/100/100 otherwise both P1 and P2 will refuse. (1/6 chance)

If P3 is the Zanzibar:

1. 101/0/101: P3 offers 100/100/100. P1 knows that P3 is the Zanzibar and votes no. P2 votes yes though to pass the proposal. (1/6 chance)
2. 0/101/101: P3 offers 100/100/100. P2 knows that P3 is the Zanzibar and votes yes otherwise P2 will get killed. (1/6 chance)

Notice the one case where the outcome is 0/151/149. This results in P1 getting less than P2 and P3 overall (about a 83/108/108 split). But now P1 should choose a mixed strategy. With a low probability p, he can vote the wrong way. Given this mixed strategy, P3 can no longer afford to offer 0/151/149 in the one case above because with probability p, the assumption could be wrong leading to P3's death. P1 can choose p so small that it doesn't affect anyone's expected outcome. However, just the possibility of voting the wrong way deters P3 from deviating from the 100/100/100 strategy. So now all cases lead to a 100/100/100 split.

• Wow, fantastic answer! I especially like the part where P1 and P2 use a mixed strategy for voting. Unfortunately, I was intending survival not to be a factor, and I also interpreted the secret vote as not revealing even the vote count. I'll upvote but not accept yet in case someone wants to attack my interpretation. Sorry for the ambiguity. Commented May 2, 2015 at 7:44
• @TylerSeacrest If the vote count isn't revealed, then how can the pirates trust the vote? Who is counting the ballots and what if they lie? I guess I watch too much Survivor lol.
– JS1
Commented May 2, 2015 at 7:51
• The ship's parrot counts the votes, and of course everyone trusts the parrot. Commented May 2, 2015 at 7:52
• I wish I could give +2 Commented May 5, 2015 at 19:09
• This is bit late comment, but answer for original (parrot) problem is incorrect. It assume that P4 can offer 101/101/0/98 even if he has fever, and OP clearly states that pirate with zanzibar fever must offer equally, so P4 would have to offer 75/75/75/75 in that case
– lost
Commented Jul 27 at 10:56

Let's work our way from the bottom, the youngest pirate. The youngest pirate either wants all the gold, or to split it evenly with... himself!.

The second youngest pirate will lose if the youngest says no, so he must do a 50/50 split on the off chance the youngest is a Zanzibarbarian (with exploding wigs of death!).

The middle pirate can win with a single vote from below. Given 2's predicament, (and the possibility that one of the lower 2 is feverish), he has to appease one or both of them. If the youngest is feverish, then he could win over 2nd youngest by giving 151 coins and keeping 149. However, if #2 is feverish, then he could do a 100 split since he'll then get the 2nd's vote. That move is also the safest, since it also handles the youngest being feverish.

So, the 2nd oldest now is in a weird state. If he is feverish, he'll attempt to split the pot. The 3rd oldest now thinks that neither of 1st or 2nd are feverish, so he'll go for the 151/149 split. So, that'll fail. If not Zanzibarbarish, he has to give the middle pirate at least 100, since that's the minimum the middle stands to gain. Also, he has to worry about one of the younger ones being feverish. 2nd youngest also stands to gain more than 100, since that is most likely the middle's action. So, taking a risk of 0/101/101/98 is the 4th's play.

Ok, so most of the time, the youngest pirate will say no, and nobody really wants the evenly divided loot (or there aren't enough who do). So, the 2nd youngest stands to make 151/100/101 coins. So, you'll have to offer 2nd youngest at least 102 to win the vote. 3rd youngest stands to make 149/100/101 coins, so the same, 102 coins. 4th stands to make 98, so offer 99. So, offer 99 to the 4th, and 102 to either the 2nd or the 3rd, and keep 99 for yourself.

• Right idea; the solution definitely must look something like this. But I'd disagree with some of your details. Commented May 2, 2015 at 7:46

$\newcommand{\vec}[1]{\begin{pmatrix} #1 \end{pmatrix}}$

Call the pirates P,Q,R,S,T in order, with P oldest and healthy. Treat the term "expected earnings" as the "expected number" in probability: given a set of non-overlapping states $s_i$ with corresponding probabilities $p_i$ such that $\sum p_i = 1$, and given a payout $n_i$ in a given state $s_i$, the expected number is given by $\sum p_i n_i$. Use the notation $E_n(\mathbf{x})$ to mean the expected earnings of the pirates named in $\mathbf{x}$ when there are only $n$ pirates remaining.

The states correspond to the person with the fever - denote them $F_Q, F_R, F_S, F_T$. To get the expected earnings $E_{k+1}$, calculate the expected earnings in each state based on $E_{k}$ and weight them by the probability of that state. The question, of course, is what the probabilities are. This could be tricky, since pirates can pretend to be fevered, and prior proposals and answers can indicate or preclude fever. Here, however, we are considering the probabilities from the point of view of P before any pirate has made a proposal. At this point, all 4 states are equally likely, so the probabilities of the four states must be equal, i.e. each probability is 1/4.

T: T gets 300 coins. $E_1(T) = 300$.

ST: "more than half" means "unanimous" for 2 voters. In the state $F_T$, S must propose 150:150 to retain 150 coins. In any other state, T will always say no. $$E_2 \vec{S\\T} = \frac{1}{4} \vec{150\\150} + \frac{3}{4} \vec{0\\300} = \vec{37.5\\262.5}$$

RST: R needs 1 more vote. In $F_R$, R proposes an even split, which S accepts. In $F_S$, R's cheapest option is also an even split. In $F_Q$ and $F_T$, R's cheapest option is to propose 262:38:0. $$E_3 \vec{R\\S\\T} = \frac{2}{4} \vec{100\\100\\100} + \frac{2}{4} \vec{262\\38\\0} = \vec{181\\69\\50}$$

QRST: Q needs 2 more votes. In $F_Q, F_S, F_T$, Q proposes an even split which is accepted. In $F_R$, Q's cheapest option is to offer 179:0:70:51. $$E_4 \vec{Q\\R\\S\\T} = \frac{3}{4} \vec{75\\75\\75\\75} + \frac{1}{4} \vec{179\\0\\70\\51} = \vec{101\\56.25\\73.75\\69}$$

PQRST: P is fever-free. She only needs 2 more votes, but will pay for 3 in case one of them is fevered. The cheapest are RST. Note that P can't use an even split because only R is expecting less than 60, so if R has the fever, the others will reject an even split.

So P proposes a split of $99:0:57:74:70$.

Note: work in progress: $E_3$ and $E_4$ need refining.

• I don't think R can propose 269:31:0. Because what if S has the fever, then R will get killed. I think R's motivation must be to survive first, grab more coins second.
– JS1
Commented May 2, 2015 at 9:03
• @JS1 I think the answer holds at R. The $269:31:0$ split is conditional on RS being both fever-free. If S has the fever, R's proposal would be an even split. Of course, R doesn't know who has the fever, so the calculations up to QRST are only for the purpose of calculating the expected earnings. Only P makes an actual (single) proposal. Commented May 2, 2015 at 9:16
• I don't think you can calculate expected earnings based on future proposals that can never actually happen. I think the flaw is that you are making each person do their proposals as if they know exactly who has the fever.
– JS1
Commented May 2, 2015 at 9:20
• @JS1 "as if they know exactly who has the fever" - they don't know who has the fever. However, they can consider each possibility and weight the payouts by the probability of it happening, which produces the "expected number". Commented May 2, 2015 at 9:37
• But once the first pirate proposes that uneven split, all the other pirates know that he isn't the one with the fever, so all the fever probabilities change to 1/4. Also, whenever a proposal is voted no, the result of the vote may give some pirates information about who might have the fever. Commented May 3, 2015 at 15:39

I commented that accepted answer is not entirely correct regarding original question, but since multiple comments are not encouraged I will post my answer here.

Main difference is in interpretation of what is pirate's goal/priority. Accepted answer assumed that P4 pirate will vote YES for 0 , just to avoid possibility of death if he gets to propose ( even if he stand to gain much more if he proposes ). But original question clearly states:

The other pirates are perfect logicians who always act to maximize their own expected earnings. If multiple strategies yield the same expected value, then they randomly select among them. For this puzzle, maximizing likelihood of survival or bloodthirstiness are not factors.

That means pirates should try to "maximize their own expected earnings", regardless of "likelihood of survival".

To make explanation short, my calculation is similar to accepted answer, up to this point:

• 0/101/101/98 is best for P4 to propose ( or 0 to any one of P123)
• 92.74/92.74/92.74/32.7 is expected gains from viewpoint of each pirate P1234

Difference to accepted solution :
Pirates P1-3 will require at least offer of 93g from P5 to vote yes, and that is correct in accepted answer. Difference is in interpretation what will pirate P4 require. In my opinion, he will require at least 33g to vote yes, otherwise he vote no and expect 32.7g from his own proposal. That 'expect" means he will either get much more (98g) with chance of 1/3, or he will get nothing (0g, and get killed) with chance of 2/3 ... averaging to "expected" 32.7g. Since original question clearly states that he act to maximize expected earnings, he will require at least offer of 33g from P5 to vote YES.

In accepted answer it is assumed that P4 will accept 0g and still vote YES, even if his expected gain is much lower (0g if he vote yes, vs 32.7g if he vote no), in order to survive with 100% chance ( as opposed to 1/3 chance if he gets to propose). While that may be subjective goal of some pirates, it is not what question states.

Edit: it was clarified by JS1 ( who did accepted answer ) that both versions in his answer assume "life over gold, at all costs" ( meaning pirates will avoid any risk of death if they can, regardless of how much gold they stand to earn by risking). His two solutions differ only in "is vote fully or semi secret". So, based on those two elements ( "life or gold" priority and "semi or fully" secret ) we have actually solutions to three problems here:

• Gold+Fully : OP original question and my solution ( 0/0/93/33/174 )
• Life+Semi : accepted answer by JS1 ( 80/80/0/0/140 )
• Life+Fully : answer with "parrot" by JS1 ( 0/93/93/0/114 )

On a side note, I can understand logic that assume "pirates try to avoid death", but "Life" assumption above is much stronger - it assume pirates would avoid ANY chance of death, regardless of how much gold they stand to gain if they take even small risk. My personal opinion is that it would be good assumption if problem was "Five nuns splitting gold", but "pirate" practically has in his job description that he is willing to risk his life to earn some gold.

Solving problem using EV, P5 can offer two things:

1. 0/0/93/33/174 ( 93g to any one of P123, 33g to P4 ) : expected 87g due to 50% risk
2. 0/93/93/33/81 ( 0 to any one of P123 ) : expected 81g, no risk

Accepted answer suggest only 2nd approach, with different numbers due to offering 0 to P4, but still using "4 votes" principle where P5 makes better offer to 3 additional pirates to ensure majority even if one of them has fever. That way he ensure his proposal will pass, but at a price of expecting less gold.

But first option clearly has better expected value, following same logic as P4 ( and from quoted original question ) that expected value should trump risk of death. So final "optimal" solution should be:

Answer to original question: P5 proposes 0/ 0/ 93/ 33/ 174

About information leakage: I also tried to see how and if potential fail of P5 proposal could change what others would do, because they would get more info on who may be with fever. For example, if above P5 proposal fail, they will know that either P4 or P3 have fever. So if P4 is not with fever, he will know that P3 has it, and will know that P2 knows it, so he could change his proposal from 0/101/101/98 to eg 101/101/0/98 to ensure vote. But that would change his expected gain to 98g - so should he accept when P5 offers him even 33g, let alone 0g?

My conclusion is that it does not influence answer, since only way information leakage would influence result at the point while they are deciding their vote for P5 proposal is if some pirate without fever decide to vote NO on what appear best deal for him, in hope to use additional information. But that itself would remove additional information, since then it violates "only fevered will vote NO" assumption - in other words, they could not any more assume that pirates offered zero do not have fever.

In short, additional information ( that, if previous vote failed, those offered zero do NOT have fever ) can only be used if question was "what would P4 propose", but have no impact on P5 proposal here.

But even if P4 vote YES, his expected gold is larger than offered 33, due to information leakage: if P5 proposal failed, P4 will know that P3 has fever and will offer 101/101/0/98 and ensure his 98g. Since in this case P4 does not have fever (he voted YES on uneven offer), he also know that chance of P5 offer to pass is not 1/2 (as seen by P5) but 2/3 (fails only if P3 is fevered). Thus his actual expected gold is 2/3(P5 proposal pass)*33+1/3(P5 proposal fails)*98= 54.7

So, should P4 then require 55g in P5 proposal to vote YES?

It may seem so on first look (expected gain is primary decision criteria), and it would force P5 to offer 0/0/93/66/152, BUT ... that hinge on assumption that P4 will vote NO on 0/0/93/33/174 offer from P5 (in order to get more than "54.7g" gain). And this is where my previous explanation why information leakage does not occur is demonstrated: IF P4 vote NO on 55g offer, he can be no longer certain that P3 is one with fever (because P5 proposal failed due to his NO, and not to P3's NO). So his expected gain drops back to 32.7 ...

In short, P4 has expected gain of 54.7g only if he vote YES on P5 proposal, but if he votes NO he has 32.7g expected gain. So P5 can safely tailor his offer according to 32.7 expectation (he needs to turn potential NO vote into YES, not to improve YES vote )

Note that P3, if he is not fevered and voted YES, can apply same logic if P5 proposal fails - he will know that P4 will offer 75/75/75/75 (and fail) and that P2 also know P4 was fevered and P1 is not, so P2 will have to accept 0. Thus P3 offer 0/0/300, and he is certain to get 300g if P4 had fever. So his expected gain while contemplating P5 offer is 2/393+1/3300= 162g . But, again, that is expected gold if he votes YES, since if he votes NO his expected gain drops back to 92.7 ( he cant be certain P4 is fevered in that case) . So, again, P5 can tailor his offer vs expected gain of P3 if P3 votes NO ( no need to win YES vote ).

Same logic apply to P2, if P5 offered 0/93/0/33/174 : if he vote YES and P5 proposal fails, he knows P4 has fever, and knows P3 will offer 0/0/300, so his expected gold is 2/393+1/30=62g. This is interesting twist, since now it appears P5 can offer less that 93g to P2 .. but it cant be done due to same reasons as above: if P2 vote NO, his expected gain is 92.7g, and P5 must turn NO vote into YES, not outbid YES vote. So, again, P5 will have to offer 93g.

In all those cases, key element is that P5 must consider expected gain from viewpoint of pirates if they vote NO on his proposal, and can ignore their potential expected gain if they vote YES. And information leakage (about who is fevered) only happens when they vote YES and other pirate vote NO. Thus, again, information leakage does not influence P5s offer.

Regardless of leakage, P5 still offers : 0/ 0/ 93/ 33/ 174