Persian Rugs

This java application implements a form of the algorithm presented in "Persian" Recursion by Anne M. Burns, in the June 1997 issue of Mathematics Magazine (vol. 70, No. 3), published by the Mathematical Association of America. The application was created by Dr. Eric Gossett at Bethel University in St. Paul, Minnesota.

The image is created by coloring the outer border with an initial color (represented by an integer in the range 0 to 15). The program then chooses a new color by using a color function on the color values of the four corners (initially all the same). The new color is then used to paint the lines that form the horizontal and vertical centers of the image. The image has thus been partitioned into four subsquares. The program then recursively colors the subsquares using the same procedure.

The color function is
new color = ((top left + top right + bottom left + bottom right)/ 4 + shift) mod 16

Running the Application

You will need to have a java runtime system installed on your computer for this to run.

Download the file PersianRugs.jar (right-click and save). Double-click on the file (or in a cmd or terminal window type java -jar PersianRugs.jar).