Suppose you're on a game show, and you're given the choice of three doors: Behind one door is a car; behind the others, goats. You pick a door, say No. 1, and the host, who knows what's behind the doors, opens another door, say No. 3, which has a goat. He then says to you, "Do you want to pick door No. 2?" Is it to your advantage to switch your choice?
Do any of you have any noteworthy experiences where knowledge of math helped you in an unusual way?
https://en.wikipedia.org/wiki/Monty_Hall_problem
(Score: 3, Interesting) by gringer on Friday July 29 2016, @01:22PM
non-recursive R version, for those who had difficulty understanding the Haskell version:
#!/usr/bin/Rscript
system.time({
attempts <- 10000000;
car <- sample(1:3, attempts, replace=TRUE);
choice <- sample(1:3, attempts, replace=TRUE);
stayWin <- sum(car==choice);
swapWin <- sum(car!=choice);
cat(sprintf("Stay winning percentage: %0.2f%%\n",stayWin/attempts * 100));
cat(sprintf("Swap winning percentage: %0.2f%%\n",swapWin/attempts * 100));
});
Output:
Stay winning percentage: 33.34%
Swap winning percentage: 66.66%
User System verstrichen
0.560 0.092 0.653
Ask me about Sequencing DNA in front of Linus Torvalds [youtube.com]
(Score: 2) by JoeMerchant on Friday July 29 2016, @03:01PM
This statement makes it clear for me:
swapWin - sum(car!=choice);
If you pick the car the first time, then swapping will cause you to lose, but if you pick a goat the first time, then swapping will cause you to win.
Україна досі не є частиною Росії Слава Україні🌻 https://news.stanford.edu/2023/02/17/will-russia-ukraine-war-end