C/C++教程

MathProblem 83 To confess or not confess problem

本文主要是介绍MathProblem 83 To confess or not confess problem,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!

You and your partner in crime are both arrested and questioned separately. You are offered a chance to confess, in which you agree to testify against you partner, in exchange for all charges being dropped against you, unless he testifies against you also. Your lawyer, whom you trust, says that the evidence against both of you, if neither confesses, is scant and you could expect to take a plea and each serve 3 years. If one implicates the other, the other can expect to serve 20 years. If both implicate each other you could each expect to serve 10 years. You assume the probability of your partner confessing is p. Your highest priority is to keep yourself out of the pokey, and your secondary motive is to keep you partner out. Specifically you are indifferent to you serving \(x\) years and your partner serving \(2x\) years. At what value of p are you indifferent to confessing and not confessing?

Solution

囚徒困境的问题。 假设同伙承认的概率为 \(p\). 注意到我服刑 \(x\) 年和同伙服刑 \(2x\) 年没有区别。由此定义损失:我服刑一年会有 \(2\) 点的损失,而同伙则是对我有 \(1\) 点的损失。

分两种情况:我承认或者不承认:

  • 我承认:同伙承认了则 \(10+10*2=30\),同伙不承认则 \(0+20*1=20\)
  • 我不承认:同伙承认了则 \(2*20+0=40\),同伙不承认则 \(2*3+3=9\)

题目问的是 \(indifferent\):

\[30p+20(1-p)=40p+9(1-p) \]

求解即可

这篇关于MathProblem 83 To confess or not confess problem的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!