Introduction:
"Let's Make a Deal" was a TV game show hosted by Monty Hall.1 In this game show contestants were chosen from the audience for very strange reasons, like having a "pipe wrench" with them. Monty would request an item and a person in the audience with that item would be given the opportunity to trade it for a prize. As a result the audience would come dressed in amusing costumes and toting large bags full of odd items that Monty might request.
When a contestant won a prize she was given the option to trade that prize for a chance at an even better prize. This time however, the prize was hidden behind one of three curtains. The other two curtains contained dud-prizes or "zonkers," the most popular of which was a goat! The contestant was asked to choose one of the three curtains. Monty would then open one of the remaining curtains revealing a "zonker".2 The contestant would then be given the opportunity to switch from the curtain she originally chose to the other remaining curtain. Finally, the curtain that the contestant had settled upon was opened to reveal either a super-prize or a "zonker."
Exercise 1: If you were a contestant, would you
switch curtains when given the chance? Why?
Programming Assignment:
Your assignment is to write a program that simulates a contestant playing "Let's Make a Deal." Note that your program is not intended to allow the user to play the game as the contestant. Rather, your program should simulate both the game and the contestant. More specifically, you should simulate a contestant that plays multiple rounds of the game, switching curtains every time. By observing the number of rounds in which this simulated contestant wins, you will be able to answer the question of whether or not a "smart" contestant should switch curtains when given the chance.
Your program must begin by reading the number of rounds of the game to simulate. Then for each round, your program will choose a random curtain to hide the super-prize behind and also a random curtain representing the curtain chosen by the contestant. Your program must also count the number of rounds in which the contestant would win by switching curtains. When all rounds are complete, your program must print the percentage of rounds that the contestant would win by switching curtains. The displayed percentage should be rounded to 2 decimal places. For example, the execution of your program might appear as follows:
Exercise 2: Write a program that simulates a contestant playing "Let's Make a Deal" as described above.
Exercise 3: Run your program 20 times (i.e. 20 trials) with 25 rounds in each trial. Record the percentage of wins for each trial.
Exercise 4: Based on the data obtained from your
program should the contestant switch curtains? Why?
Precision and Accuracy:
How convincing experimental data is depends in part on the precision and
accuracy of the data. In general, scientists require that data be both precise and
accurate to be convincing. Precision has two components, consistency and
resolution. In order to be precise data must be consistent and must be collected
with an appropriate resolution. Conceptually, a consistent set of data is made up
of measurements that are clustered closely together. The resolution of a data set
is related to the units that were used in making the measurements. For example, if
the length of a book is measured using a meter stick the resolution might be 0.005
meters (or half a millimeter). The measurements you are making in this lab are the
percentage of wins in a trial and thus, assuming you count the wins and compute the
percentage correctly, the resolution of your data is limited only by the resolution
of the computer's arithmetic circuits. Thus, for the experiments you perform in
this lab, the consistency of the data is a good measure of its precision. For a
data set to be accurate, the average of the measurements must be close to the
actual value being measured. Figure 1 gives an illustration of how consistency and
accuracy are related. The next several exercises introduce intuitive measures of
consistency and accuracy and use them analyze the data that you collected in
Exercise 3.
| Consistent | Not Consistent | |
| Accurate | ![]() | ![]() |
| Not Accurate | ![]() | ![]() |
| Figure 1: Illustration of consistency and accuracy. The collection of dots on each target represents a data set with each dot representing an individual measurement. The bullseye represents the actual value being measured. The left column of targets shows two data sets containing consistent measurements, the top one is accurate and the bottom one is not accurate. In contrast the right column shows two data sets containing data that is not consistent. |
Consistency:
One way to measure the consistency of a set of data is to determine the number of measurements that are close to the average of the data set. In general we might say that a data set is consistent if most of the measurements are close to the average. Of course, to measure consistency in this way requires that we define "close" and "most." For our purposes we'll define "close" to be within 10% and "most" to be 70% or more.
Exercise 5: Compute and record the average percentage of wins for the 20 trials from Exercise 3.
Exercise 6: By the definition of consistency given above, is the data set that you collected in Exercise 3 consistent? Explain.
Exercise 7: Repeat Exercise 3 using 100 rounds per trial and record the data.
Exercise 8: Is the data set you collected in Exercise 7 more or less consistent than the data set collected in Exercise 3? Explain your reasoning.
Accuracy:
To measure the accuracy of a dataset it is necessary to know the actual value being measured. Of course if the actual value is known then it may seem like there is little point in doing the experiments in the first place. However, the known value typically comes from experiments performed by others or is the result of a theoretical prediction. In the first case the accuracy of your results indicates how well you have reproduced the earlier experiments. In the second case, the accuracy of your results indicates how well the theory models reality.
When an actual value is known, either from past experiments or from a theoretical prediction, percent error provides a good way to measure the accuracy of a data set. The percent error is the percentage difference between the actual value and the value obtained from the experiment (i.e. observed). The formula for computing the percent error is shown in equation 1.
Exercise 9: What is the actual value for the percent of times should the contestant expect to win when switching curtains? Use the WWW to find this value. Be careful, you will probably find several web sites that present conflicting values. You'll need to assess the reliability of the information that you find.
Exercise 10: List the URL where you found the answer for Exercise 9 and explain why you found it to be a reliable source.
Exercise 11: What is the percent error in your data from Exercise 3? Use the average of your measurements from all trials as the observed value.
Exercise 12: What is the percent error in your data from Exercise 8? Use the average of your measurements from all trials as the observed value.
Exercise 13: Describe the relationship that exists between the number of rounds in each trial and the consistency of the data produced.
Exercise 14: Describe the relationship that exists between the number of rounds in each trial and the accuracy of the data produced.
Exercise 15: What do you think would happen to the
accuracy and consistency of your results if you increased the number of trials
while keeping the number rounds the same?