

The Sierpinski triangle page to end most Sierpinski triangle pages - JohnHammersley
http://www.oftenpaper.net/sierpinski.htm

======
dvirsky
The Sierpinski triangle was what made me realise I have some talent as a
programmer and is part to blame for my career:

When I was about 11 (mid 80s) our school got a shining new computer lab with
original IBM 8086 PCs, and one teacher improvised a LOGO class. After a while
we were divided into two groups of more advanced kids and the rest of the
class. I was in the advanced team, and I think I was the only kid there who
didn't have a computer at home and hadn't coded before. Anyway, we were
learning about recursion, and the teacher gave us increasingly difficult
tasks.

Then one day he showed us this triangle thingie, and told us to write an
algorithm to draw it for the next class. I was shocked and stuck. Remember, I
had no interwebs or even books on the subject. I spent hours in the computer
lab banging at it, and couldn't do it. I went home, worried that I'll be the
only one in the class who failed to do it - and that I'll be taken out of the
advanced group. I was horrified, I was literally crying over it.

Then while taking a shower or something like that, the solution suddenly hit
me. I ran to the school lab (it was open after hours) wrote the code and it
worked. The joy and adrenaline rush of it was something out of this world, let
alone the relief that I wouldn't be "downgraded" from the advanced class.

The next day in class, the teacher asked us to show him our code. It turned
out I was the only kid who figured it out. It was one of the proudest moments
of my life I guess, and I've been trying to recreate that rush of solving a
hard task ever since.

~~~
nitrogen
Though I was a bit older at the time, I likewise had a lot of fun implementing
a Sierpinski triangle algorithm (the chaos game version) in junior high or
high school. I eventually wondered why not use four points, or five or more.
The four- and five-point versions looked like they had a distinguishable
pattern, but it still just looked like a mess. Eventually I tried 3D, and the
first Sierpinski pyramid I'd ever seen found its way to my screen. I felt like
I had just received some kind of revelation from abstract math itself.

~~~
dvirsky
3D! luxury! We didn't have 3D in my day, we barely had 2D :)
[https://www.youtube.com/watch?v=1by0-nkKOTs](https://www.youtube.com/watch?v=1by0-nkKOTs)

~~~
nitrogen
My initial foray into 3D used a crude approximation based on the artistic
concept of a vanishing point, implemented in QuickBasic with 2D drawing
commands. Later a friend figured out projection using the concept of similar
triangles.

------
MichaelCrawford
I used to make 3-D Sierpinski Tetrahedra out of wooden dowels and hot glue;
after a while I found that five minute epoxy works better.

I'm going to take them up again soon as I have found a fancy furniture shop
that would like to retail them for me.

I've always wanted to make them out of pyrex glass rod however it would be
quite difficult at first. I do have some glassblowing chops though.

[http://www.warplife.com/mdc/books/schizoaffective-
disorder/v...](http://www.warplife.com/mdc/books/schizoaffective-
disorder/visions.html)

The photograph is taking looking upwards at one suspended from the ceiling. I
would wind them up then let go, gravity lead the string to unwind, quickly at
first then quite slow. It's a very pleasant phenomenon.

I may make a very large one for Burning Man this year.

------
wckronholm
I don't know. What If I took that page and divided it into <div>'s, removed
the middle one, and replaced the others with copies of the original page?
Then, I could take each of those <div>'s, break them into pieces, remove the
middle one, and replace the others with copies of the original page. Then...

~~~
baddox
Just use iframes.

------
jwecker
I enjoyed that far, far more than I expected. His intro from the index:

"So I was me and I was in math class watching paint dry it was starting to
crack when suddenly I realized there was a page for which the internet was
invented. I set out to create that page, ultimately succeeding with the
sierpinski triangle page to end most sierpinski triangle pages ™.

...

So while the sierpinski triangle page to end most sierpinski triangle pages ™
purports to be some kind of exploratory rundown of the Sierpinski triangle,
it's also a fractal expression of just how carried away I get..."

It's math like I like my music: when the author takes the subject seriously
without taking themselves too seriously.

------
aeontech
Previous discussion;
[https://news.ycombinator.com/item?id=6516114](https://news.ycombinator.com/item?id=6516114)

I am amazed every time I come across this page again... such seemingly
effortlessly playful exploration of math and geometry...

~~~
rhodin
Comments from the author over at Wolfram Community:
[http://community.wolfram.com/groups/-/m/t/138400#_19_message...](http://community.wolfram.com/groups/-/m/t/138400#_19_message_140350)
I hope he has found a job by now!

~~~
taliesinb
I wish he would apply for a job with _us_. I don't see any contact details,
otherwise I would ask him directly.

~~~
jwecker
I was thinking the same thing. Best I could find was the developer email
listed for his calculator app:
[https://play.google.com/store/apps/details?id=com.projectfan...](https://play.google.com/store/apps/details?id=com.projectfancycorn.hudcalc)

[Edit] Which makes me realize that the submitter for the original was him:
[https://news.ycombinator.com/user?id=pr_fancycorn](https://news.ycombinator.com/user?id=pr_fancycorn)
\- so that may lead to some way to contact him.

~~~
taliesinb
Ah, thank you!

------
univacky
In the mid 80s, I had (and still have) a Sperry PC, an 8088 IBM PC clone with
a crazy "hi resolution" graphics adapter that was two full length cards with a
bridging cable and more memory than the motherboard. Doing all my programming
in assembly language at the time, and not having the money for an 8087 math
coprocessor, I bought the Mark Williams Let's C compiler to have a floating
point library to draw Mandelbrot sets.

I quickly decided it was a shame to let a perfectly good compiler go to waste
and learned C.

Most 640x400 images were taking 25-32 hours to produce, depending on where
they were. I started writing a fixed-point library, and then found Fractint
and just wrote a graphics driver for the Sperry adapter. The same images
generated in only 8 minutes.

Tell that to the kids today, and they won't believe you.

------
kriro
Oh the conicidence. I'm currently reading Gleick's "Chaos..."...a little too
layman so far but a fun read nontheless, recommended.

On the site...Pascal's triangle (%2 and other mods) is particularly
fascinating to me.

~~~
bcbrown
That's the book that got me interested in fractals and mathematics back in
high school. If you want a non-layman text, check out
[http://www.amazon.com/Chaos-Fractals-New-Frontiers-
Science/d...](http://www.amazon.com/Chaos-Fractals-New-Frontiers-
Science/dp/0387202293)

------
stestagg
The only thing I've discovered that's missing from this page is a variation of
the 'Chaos' pattern, but with an extra 'corner' added at the center of the
shape. This way, a square which normally looks like a grey square starts to
have some pretty interesting patterns.

There's a playground for this here:
[http://stestagg.github.io/Sierp.js/](http://stestagg.github.io/Sierp.js/) \-
chrome/ff only

~~~
stestagg
Actaully, animated rotating 3d pointclouds are quite interesting too:
[https://github.com/stestagg/Personal/tree/master/Sierp.3d/sa...](https://github.com/stestagg/Personal/tree/master/Sierp.3d/samples)

------
inDigiNeous
Very cool variations on the same theme. Surprised how deep the author went on
this subject.

If you want to play around with this kind of recursive shapes, I would suggest
to try out [http://GeoKone.NET](http://GeoKone.NET), it's an application I've
developed that let's you create this kind of formations interactively in your
browser.

Well, at least the kind of formations on the first half of the page or so.

------
devindotcom
Love this page. It's in my bookmarks as "Sierpinski WARNING" in case I forget
it basically takes over my entire machine when it loads.

------
neop
A few years ago I wrote an article explaining how the chaos game works with
high school level math, and a few couple of fun experiments that you can do
with it. If anyone's interested you can read the article here:
[http://shiftingmind.com/chaosgame/](http://shiftingmind.com/chaosgame/)

------
drostie
There are some connections which the author doesn't make which I find a little
surprisingly unsaid.

For example, of course you find the Sierpinski pattern under disjointness.
Here's some LiveScript to handle disjointness with integers representing
bitwise vectors of "x is in the set" (1) or "x is not in the set" (0):

    
    
        fmt = (x) -> if x then 'o' else ' '
        display = console.log . (.join '\n') . (.map (.join '')) . (.map (.map fmt))
        display [[(x .&. y) == 0 for y from 0 to 63] for x from 0 to 63]
    

This displays the 64x64 Sierpinski just fine. Why does it do that? Recursion.
Look at the (x, y) pairs when we go from size 2^n to 2^(n + 1): there are four
quadrants corresponding to the original (x, y) pairs:

    
    
        (x, y)       (x + 2^n, y)
        (x, y + 2^n) (x + 2^n, y + 2^n)
    

But this is just adding one more bit to our bitmask: clearly the pattern we
see in the first three quadrants is simply the pattern we had before; the
pattern in the last is blank. It's that recursion which does Sierpinski
recursion.

Now, of _course_ if you find a Sierpinski triangle under the is_disjoint_from
relation, you find it under the is_subset_of operation -- because A is
disjoint from B if and only if B is a subset of the set-complement of A. So as
long as your picture "mirrors" in one axis under set complements, of course
you're going to see the same pattern for subsets as for disjoints.

The same thing happens when the author says, "The binary operation I found in
our little binary binomial table was NOTing n, ANDing the result with k, and
then NOTing that: ¬(¬n∧k) = n∨¬k." If you have had a logic course, this result
"either A or not-B" should look like the expression for "A implies B", a
statement that in all the possibilities that we are thinking about, knowing
that you are in a situation where A is true means that you know that you're in
a situation where B is also true.

Or, put a different way, the situations where B is true _are a subset of_ the
situations where A is true. So you can take the subset-of relation and
immediately turn it into that binary formula; and conversely this explains why
the author complains, "I had to list the subsets in precisely this order to
get the right result" \-- basically, you have to count in binary to get the
right result. (To go the other way you just need the "all true" value -- that
is, this formula "A or not B" must hold for all circumstances, so subset-of
would in the above code look like `63 == (x .|. 63 - y)`.)

------
Demiurge
Seems like a deep exploration of visualizing math. However, I'm not able to
quickly deduce whether any of this is useful to real world problems. Does
anyone know?

------
kzrdude
Wow, this is cool. Should I get Mathematica? Is it fundamentally ahead of open
source systems like SAGE for example?

------
lmm
> What do you get when you methodically build a Lisp on top of symbolic
> replacement semantics?

TCL? :P

------
snogglethorpe
Well, it's certainly the Sierpinski triangle page to end my browser.... ><

------
tempodox
What's the language of the sources?

~~~
drodgers
Wolfram Mathematica. It's very high-level language for doing maths. In some
ways it's more like a software package with a text interface than a general
programming language.

------
vinceguidry
This is how I want to spend old age.

~~~
dsfsdfd
yup. If only I had the time :)

------
keikun17
Most briliant explanation i've ever read on how to triforce.

------
oklok
jesus so confusiong

------
oklok
hello

