Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

2
  • \$\begingroup\$ how the... what? \$\endgroup\$ Commented Apr 3, 2013 at 17:16
  • 4
    \$\begingroup\$ The code exploits the property of Pascal's triangle that if you colour all the odd (even) numbers black (white), you end up with the Sierpinski triangle. (see this image). i.32 generates the list 0 1 2 ... 31. Then !/~ computes the binomial coefficients of each element in the list against itself, i.e. produces a 32 x 32 matrix which has Pascal's triangle embedded in it. Then 2| is simply each element in this matrix mod 2, producing Sierpinski's triangle. \$\endgroup\$ Commented Apr 7, 2013 at 17:55