Monty Hall problem: Difference between revisions

Content added Content deleted
Line 778: Line 778:
integer winner, choice, shown
integer winner, choice, shown


for plays = 0 to 10000 do
for plays = 1 to 10000 do
winner = rand(3)
winner = rand(3)
choice = rand(3)
choice = rand(3)
Line 792: Line 792:
printf(1, "Switching wins %d times\n", switchWins)
printf(1, "Switching wins %d times\n", switchWins)
printf(1, "Staying wins %d times\n", stayWins)</lang>
printf(1, "Staying wins %d times\n", stayWins)</lang>



----
== Output ==
Switching wins 6697 times

Staying wins 3303 times


=={{header|F_Sharp|F#}}==
=={{header|F_Sharp|F#}}==