Real Lab #1 - HH00693_.WMF (7098 bytes) Game Simulation

You've been invited to participate in a TV game show at NBC where you could win a free new car.  When you play, you are asked to choose one box from three.   Only one of the boxes contains a prize; the other two boxes contain lemons.    When you have chosen your box, but before you open it, the game show host will open one of the two remaining boxes and show you a lemon.  At this point you have three possible strategies:

  1. Keep the box you chose initially and open it.
  2. Take the remaining box, which the game show host did not open.
  3. Flip a coin to decide whether to open the box you originally chose or the remaining box, which the game show host did not open.

When you play the game, which of the the three strategies should you adopt?  Write a JAVA program to help you decide.  The program should simulate playing the game a large number of times (to be specified by the user), with each of the three strategies to see which one offers you the best chance of winning.  You may be surprised at the result!

Be creative but simple with your GUI design ... this simulation may end up on the web!

Due: 2 1/2 weeks (3/15) via FTP - remember, no floppy disk submissions are allowed.



Last updated by DrB on 18 February 2009