Everything2
Near Matches
Ignore Exact
Full Text
Everything2

Sierpinski triangle

created by Richard

(thing) by Richard (5 y) (print)   ?   (I like it!) 1 C! Tue May 02 2000 at 18:33:52

This is a recipe for your making your own fractal shape at home. Take a piece of paper (or a patch of computer screen). Pick three points on the paper; these will be the corners of the triangle. Number them 1, 2, 3. Pick any other point on the paper or screen. Now, roll 1d3, or somehow generate a random integer number of 1, 2, or 3 (with equal probability). Make a point at the midpoint of the line between your old point and the corner of the triangle indicated by your random selection. Now use that point as your starting point for the next roll of the die. Iterate. You will generate a space-filling form of a triangle, with the central quarter removed, and the central quarter removed from each remaining sub-triangle, and so on ad infinitum. This is one example of an iterated function system. (Other similar designs will generate the image of fern leaves.)

There is now an implementation of the above algorithm available in PostScript.


(thing) by PureDoxyk (7.1 mon) (print)   ?   (I like it!) Tue May 02 2000 at 18:53:57

I used to make these on my notebooks in high school. I'm so glad there's a node for them. The only thing I feel should be added is that this continuing shape (where you draw little triangles out from the middles of the sides of the big one, with their sides 1/3 the length of the original, and then repeated that operation over and over again) is one of few examples of an infinite line enclosing a finite area. If you draw a circle around the original triangle, the continuous figure you end up drawing will never enclose more space than that circle, and yet the line around the outside of the figure is infinite in length, as long as you keep generating it by adding more little triangles to the sides. It always approaches the amount of area tha the circle has, but it'll never get there. It's asymptotic.

Thanks for the node; you got my vote.

(thing) by just a guy (3.1 y) (print)   ?   (I like it!) 1 C! Fri Jul 07 2000 at 19:34:50

Here it is in all its ASCII glory:
.
. .
.   .
. . . .
.       .
. .     . .
.   .   .   .
. . . . . . . .
.               .
. .             . .
.   .           .   .
. . . .         . . . .
.       .       .       .
. .     . .     . .     . .
.   .   .   .   .   .   .   .
. . . . . . . . . . . . . . . .
.                               .
. .                             . .
.   .                           .   .
. . . .                         . . . .
.       .                       .       .
. .     . .                     . .     . .
.   .   .   .                   .   .   .   .
. . . . . . . .                 . . . . . . . .
.               .               .               .
. .             . .             . .             . .
.   .           .   .           .   .           .   .
. . . .         . . . .         . . . .         . . . .
.       .       .       .       .       .       .       .
. .     . .     . .     . .     . .     . .     . .     . .
.   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Should I continue?

(idea) by ariels (18.1 hr) (print)   ?   (I like it!) Fri Jul 07 2000 at 19:57:39

One way to get an approximation of a Sierpinski triangle is to look at the first 2n rows of Pascal's triangle modulo 2 (that is, draw a black pixel for every odd number, and a white pixel for every even number. It's amusing to work out why this must be true (you could start by showing that C2n-1,k is always odd).

(idea) by Halcyon&on (3 y) (print)   ?   (I like it!) Sun Jul 30 2000 at 22:51:24

An interesting thing to try is to run the same algorithm as above, except use more than three points. If you run a program with a square, it will just fill up solid. Same with a hexagon. However, any figure with an odd number of sides will give a picture with forbidden areas, much like the triangle does. The area of these forbidden spaces decreases with respect to the total area of the object as you add more and more points. The limit of applying a Sierpinksy type operation to a circle will give a solid circle.

Other fun things to try are fixing the coordinates of two points constant and allowing the third to be some random point within a range of 2-D space. Also try doing four points, where three are the vertices of a triange and the fourth is a point inside the triangle. These all came from a science project I did in highschool many years ago using a Commodore 64 and the LOGO programming language =)


(idea) by abiessu (22.7 hr) (print)   ?   (I like it!) Fri Sep 07 2001 at 17:41:55

Not to repeat halcyon, but using increasingly more points actually adds to the dimension of the figure:

Two points makes a line segment.

Three points makes a triangle with triangular gaps (see w/u by just a guy above).

Four points makes a tetrahedron with octehedral gaps (an octehedron bounded by a triangle, the shape 'removed' from the center of the tetrahedron below):

                                       ,|,
                                     ,7`\,\,
                                   ,7`  `| `\,
                                 ,7`     \,  `\,
                               ,7`       `|    `\,
                             ,7`          \,     `\,
                           ,7`            `|       `\,
                         ,7`               \,        `\,
                       ,7`                 `|        /7`\,
                     ,7`                    \,      AV `|`\,
                   ,7`'TTs.,                `|     /7   \, `\,
                 ,7` \\,  `'TTs.,            \,   AV    `|   `\,
               ,7`   `|`\,     `'TTs.,       `|  /7      \,    `\,
             ,7`      \, `\,        `'TTs.,   \,AV       `|      `\,
           ,7`        `|   `\,        ,7``'TTs`|7         \,       `\,
         ,7`           \,    `\,    ,7`      ,7\\,        `|         K`
       ,7`             `|      `\,,7`      ,7` `|`\,       \,       AV
     ,7`                \,       AV'TTs.,,7`    \, `\,     `|      /7
   ,7`                  `|      /7     ,7`      `|   `\,    \,    AV
  ,T,                    \,    AV    ,7`         \,    `\,  `|   /7 
  `'TTs.,                `|   /7   ,7`           `|      `\, \, AV
       `'TTs.,            \, AV  ,7`              \,       `\||/7
            `'TTs.,       `|/7 ,7`                `|         `AV
                 `'TTs.,   \,,7`                   \,        /7
                      `'TTs`|                      `|       AV
                           `'TTs.,                  \,     /7
                                `'TTs.,             `|    AV
                                     `'TTV.,         \,  /7
                                          `'TTs.,    `| AV
                                               `'TTs.,\/7
                                                    `'T`

The shape from the middle:


                                       ____,,..----**/7,
                       ____,,..----**'`             AV`|
                     |'TTs.,                       /7  \,
                     \,   `'TTs.,                 AV   `|
                     `|        `'TTs.,           /7     \,
                      \,            `'TTs.,     AV      `|
                      `|                 `'TTs./7        \,
                       \,                    ,7\,        `|
                       `|                  ,7`  `\,       \,
                        \,               ,7`      `\,     `|
                        `|             ,7`          `\,    \,
                         \,          ,7`              `\,  `|
                         `|        ,7`                  `\, \,
                          \,     ,7`                      `\||
                          `|   ,7`              ____,,..----**
                           \,,7`____,,..----**'`
                            7*'`

(In the above figure, each face of the tetrahedron is a Sierpinski triangle, and every 3D gap is octehedral in shape.) It is clear from the upper shape above that four generating points could easily fill the quadrilateral formed by them if the points are randomly placed (percentage chances? I have no idea...).

Etc. A three dimensional screen would be more suited for viewing this fractal with four generating points, but the 2-D version is often recognizeable. Also, it often helps to have a color change when approaching any one of the points.

See Also:

Pascal's Triangle.


printable version
chaos

PostScript Code to Draw A Sierpinski Triangle Pascal's Triangle Koch snowflake Waclaw Sierpinski
Sierpinski curve Hausdorff dimension dice Polish mathematicians
iterated function system Menger sponge Fibonacci number Fern
Fractal Logo Cantor Ternary Set XScreenSaver
fractal time ergodic theory ska Proth's Theorem
L-systems iterate Sierpinski carpet cyclohedron
Y'know, if you log in, you can write something here, or contact authors directly on the site. Create a New User if you don't already have an account.
  Epicenter
Login
Password

password reminder
register

Everything2 Help


cooled by bozon

Cool Staff Picks
Things you could have written:
U-2 Incident
Unitarian Universalist Covenant
Ontogeny recapitulates phylogeny
flea
Beowulf
Go
CIA World Factbook - Hell
I was a prisoner in a Mexican whorehouse
caffeine
Jesus driving out the Temple moneychangers
Whig History
Some tips on coping with bipolar disorder
Jefferson Airplane
New Writeups
The Hypotenuse
The greatest trick the Devil ever pulled was convincing the world he didn't exist(person)
Cuckowski
Slavonic Princess(poetry)
Heitah
Posthumous Oscar(thing)
ignis_glaciesque
University of South Florida(place)
ignis_glaciesque
Flogstaskriket(idea)
liveforever
Caesar's last breath(idea)
dagnyswaggart
she wants to believe(personal)
antigravpussy
he doesn't know, but her eyes widen too far(thing)
dagnyswaggart
Wild tides guard her secrets(poetry)
Lord Brawl
Caesar's last breath(poetry)
locke baron
Forgotten things in space(fiction)
sitaraika
Colours(idea)
etouffee
Wild tides guard her secrets(poetry)
Lord Brawl
Dr. Horrible's Sing-Along Blog(review)
a8ksh4
regret(idea)
This affordable entertainment brought to you by The Everything Development Company