Jump to content

Monty Hall problem: Difference between revisions

Line 666:
=={{header|J}}==
 
<lang j>
<lang j> NB. Monty Hall Simulation (a tacit version)
'SIZE CAR STAY MONTY SWITCH DOORS ALL'=. i.7 NB. Setting mnemonics for boxes
Line 690 ⟶ 691:
sim=. (StayDisplay ; SwitchDisplay) o switch o Monty o all o stay o car o doors o boxes f.
</lang>
Example:
<lang j>
sim 1000000
+--------------+----------------+
|Stay: 0.333143|Switch: 0.666857|
+--------------+----------------+</lang>
</lang>
 
=={{header|Java}}==
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.