Probability experiment with colors and shapes


In this set of experiments you imagine that there is a box with 9 kinds of objects:   3 kinds of shapes (Triangles, Squares and Circles) and three colors (Red, Blue and Green).  Imagine that the box contains 9 millions of objects all together in the same proportions (a million red triangles, a million blue triangles etc...)

When you start an actual experiment you will see a program that looks like this:

init num_objects=2 num_experiments=10
zzexperiment_pictures

In this case the number of objects is two and the number of experiments is 10.  This means that a trial consists of randomly picking two objects from a box and repeating the experiment 10 times.   At the end of all the trials a summery of the results is displayed.  When the number of trials is larger than 10, only the first and the last five actual trials are displayed visually but the summary takes into account all the trials.   For example, in the "All Red" experiments the summary displayes the percentage of trials where all the shapes chosen (in each trial) are red.

All Red Experiment

All Red Triangles

Exactly One Red

At Least One Red

No Red Triangles

Red Or Triangle

One Red, One Triangle

Technical note:  One can design new experiments without much knowledge of programming.  In order to do it one must first understand how the current experiments work.  One of the programs that detremine the nature of the experiment is called  logical_function.  By slecting it the following text will be displayed:
if (num_red==num_objects) [nsuccesses=nsuccesses+1]
the number of objects num_objects is controled by the user (for example, it could be 2). In this case "all red" means that the number of red objects in a trial is equal to 2 (the number of objects taken out) and this explains the line above.
Technically one has also to change the message displayed on the screen and this can easily be done by slecting the zzwrite program and changing it on a case by case basis.

The following information defines various cases
if (num_red_tri==num_objects) [nsuccesses=nsuccesses+1]   --->  All Red Triangles
if (num_red >=1) [nsuccesses=nsuccesses+1]  ---> At least one red
if (num_red==1) [nsuccesses=nsuccesses+1]   ----> Exactly one red
if (num_red_tri==0) [nsuccesses=nsuccesses+1]  ----> No Red Triangles
if (num_red ==1) AND (num_tri==1) [nsuccesses=nsuccesses+1]  --->  One red and one triangle
if (num_red >=1) OR (num_tri >=1) [nsuccesses=nsuccesses+1]  --->  Red or Triangle

(One can define many more)