Using Excel to Create a Sierpinski's Triangle

 

Please excuse the poor quality of this web page, as I haven't really had time to do it correctly.  Nonetheless, here are the instructions for creating Right Sierpinski Triangles using Excel.

To access the Microsoft Excel Worksheet for this activity, please click here.

 

1.         Open the "Graphing Workshop" file from the workshop and select the tab marked "engine."

 

2.         In the cell next to the "Mod = " insert the number that you would like to use for the modulo. (I suggest that the first time you do this, you select 2 for the mod.)

 

3.         When you hit the enter key, the numbers in the cells should become either 0 or 1, with the 1's forming a right Sierpinski Triangle.

 

4.         Select the box in the top left corner of the spreadsheet.  It is the one above the 1st row and to the left of column A.  All cells should be highlighted when you do this.

 

5.         Choose the "Edit" tab at the top of the page and select "Copy" from the menu.

 

6.         On the spreadsheet, select the tab to the right of the one labeled "engine." This will open a sheet with cells that are the same size as those we have used in the engine.

 

7.         Select "edit" at the top of the screen and click on the "Paste Special" command.  A menu will pop up and you want to select the "values" button.  Then hit “Enter.”

 

8.         Your sheet will look exactly like the previous one, but instead of having formulas in the cells, the cells simply have the numbers.

 

            You have now transferred the data to another worksheet.  It is time to add the color to the cells.

 

9.         Again, select the top left square, the one above row 1 and to the left of column A.  This should highlight all of the cells.

 

10.       Select the “Format” command at the top of the page.  Look down the column and select “Conditional Formatting.”

 

11.       You want the first choice to read “Cell value is”, the second one to read “equal to,” and in the third cell, type the number 0.

 

12.       Click on the button that says “Format.”  Click the top tab that says “Patterns” and click on a color that you like.  Remember which color it is.  Click on the tab marked “Font” and click on the down triangle next to the box marked “Color.”  Select the same color that you used for the Pattern.

 

13.       Select the button that says “Add” and repeat exactly steps 11 and 12, except that now you will type the number 1 instead of a 0, and you will select a different color than you did for the first condition.

 

            When you click OK, you will have a spreadsheet that is two different colors and a Right Sierpinski Triangle will be showing on your screen. 

 

Once you have done this, look at the print preview (the paper with the magnifying glass at the top of the page).  If you like what you see, you can print it with a color printer.

 

You may go back to the engine and create a different mod and create a different type of picture.

 

IMPORTANT:  If you are trying mods above 3, you will need to create a conditional format for the numbers that are not getting a conditional format.  The way I did this was to use the third conditional and set it to “Cell value is” “not equal to” “-2”.  Since no cell will have a negative value, all unformatted cells will become this color.

 

Things to try:

 

1.         Create a mod 3 triangle, and assign a different color to 0, 1 and 2 (you can do up to three conditional formats).  Do the 2’s make a significant pattern in the picture?  How about the 0’s?

 

2.         Create a mod 6, assigning one color to a value of 2 and another color to a value of 3.  Does any pattern emerge?

 

3.         Select mod 4, and assign a color to 0 only.  Then assign a different color to 2.  Select a third color for the remainder of the cells (remember: not equal to -2).  Notice the pattern that is created by the 2’s.  Try this with other mods, using a factor of one number as a different color than the 0.

 

Please let me know how you did with this.  E-mail with problems at breakfg@yahoo.com

 

 

1