This page was automatically generated by NetLogo 4.0beta1. Questions, problems? Contact feedback@ccl.northwestern.edu.

The applet requires Java 1.4.1 or higher. It will not run on Windows 95 or Mac OS 8 or 9. Mac users must have OS X 10.2.6 or higher and use a browser that supports Java 1.4. (Safari works, IE does not. Mac OS X comes with Safari. Open Safari and set it as your default web browser under Safari/Preferences/General.) On other operating systems, you may obtain the latest Java plugin from Sun's Java site.

created with NetLogo

view/download model file: 4-Block_Stalagmite-4.0b2_web.nlogo

WHAT IS IT?

4-Block Stalagmite is part of the ProbLab under-development curricular material for middle-school students studying probability. The reader is referred to CCL and EDRL publications that explain related artifacts, centrally the "combinations tower," a distributed sample space for thinking about relations between theoretical and empirical probability.

4-Block Stalagmite is an interactive simulation for the study of binomial distribution. The model connects between, on the one hand, combinatorics and sample space (theoretical probability), and on the other hand, actual experimental outcome distributions (empirical probability). These connections are made vivid by representing the experimental results not in histograms with stark columns but as the aggregated samples themselves (you can see and count up each of the outcomes, not only get a sense of overall frequency by category).

The randomness object in this simulation is a 4-block, a 2-by-2 grid in which each of the 4 squares can be either green or blue. The model generates random 4-block samples one after another and assigns each of these samples to its respective column by number of green squares. For example, a randomly generated 4-block with exactly one green square will descend down the "1" chute. This creates a picto-graph histogram that grows bottom-up like a stalagmite. When the probability in the model is set at 0.5, this stalagmite will grow to 1:4:6:4:1 proportions. For other p values, the stalagmite will be tailed.


PEDAGOGICAL NOTE

Sampling a random 4-block is analogous to flipping 4 coins, only that unlike coins that fall anywhere on the desk such that you don't know which is which, the 4-block has inherent structural order (top-left, top-right, bottom-left, and bottom-right). This inherent order is designed to help draw your attention to permutations and their implication for the distribution of expected frequency. For instance, there are four unique 4-blocks that each has exactly one green square, but there are six unique 4-blocks with exactly two green squares each. So, for a p value of .5 (when independent squares are equally likely to be green or blue), it is 1.5 times more likely to draw a two-green 4-block than a one-green 4-block (the ratio value of 6 to 4 is 1.5). This is worthy of attention, because students often need help in understanding how permutations are relevant to combinatorial analysis and, moreover, how combinatorial analysis is relevant to predicting the outcome distribution.

When the sorting and coloring effects are activated as the simulation is running, the visual effect of the growing stalagmite is as though it is "stretching" the sample space. One can think of the simulation as though it is operating upon the sample space. Within columns, each of the 16 outcomes is expected to occur as often, whereas between columns the outcomes are expected to occur as often only for a p value of .5. However, for some p values, adjacent columns are expected to grow as tall. For example, for the p value of .6, the two-green and three-green columns should be equally tall.


HOW IT WORKS

4-Blocks are randomly generated by asking each square to choose a color with a 'probability-to-be-target-color' chance of green, the target color. Each 4-Block is dropped into the column matching according to its number of green squares. The stalagmite distribution can be sorted by type, even as it grows. There are 16 unique outcomes, so sorting the experimental outcomes by type results in 16 groups. These 16 groups are typically of uneven size, even for the p value of .5, but most often their sizes revolve quite tightly around the average. For example for 160 samples taken, most groups will contain roughly 10 outcomes. You can color these groups to enhance their visual groupiness.


HOW TO USE IT

Buttons:
'Setup' -- initializes the View, essentially "emptying" the columns, and resets the variables and monitors.

'Go Once' -- generates a single 4-Block and sends it down its respective chute, whereas 'Go' does so forever until one of the columns reaches the top of the display.

'Go-Org' -- begins a run in which the samples sort themselves by type (see 'Sort Outcomes,' below)

'Sort Outcomes' -- rearranges outcomes within each column so that identical 4-blocks are grouped;
'Un-Sort Outcomes' -- undoes this rearrangement.

'Paint Outcomes by Group' -- recolors outcomes by type so that identical 4-blocks appear of uniform color (the colors themselves are arbitrary -- there is no inherent meaning or scaling);
'Remove Group Colors' -- returns the 4-blocks to their original appearance.

Switches:
'keep-repeats?' -- when set at 'Off,' repeated outcomes are discarded from the Stalagmite. For example, say the simulation has already generated a 4-block with a single green square in the top-left corner. Any time later in the run, if the simulation generates another identical 4-block, it will descend the column and then disappear the moment it hits the stalagmite. But a 4-block with a single green square in the bottom-left corner would be kept, if it had not been generated. When set to 'On,' repetitions are kept (as in standard outcome distributions).

'magnify?' -- when set to 'On,' a blown-up version of newly created 4-blocks is displayed to the side of the column. This helps, because the samples themselves are small and move fast. When set to 'Off,' no blown-up sample is displayed.

'stop-at-all-found?' -- when set to 'On,' the run will end as soon as all 16 unique outcomes of the sample space have been randomly sampled. When set to 'Off,' the run will continue until one of the columns reaches the top of the display.

Slider:
'probability-to-be-target-color' -- determines the chance that each independent square in a 4-block will be green. For example, a value of 50 (50% or .5) means that each square has an equal chance of being green or blue, whereas a value of 80 means that each square has a 80% chance of being green and 20% chance of being blue.

Monitors:
'total samples taken' -- records the number of 4-blocks created.

'outcomes found' -- keeps track of how many of the 16 possible 4-block outcomes have been randomly sampled.


THINGS TO NOTICE

Setup the model in its default settings (with the 'probability' slider set to the value of 0.5 and the 'magnify?' switch set 'On'), slow down the model, using the speed slider above the View, and press 'Go'. See how a random 4-block sample is generated. Count up the number of green squares in this 4-block and see that the 4-block descends down a column bearing the corresponding numeral at the bottom. For example, if there are exactly two green squares in the random 4-block, it will go down the column with a "2" at the base.

Keep running the model slowly. See how samples are stacked on top of each other in the columns. Look closely at these samples and see if you can locate repeated outcomes, for example see if the 4-block with exactly two green squares in a particular diagonal formation occurred at least twice.


THINGS TO TRY

Set 'keep-repeats?' to 'On' and 'stop-at-all-found?' to 'Off' (these are the default settings of the model).

Press 'Go.' The columns will fill up until one of them hits the top, causing the run to stop. Compare the heights of the columns. What might you say about the relationship between these heights? Repeat this experiment and see whether any general pattern recurs.

Press 'Setup' then 'Go' and wait until the run ends. Now press 'Sort Outcomes.' What happened? Press 'Un-sort Outcomes' and then 'Sort Outcomes,' and watch the effect on the outcomes in the columns. Now press 'Color Outcomes' under each of the sort and un-sort conditions. When the outcomes are both sorted and colored, what can you say about the relation among the sizes of the colored groups? That is, over repeated trials, is there any pattern in the relative sizes of these groups, or is it completely arbitrary?

Set 'keep-repeats?' to 'Off' and 'stop-at-all-found?' to 'On.' When you press 'Go,' the model will keep running until it has randomly sampled all of the unique outcomes in the sample space. How many samples, on average, do you need to take in order to fill the entire sample space? Does this change according to the settings of 'probability'? For example, if the probability is set at 80%, does it take as many trials to fill the sample space as compared to a setting of 50%? If not, why not? How about the extreme cases of 0% or 100%?


EXTENDING THE MODEL

Add monitors and/or graphs to explore aspects of the experiments that are difficult to see in the current version. For instance:

- How many trials does it take for the experiment to produce an all-green 4-block? How is this dependent on the various settings?

- Are there more samples with an even number of green squares as compared to those with an odd number of green squares?

- How symmetrical is the histogram? How would you define "symmetry?" How would you quantify and display its changes over time?


NETLOGO FEATURES

Turtle Shapes: When creating a model, one often wishes to use turtle shapes that represent specific agents ("creatures") in the situation or phenomenon being modeled, for example a sheep or a house. However, this model is an example of a case where we do not want any special turtle shape. In fact, we actually want the turtles to look like the patches -- just squares. So we have unchecked the Turtle Shapes box (in the 'Settings' dialogue window). Try running the model with the Turtles Shapes checked. The difference between these two modes will be most noticeable when the 'magnify?' switch is turned to 'On'.


RELATED MODELS

Some of the other ProbLab (curricular) models, including S.A.M.P.L.E.R. -- a Computer HubNet Participatory Simulation -- feature related visuals and activities. In Stochastic Patchwork and especially in 9-Blocks you will see similar 3-by-3 arrays of green and blue squares. In the Stochastic Patchwork model and especially in 9-Blocks model, we see frequency distribution histograms. These histograms compare in interesting ways with the shape of the combinations tower in this model.


CREDITS AND REFERENCES

Thanks to Dor Abrahamson for the design and of this model as well as the implementation of the original model. Thanks to Josh Unterman for implementing the advanced procedures.

This model is a part of the ProbLab Curriculum, originally under development at Northwestern's Center for Connected Learning and Computer-Based Modeling and now also at the Embodied Design Research Laboratory at UC Berkeley. For more information about ProbLab, please refer to http://ccl.northwestern.edu/curriculum/ProbLab/.

To refer to this model in academic publications, please use: Abrahamson, D. & Wilensky, U. (2004). NetLogo 4-Block Stalagmite model. http://ccl.northwestern.edu/netlogo/models/4-BlockStalagmite. Center for Connected Learning and Computer-Based Modeling, Northwestern University, Evanston, IL.

In other publications, please use: Copyright 2004 Uri Wilensky. All rights reserved. See http://ccl.northwestern.edu/netlogo/models/4-BlockStalagmite for terms of use.