Anonymous user
Monty Hall problem: Difference between revisions
→{{header|MATLAB}}
imported>Grootson |
imported>Grootson |
||
Line 3,034:
wins = ceil(3*rand(1e8,1)) - ceil(3*rand(1e8,1))
mprintf('chance to win for staying: %1.6f %%\nchance to win for changing: %1.6f %%', 100*length(wins(wins==0))/length(wins), 100*length(wins(wins<>0))/length(wins))
<syntaxhighlight lang="matlab">
|