Java Applet* Simulation


*We will use a Java applet to simulate the experiment assuming the winners are assigned randomly to Group A (i.e. the observer has no effect).  This applet is from the The Probability/Statistics Object Library.  You can also experiment with this applet (and many others!) at the Virtual Laboratories in Probability and Statistics.

Below you will see a Java applet.  We will need to set some parameters to use the applet correctly for this experiment.  One way to think of assigning winners to Group A is that you can think of the students in the experiment as balls in an urn (the Ball and Urn Model).  The students that are "successful" (i.e."winners") will be considered to be red balls and the the students that are not successful will be considered to be green balls.  In this experiment we will randomly draw the students from the urn, without replacement, to form Group A (note that what we are doing is randomly assigning students to Group A via the draw and the students remaining in the urn are thus randomly assigned to Group B).

To make sure we understand this let's answer a few questions:

  1. Let N be the number of students in the urn.  What is the value of N for this experiment? 
  2. Let R be the number of "successful" students in the urn (or the number of red balls).  What is the value of R for this experiment?
  3. Let n be the number of students randomly drawn from the urn (without replacement) to form Group A.  What is the value of n for this experiment?

Now we will run the applet to simulate the experiment and determine the likeliness (i.e. probability) of the a result at least as extreme as the researchers' data.   The parameters N, R, and n can be varied with scroll bars. You may have to undock the toolbar to make all of the controls visible.  Either of two sampling models can be selected with the list box: with replacement and without replacement - be sure you check the sampling with replacement model.

Once you have set the parameters click on the play button once.  How many red balls appear?  What does this mean in terms of the experiment?

Repeat this ten times.  In the applet you will notice a data box in the lower left corner.  This data shows the number of "winners" assigned to Group A on each run of the experiment.  The data box below the graphs shows the relative frequency for the number of "winners" assigned to Group A.  The number of winners appears in the first column labeled Y.  There are two columns of frequency data associated with the possible values of Y.  The first (labeled Distribution) is the theoretical frequency that we will learn to compute using the laws of probability and some counting techniques.  The graph in blue is the histogram of the theoretical distribution (also known as the probability mass function).  The second (labeled Data) is the empirical relative frequency of the data you have generated. The graph in red is the empirical relative frequency histogram of this data (in this case "winners" randomly assigned to Group A).

To make sure you understand this try to answer the following:

  1. What is the theoretical relative frequency (i.e. probability) of 3 winners getting assigned to Group A?
  2. What is the theoretical relative frequency (i.e. probability) of 3 or less winners getting assigned to Group A?

Now compare these probabilities to the empirical relative frequencies after running the experiment 10 times. 

Now run the experiment 200 and 1000 times and answer the following questions:

  1. Compare your empirical relative frequency histograms to the one generated in-class via the tactical simulation.
  2. In how many of the 200 and 1000 repetitions were the empirical results as extreme as in the researchers’ actual data? 
  3. Based on these simulation results, what is the approximate probability of obtaining a sample result as extreme as the researchers’ actual data (3 or less winners in Group A.  Note: This probability is also called the p-value of this test)? 
  4. Which of the probabilities computed in questions 4 and 5 above is the actual (theoretical) p-value for the experiment?
  5. Are the sample data pretty unlikely to occur by chance variation alone if the observer’s incentive had no effect? 
  6. Do the sample data provide reasonably strong evidence in favor of the researchers’ conjecture?  Explain.