Monty Hall Problem – Test Script

A quick script knocked up to test the theories in the Monty Hall Problem. Defaults to run 1000 tests, but this can be adjusted using the $NumberOfTests parameter.

A second parameter controls the choice of whether to switch doors, or stick with the same one. This is the $Choice parameter and can accept the following options. The default option is LetFateDecide.

  • StickWithDoor
  • SwitchDoor
  • LetFateDecide

Examples

Runs 1000 instances of the Monty Hall Problem

Runs 1000 instances of the Monty Hall Problem where the door gets switched every time

Runs 5000 instances of the Monty Hall Problem, sticking with the same door everytime.


Full ScriptTest-MontyHallProblem.ps1

Leave a Reply

Your email address will not be published. Required fields are marked *