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.
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.
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.
I don't know exactly when (could be a math lesson) but when I have found memory of the Sierpinsky triangle, learned about it in class and programmed it in my home computer but it was very slow in BASIC, so I converted it in assembly language, much better.
Until I had access to a computer with a Pascal compiler and discovered that it was 'as fast as' assembly language and much easier to program.
Nice, vive Pascal but then I discovered that Pascal wasn't portable but C was so down to Pascal and here goes C (which I still like despite its numerous flaws)!
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...
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.
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.
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.
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, 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.
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/
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)`.)
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?
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.
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.
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.