Simulate the Monty Hall Problem
JavaScript 52

for(i=s=0;i++&lt;1e4;)s+=Math.random()&lt;2/3;alert(s/100)


Doors are 1:[0,1/3), 2:[1/3,2/3), 3:[2/3, 1)

Assume the prize is always in door 3. If the guest picks doors 1 or 2, which is range [0,2/3), and they switch, they've won the prize.