We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Functions and Fractals: Sierpinski triangles
Functions and Fractals: Sierpinski triangles
Sort by
recency
|
41 Discussions
|
Please Login in order to post a comment
The exploration of functions and fractals through the Sierpinski triangle beautifully demonstrates how simple mathematical rules can generate infinitely complex and self-similar patterns. It’s fascinating to see how repeated transformations — scaling, rotation, and translation — can produce such intricate geometric structures. Winbuzz Bet Login
Good post. Sierpinski triangles are not only visually striking but also serve as a gateway to understanding how mathematical functions can model natural and complex phenomena through fractals. Gurubhai247 Registration
I came up with a solution that updates a matrix like an image and prints the matrix as the output. Here is my solution in Ocaml
My recursion solution in Haskell:
This problem is about recursion and functional programming.
Let's discover recursion pattern. The first figure:
r = 1 (recursion level)
h = 4 (hight of the figure)
The second figure:
r = 2
h = 8
Each triangle with h=4 on the last picture has been submitted by the identical 3 other triangles with half hight (h'=h/2) and less level of recursion (r'=r-1) from the first picture.
Thus, recursion function looks like
where
and
The transpose(arr), rectangle(h), line(h) functions will help to solve this problem with no val or var :)