monty(100) |>ggplot(aes(x = switched, fill = outcome)) +geom_bar(position="fill", stat="count") +scale_fill_manual(values =c("#880e0e50", "#396e0a")) +labs(x ="\nDid the player switch their choice?", fill ="Outcome ", y ="Percent (%) of games\n") +theme_minimal() +theme(legend.position ="top")
Simulation
monty(100) |>ggplot(aes(x = switched, fill = outcome)) +geom_bar(position="fill", stat="count") +scale_fill_manual(values =c("#880e0e50", "#396e0a")) +labs(x ="\nDid the player switch their choice?", fill ="Outcome ", y ="Percent (%) of games\n") +theme_minimal() +theme(legend.position ="top")
Simulation
plot =list()for (i in1:49) {plot[[i]] <-monty(1000) |>ggplot(aes(x = switched, fill = outcome)) +geom_bar(position="fill", stat="count") +scale_fill_manual(values =c("#880e0e50", "#396e0a")) +scale_y_continuous(labels = scales::percent_format()) +labs(x =NULL, fill =NULL, y =NULL) +theme_minimal() +theme(legend.position ="none")}patchwork::wrap_plots(plot)
Simulation
Enumeration
Enumeration
Causal graphs
Bayesian reasoning
Host could not open Door 1 after you chose it — but he could have opened Door 2.
The fact that he did not, makes it more likely that he opened Door 3 because he was forced to.
Thus there is more evidence than before that the prize is behind Door 2.
Any hypothesis that has survived some test that threatens its validity becomes more likely. The greater the threat, the more likely it becomes after surviving.