假设我有公平的硬币,我标记其中一个以供识别。接下来我翻转硬币不看。我的朋友正在观看,现在告诉我至少有头翻转。
我标记的硬币是正面的概率是多少?
假设我有公平的硬币,我标记其中一个以供识别。接下来我翻转硬币不看。我的朋友正在观看,现在告诉我至少有头翻转。
我标记的硬币是正面的概率是多少?
让你的硬币成为并将总和表示为.
正如我在评论中所写,答案似乎是
和 1e^7 试验的理论与样本概率图
我们可以看到,在值较低的情况下,我们几乎没有得到额外的信息,因此概率接近无条件的
@Maximilian 要求的部分重新创建的代码
library(tidyverse)
coin_flips <- function(n, k) {
# Create n x k matrix of binary outcomes
flips <- matrix(as.numeric(rbinom(n * k, 1, 0.5)), ncol = k)
firsts <- flips[, 1]
flips <- t(apply(flips, 1, sort, decreasing = T)) # i-th column is an indicator value [S >= i]
# where S is the sum of heads
flips <- as.tibble(flips)
f <- function(x) {
if (sum(x) > 0) {
return(sum(x * firsts) / sum(x))
}
return(1)
}
summary <- flips %>%
summarise_all(.funs = f)
colnames(summary) <- 1:k
return(summary)
}
# Example usage
cf <- coin_flips(1000000, 20)
cf %>% gather %>% ggplot(aes(as.numeric(key), value)) + geom_point() + ylim(c(0.48, 1))