First, you need some random numbers! DEFINITELY don't use a spreadsheet, they're random numbers are insufficiently random when used in bulk. /dev/random is better but not ideal.
I tend to use random.org, this gives access to hardware generated random numbers on demand through a web interface. Best source you're going to find unless you actually have a hardware random number easily to hand...
Create a file called 'random.csv'. This file should have 3 Comma Seperated Variable columns. The first number needs to be 1-3, the second 1-3 and the third 1-2. Do this wrong and things won't work properly!
For example:
2,2,2
3,1,1
1,1,2
1,2,1
2,1,1
1,1,1
2,3,1
You might find a spreadsheet will help you put this together. The number of lines can be as long as you want (and your system will allow). 10000 lines will take less than a second on a modern system. If you want to do a billion, feel free!
Next, you just need to run the program on the command line:
sh montyhall.sh
It will run and give you the results at the end:
============================================================================
results.txt not found. All variables will start from 0.
============================================================================
Press Ctrl+C at any point to stop the simulation.
============================================================================
Completed! Check results.txt for hard data.
============================================================================
Accumulative data over 10000 runs:
Chance of winning if you were to keep your choice: 33%
Chance of winning if you were to change your choice: 66%
============================================================================
This proves the solution to the Monty Hall problem: Changing your choice DOUBLES your chance of winning!