The Flippant Juror¶
Problem¶
Question
A three-man jury has two members each of whom independently has probability \(p\) of making the correct decision and a third member who flips a coin for each decision (majority rules). A one-man jury has probability \(p\) of making the correct decision. Which jury has the better probability of making the correct decision?
三人陪审团有两名成员,每人独立地有 \(p\) 做出正确决定的概率, 第三名成员则为每个决定掷硬币(多数规则)。 一人陪审团做出正确决定的概率为 \(p\)。 哪个陪审团做出正确决定的可能性更大?
Tip¶
Tip
Total probability formula
全概率公式
Solutions¶
Solution1: Analysis¶
Solution1: Analysis
Firstly, the probability of an individual juror making the correct judgment is straightforward and is denoted as \(p\).
In the case of a three-person jury, the probability can be divided into two parts based on whether the third member is randomly selected correctly. If the result of the random selection by the third member is the correct answer, according to the majority voting rule, it is sufficient for one of the first two members to make the correct judgment. In this case, the probability is:
If the result of the random selection by the third member is the correct answer, according to the majority voting rule, both of the first two members must make the correct judgment. In this case, the probability is:
Therefore, the probability of obtaining the correct judgment in a three-person jury is:
Thus, the likelihood of both juries making the correct decision is the same and equal to \(p\).
首先一人陪审团做出正确判决的概率很简单,就是\(p\)。
三人陪审团时,概率可以按照第三名成员是否随机选中了正确的判决分成两部分。 如果第三名成员随机选择的结果是正确答案,那么根据多数投票规则, 只要前两名成员中有一人做出正确的判决即可,此时概率为:
如果第三名成员随机选择的结果是正确答案,那么根据多数投票规则, 只要前两名成员必须都做出正确的判决才可以,此时概率为:
由此得到三人陪审团时得到正确判决的概率是:
所以两个陪审团做出正确决定的可能性一样大,都是\(p\)
Solution2: Simulation¶
Solution2: Simulation
The probability of obtaining the correct verdict at this time can be approximated by simulating the judgment process of a three-person jury.
import random
def get_prob_prior() -> float:
p = random.random()
return p
def judge(right_prob: float) -> bool:
r = random.random()
if r < right_prob:
return True
else:
return False
def decision(p: float) -> bool:
decisions = [judge(p), judge(p), judge(0.5)]
if sum(decisions) >= 2:
return True
else:
return False
def simulation(run_nums: int = 1000000) -> None:
p = get_prob_prior()
right_decision_count = 0
for _ in range(run_nums):
if decision(p) is True:
right_decision_count += 1
right_decision_prob = right_decision_count / run_nums
print(f"One jury got right decision probability: {p}\n")
print(f"Three jury got right decision probability: {right_decision_prob}\n")
simulation()
One jury got right decision probability: 0.1168277938283161
Three jury got right decision probability: 0.116679
可以通过模拟三人陪审团的判决过程来近似得到此时得到正确判决的概率。
import random
def get_prob_prior() -> float:
p = random.random()
return p
def judge(right_prob: float) -> bool:
r = random.random()
if r < right_prob:
return True
else:
return False
def decision(p: float) -> bool:
decisions = [judge(p), judge(p), judge(0.5)]
if sum(decisions) >= 2:
return True
else:
return False
def simulation(run_nums: int = 1000000) -> None:
p = get_prob_prior()
right_decision_count = 0
for _ in range(run_nums):
if decision(p) is True:
right_decision_count += 1
right_decision_prob = right_decision_count / run_nums
print(f"One jury got right decision probability: {p}\n")
print(f"Three jury got right decision probability: {right_decision_prob}\n")
simulation()
One jury got right decision probability: 0.2399404175558495
Three jury got right decision probability: 0.23931