You have chosen Door #3 on "Let's Make a Deal". Monte Hall has shown you the
zonk behind Door #1. Should you keep Door #3 or switch to Door #2?


Program:  MONTE
Author:   John P. Powers  (jpp@cpdvax.csc.ti.com)
Date:     May 9, 1993

Program MONTE simulates the three-door choice Monte Hall offers contestants
on "Let's Make a Deal." Before you are three doors. Behind two of the doors
are zonks--prizes no one would want. Behind one of the doors is a really big
prize like a trip to Hawaii or a TI calculator a year for life! You choose
which door you think hides the big prize, then Monte shows you what's behind
one of the other doors--always a zonk--never the good prize. Then he asks if
you want to keep the door you chose or switch to the last remaining door.
Should you keep your original choice or switch?

This program let's you generate hundreds of winning doors and contestant
choices. The program counts how many times the contestant wins and loses
assuming (s)he always switches.

Does it make any difference if the contestant keeps the original door or
switches? Run this simulation and find out. If it doesn't matter whether
you keep your door or switch, the win/lose ratio should be about 1:1 over
a large number of runs.

The program prompts for the number of trial runs. It then displays a stream
of WIN or lose messages up the screen as each trial is tested. When the run
is complete, a summary of the number of wins and losses is displayed.

Note:  This program tests the assumption that the contestant always switches
after Monte shows one of the zonks. You may have to convince yourself that
the logic of this simulation actually models the win/lose decision based on
the "switch" behavior. You might want to change the program to model the
"keep" behavior. Or to prompt for KEEP or SWITCH behavior at the beginning
of the program.

Each time through the loop, a winning door and a contestant's chosen door
is generated. If the contestant chooses the winning door, then switching to
any other door is obviously the wrong decision and results in a loss. This
is tested by CDOOR==WDOOR in the program. If however, the contestant has
chosen one of the zonks, then switching results in a win (the Else part of
the CDOOR==WDOOR test).
