Matlab Simulation of the Monty Hall problem %montyhall(n,d,s)  %    %                Simulates n rounds of the Monty Hall problem and %                 plots the cumulative ratio of wins/total times played % %                n   : Number of rounds to simulate (Any positive integer) %                d   : Number of doors (Positive integer >= 3) %                s=0 : Always switches %                s=1 : Switches with probability N-1/N %                s=2 : Switches with probability 1/2 %                s=3 : Always stays % % All parameters are optional %                For more information on the Monty Hall problem go to  %                 http://en.wikipedia.org/wiki/Monty_Hall_problem.