Imagine you were given a choice of three doors and told one of them had something very valueable behind it, but that the others had nothing.
You begin to open door 1. But then door two is opened and revealed to have had nothing.
Would you continue to choose door 1 for your final answer? Or would you switch your choice to door 3?
According to statisticians, one should always switch to door three.
There are statistical theories that go into the explanation for this, but it's also cooler sometimes to see a practical proof thereof.
This program emulates running this same guessing game several thousand times, in which the program makes a choice of one option and then decides to switch the final answer or not.
Once the program is run, the percentage of how often each guessing strategy (switch or don't switch) got the correct answer is calculated and displayed in the console.
- clone project locally
- Run
npm install
- Run
npm run go
- Open your console and look at the results.