蒙提霍尔

R 中的概率谜题

Peter Chi

Assistant Professor of Statistics Villanova University

选择一扇门

图片网址

R 中的概率谜题

揭开一扇门

图片网址

R 中的概率谜题

用反向索引揭示一扇门

doors 对象:

doors
1 2 3

假设选择了 1 号门,且 2 号门有奖品…

揭示剩余的门:

reveal <- doors[-c(1,2)]
reveal
3
R 中的概率谜题

随机揭示一扇门

doors 对象:

doors
1 2 3

假设选择了 1 号门,且 1 号门确有奖品…

随机揭示剩余的一扇门:

reveal <- sample(x = doors[-1], size = 1)
R 中的概率谜题

让我们试试!

R 中的概率谜题

Preparing Video For Download...