Monty Hall problem: Difference between revisions

Content added Content deleted
Line 943:
 
=={{header|PureBasic}}==
<lang PureBasic>Procedure MontyHall(Redecide)
Procedure MontyHall(Redecide)
Static Dim Doors(2)
Dim Doors(02) = 0
Doors(1) = 0
Doors(2) = 0
Doors(Random(2)) = 1
Pick = 2
Line 962 ⟶ 960:
 
OpenConsole()
#Tries = 100000001000000
For I = 0 To #Tries
Win1 + MontyHall(1)
Line 977 ⟶ 975:
Input()</lang>
 
Output:<pre>Trial runs for each option: 1000000
Wins when stickingredeciding: 3332060666425 (3366.3264% chance)</pre>
Trial runs for each option: 10000000
Wins when redecidingsticking: 6663398 331930 (6633.6319% chance)</pre>
Wins when sticking: 3332060 (33.32% chance)</pre>
 
=={{header|Python}}==