当前位置:网站首页>Cartoon: interesting [pirate] question
Cartoon: interesting [pirate] question
2022-07-05 17:28:00 【Small ash】
————— the second day —————
Pirates share gold coins :
Yes 5 A pirate , To obtain the 100 Gold coins , So they have to work out a way to distribute the gold coins . The way of negotiation is as follows :
1. from 5 The pirates took turns to come up with a distribution plan .
2. If more than half of the pirates ( Including the proposer ) Agree to the plan , According to the scheme .
3. If the number of people who agree to the plan ( Including the proposer ) Less than or equal to half , The proposer will be thrown into the sea to feed the fish , The rest of the pirates went on to discuss the distribution .
4. Pirates are absolutely rational , To get as many gold coins as you can . But in the case of equal returns , Will tend to throw the proposer into the sea .
ask : What kind of distribution plan should the first pirate propose , To ensure that you are not thrown into the sea , And maximize your own interests ?
Take a chestnut :
At this point, the first pirate came to propose a distribution plan , He said :
I want to 100 Gold coins , The rest of you don't have a single coin !
obviously , The rest of the kids are against it , As a result, the first proposer was thrown into the sea .
Next, it's the second pirate's turn to come up with a distribution plan , He said :
I just 1 Gold coin , be left over 3 A little friend, each of you 33 Gold coin !
The third pirate is against , The other two agreed , More than half agreed (4 : 1), So the allocation is performed according to this method .
————————————
How to use recursion to simplify the problem ? Let's analyze in detail , Later, the five pirates are called Laoyi for short 、 The second 、 Old three 、 Three old four 、 ite .
When the old one put forward the distribution plan , Think about it this way :
If I'm thrown into the sea , be left over 4 A pirate , What is the optimal allocation scheme for the second child at this time ?
I just need to add a little bit to the distribution plan for the second child , To win more support .
When the second one came up with the distribution plan , I think the same way :
If I'm thrown into the sea , be left over 3 A pirate , At this time, what is the optimal allocation plan for the third person ?
I just need to add a little bit to the third year's distribution plan , To win more support .
Third, when he put forward the distribution plan , Still think like this :
If I'm thrown into the sea , be left over 2 A pirate , At this time, what is the optimal allocation plan for the fourth ?
I just need to add a little bit to the old four's distribution plan , To win more support .
The whole recursive process , Just like the picture below :
When does this recursive process end ? Until there are two people left .
think about it , When there are two people left , What's the situation ?
At this time, old four There is no choice ! No matter how he allocates , Even if 100 Five gold coins , Old five can still oppose , The fourth was thrown into the sea , All the gold coins belong to Lao Wu .
thus , The third thought : The fourth has no optimal decision , So whatever I ask for , All four will agree , And five must disagree .
As long as more than half of the people agree, the distribution can be carried out , So the best strategy for the third is as follows :
Next , The second thought to himself : Without me , The third can get 100 Gold coins , So I won't agree with you anyway . But I can try to “ Entrapment ” Fourth and fifth , formation 3 : 1 The situation of .
In the third “ Obscene power ” Next , They didn't get a single gold coin . I gave them a gold coin for each , It's better to let the third one distribute it , So they will definitely agree .
therefore , The optimal strategy of the second is as follows :
Finally, it's the elder's turn , Lao Yi thought in his heart : Without me , The second can get 98 Gold coins , I can't give him more than 98 gold , Just give up on him , Only two of the three left , formation 3 : 2 The situation is just .
Who do you want to win over ? With the second strategy , The third one doesn't get gold , So third best “ Wait on ”. I'll give it to the third 1 gold , The third one must agree .
As for fourth and fifth , Could have gotten 1 gold , So I have to give more than the second , To win support . But I don't have to win them both at the same time , Or give old four two gold coins , Give up five , Or give old five two gold coins , Give up old four .
therefore , The optimal strategy of the old one is as follows :
边栏推荐
- 【性能测试】jmeter+Grafana+influxdb部署实战
- 关于mysql中的json解析函数JSON_EXTRACT
- 编译libssh2报错找不到openssl
- Tita 绩效宝:如何为年中考核做准备?
- CMake教程Step6(添加自定义命令和生成文件)
- Error in composer installation: no composer lock file present.
- CVPR 2022 best student paper: single image estimation object pose estimation in 3D space
- goto Statement
- Embedded-c Language-2
- Read the basic grammar of C language in one article
猜你喜欢
mongodb(快速上手)(一)
Tips for extracting JSON fields from MySQL
NPM installation
thinkphp3.2.3
33: Chapter 3: develop pass service: 16: use redis to cache user information; (to reduce the pressure on the database)
查看自己电脑连接过的WiFi密码
MYSQL group by 有哪些注意事项
ICML 2022 | Meta提出鲁棒的多目标贝叶斯优化方法,有效应对输入噪声
Embedded UC (UNIX System Advanced Programming) -2
CMake教程Step1(基本起点)
随机推荐
thinkphp3.2.3
ICML 2022 | Meta提出鲁棒的多目标贝叶斯优化方法,有效应对输入噪声
Tips for extracting JSON fields from MySQL
【二叉树】根到叶路径上的不足节点
Flow characteristics of kitchen knife, ant sword, ice scorpion and Godzilla
Which is more cost-effective, haqu K1 or haqu H1? Who is more worth starting with?
Embedded-c language-6
VBA驱动SAP GUI实现办公自动化(二):判断元素是否存在
2022 年 Q2 加密市场投融资报告:GameFi 成为投资关键词
Zhang Ping'an: accélérer l'innovation numérique dans le cloud et construire conjointement un écosystème industriel intelligent
机器学习01:绪论
漫画:如何实现大整数相乘?(整合版)
【7.7直播预告】《SaaS云原生应用典型架构》大咖讲师教你轻松构建云原生SaaS化应用,难题一一击破,更有华为周边好礼等你领!
项目引入jar从私服Nexus 拉去遇到的一个问题
漫画:如何实现大整数相乘?(下)
一个满分的项目文档是如何书写的|得物技术
thinkphp模板的使用
Use JDBC technology and MySQL database management system to realize the function of course management, including adding, modifying, querying and deleting course information.
Use of ThinkPHP template
Understand the usage of functions and methods in go language