Monty Hall problem: Difference between revisions

Content added Content deleted
Line 1,700: Line 1,700:
=={{header|Mathematica}}==
=={{header|Mathematica}}==


<lang Mathematica> montyHall[g_] :=
<lang Mathematica> montyHall[nGames_] :=
Module[{r, winningDoors, firstChoices, nStayWins, stayWinPercent, nSwitchWins},
Module[{r, winningDoors, firstChoices, nStayWins, stayWinPercent, nSwitchWins},
r := RandomInteger[{1, 3}, nGames];
r := RandomInteger[{1, 3}, nGames];