Object Library > Applets > Voter Experiment

Voter Experiment


Description and Use

We have an m by n rectangular lattice of sites (referred to as voters):

{0, 1, ..., m - 1}× {0, 1, ..., n - 1}.

Each site has four neighbors; the neighbors of (i, j) are

(i + 1, j), (i - 1, j), (i, j + 1), and (i, j - 1) ,

where in the first coordinate, the arithmetic operations are interpreted modulo m, and in the second coordinate the arithmetic operations are interpreted modulo n. With this neighborhood structure, our set of sites is topologically a torus, a doughnut-shaped surface.

Each site can be in any of 10 different states, denoted by the colors black, blue, cyan, green, purple, orange, pink, red, white, yellow. Initially, the each site is randomly given one of the colors. However, you can set the state of a site by selecting the desired color in the list box and then clicking on the desired site.

Time is discrete, and the dynamics of the voter process are as follows: at each time t,

  1. A site is chosen at random (each site is equally likely to be chosen),
  2. A neighbor of this site is chosen at random (each of the 4 neighbors is equally likely to be chosen).
  3. The state of the selected site is changed to the state of the selected neighbor.

You can choose either a 10 by 5 lattice, a 20 by 10 lattice, or a 50 by 25 lattice. The voters are shown graphically in the large center box. At each update, the counts for each state are recorded in the table. In addition to the usual stop options, the simulation can be set to stop whenever a color is eliminated.

This applet illustrates the topics and concepts in the list below. Click on the links to learn more about the mathematical theory.

Instructions for Downloading and Installing

Click on the link below to download the Java archive file:

To add the applet to your web page, insert the following in the html file, at the point where you want the applet to appear:

<applet code="edu.uah.math.experiments.VoterExperiment.class" archive="VoterExperiment.jar" width="500" height="450"></applet>

The jar file and the html file must be in the same folder.

This width and height dimensions are simply suggestions and can be varied. Generally, components such as graphs and tables expand and contract proportionally, while components such as buttons, scrollbars, dice, and coins are fixed in size.


Metadata

Type

Keywords

Version

Browser Requirements

Authors

Copyright

Copyright © 2001-2003 Kyle Siegrist, Dawn Duehring

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but without any warranty; without even the implied warranty of merchantability or fitness for a particular purpose. See the GNU General Public License for more details.

Related Resources

If you are interested in the Java source code or the Java documentation and object model for this applet, please visit VoterExperiment in the Object section of the Library.