Monty Hall problem: Difference between revisions

Content added Content deleted
(→‎{{header|Haskell}}: Added a type signature for "trials" so it works in Hugs.)
(→‎{{header|Haskell}}: Sample output added)
Line 201: Line 201:
percent n = show $ round $
percent n = show $ round $
100 * (fromIntegral n) / (fromIntegral trials)</pre>
100 * (fromIntegral n) / (fromIntegral trials)</pre>

Sample output:
<pre>
The switch strategy succeeds 67% of the time.
The stay strategy succeeds 34% of the time.
</pre>


=={{header|Java}}==
=={{header|Java}}==