Here’s my writeup of the solution, nothing new from what @byorgey and @drtall figured out (nice work!):
(We’re making lots of the usual assumptions. Common knowledge of rationality, no enforceable contracts.)
In the degenerate case of 1 pirate, that pirate allocates all the gold to themself and vote yes. I guess that one went without saying.
(the rest in spoiler tags)
In the 2-pirate case the short pirate (the proposer) is super screwed. If they allocate a single coin for themself, the tall pirate will vote no and it will be a tie which means throwing the short pirate overboard. The only way to get the tall pirate to vote yes is to give them all the gold. So that’s what the short pirate will do.
In the 3-pirate case it’s the opposite: the shrimpy proposer can have everything. Why? Because if the proposer is killed, the 2nd pirate becomes the shortest pirate in the 2-pirate case. Not an enviable position, as we just saw. Since that pirate has nothing to gain by killing you, they’ll vote yes and you have your majority.
In the 4-pirate case, the proposer can still have everything. The 2nd pirate now wants to kill you, to become the lucky proposer in the 3-pirate case, but everyone else (pirates 3 and 4) gain nothing by killing you, so they vote yes.
And in fact that reasoning applies to every subsequent case. The shortest pirate gets everything and only the 2nd pirate votes nay.