Anonymous user
Monty Hall problem: Difference between revisions
→{{header|J}}
Line 676:
PickDoors=. (SIZE f ?@$ DOORS f) NB. Picking doors randomly
boxes=. < , a: $~ 6: NB. Appending 6 (empty) boxes to the input
doors=. < o 3: DOORS} ] NB. 3 doors
car=. < o PickDoors CAR} ] NB. Randomizing car door positions
Line 688 ⟶ 689:
SwitchDisplay=. 'Switch: ' , ": o (CAR f freq o = SWITCH f)
sim=. (StayDisplay ; SwitchDisplay) o switch o Monty o all o stay o car o doors o
sim 1000000
|