ICode9

精准搜索请尝试: 精确搜索
首页 > 其他分享> 文章详细

MathProblem 85 Five pirates and a 1000 coins problem

2022-08-03 06:31:07  阅读:160  来源: 互联网

标签:pirates would coins MathProblem rank 金币 suggestion pirate


Five pirates have come across a treasure of 1000 coins. According to pirate rules the pirate of highest rank must make a suggestion on how to divide the money. If a majority agree to his suggestion then it is to be followed by all the pirates. However, if the suggestion does not get a majority approval then the suggesting pirate is thrown overboard, after which time the remaining pirate of highest rank then makes a suggestion under the same rules. This process repeats, if necessary, until only the pirate of lowest rank is left, in which case he would get everything. Any pirate may suggest any distribution, rank does not guarantee getting more coins than anybody else. Assume that all pirates are infinitely greedy, infinitely logical, and infintely bloodthirsty, and that each pirate knows this to be true of every other pirate. The highest priority of each pirate is to get as much money for themselves as possible. The second highest priority is to throw overboard the other pirates. A pirate will vote to throw another one over even if they have no monetary gain by doing so, and even if it would cost them their own life, but would not if throwing them over would cost even 1 coin. How should the first pirate suggest dividing the money?

Solution

也是经典问题。先从子问题开始:

  • 如果只有 5 一个,那么显然他可以得到所有的金币
  • 如果有 4,5两个,无论 4 怎么分配,5都可以直接把他投下水,获得所有的金币
  • 如果有 3,4,5三个,如果3全部占有,那么显然 4,5会把他扔下水,所以 3 只能指望 4。为什么呢?因为如果 4 投了反对票,情况又回到了前面, 5 一定会把他扔下水,4 得不到任何东西。所以 3 只需要给 4 一个金币即可,所以此时的结果是 \((999,1,0)\)
  • 如果有 2,3,4,5。 是否能和前面一样,2 指望 3 呢?2 如何才能指望 3? 注意到上一种情况, 3 可以在只花费 1个金币的情况下,得以生存。显然,只要 3 对于 2 的分配不满意,就可以反对票。对 2 满意的分配只能是 1000,但此时无论如何,3 都可以投反对票把 2 投下去自己独吞(当然 4 5 肯定也反对这一分配),由此可知 2 不能指望 3. 如果 2 被扔下去,情况便回到了上一种,4 分得一个金币,而 5 没有金币。所以只需要比这种情况更优即可,即 \((997,0,2,1)\)
  • 如果有 1,2,3,4,5。 同样的,1 不能指望 2。 且如果 1 被扔下去以后,金币的分配显然就回到了上一步,所以只需要给 3 一个金币,5 两个金币,就能获得多数的支持。即 \((997,0,1,0,2)\)

标签:pirates,would,coins,MathProblem,rank,金币,suggestion,pirate
来源: https://www.cnblogs.com/xinyu04/p/16545716.html

本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享;
2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关;
3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关;
4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除;
5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有