I was trying to simulate the Secretary problem in JS, expecting to get a value of 1/e (~37%), but what I am getting is much less (~10%), and it was changing, increasing people would decrease it. This is what I tried, I think the error might be the let x=new Array(people).fill(0).map(e=>Math.random()) . I was expecting 37%, but got ~10% I