Introduction to fractals and recursion



Oh, it is supposed to direct you to the App Store
Are you on a desktop?


No, our school blocks the app store lol


Awe man, that's too bad


And I thought my parents were overprotective lol


Lol, same happened to me in Junior high
Wanna take this to my general?
JonnyGamer's General


Recursion is quite an interesting topic, especially when used in systems which don't natively support recursion. Take for example in lambda calculus, the U combinator (λx.x x) applied to itself: (λx.x x)(λx.x x)
This, when reduced, reduces to itself.

Modifying this expression into this lambda expression:

(λa.(λx.x x)(λx.x x a))
reduces to
(λx.x x a)(λx.x x a)
which reduces to
(λx.x x a)(λx.x x a)a
which reduces to
((λx.x x a)(λx.x x a)a)a
and so on.

This example of recursion isn't particularly useful, but another modified form of the U-combinator, the Y-combinator (λf.(λx.f(x x))(λx.f(x x))) is useful though.


Wow thanks for sharing, I had not thought about recursion in maths that much before :open_mouth: just mostly in programming and computer science. I know only some calculus, have not heard of lambda calculus before :hushed:

Edit: oh I just looked it up briefly, I see it can be applied to maths, computer science and linguistics, I am visiting your other topic :slight_smile:


Here is some binary trees but in Hopscotch:

Recursion where each branch is a smaller version of the whole thing :grin:

  • recursion is where each sub-problem 'looks like' the original problem

I was going to leave the more formal stuff to another topic but may as well mention some things here :slight_smile:

Here is some comparison between some code in another drag and drop language and the code in Hopscotch, the main difference is that the other language has functions and arguments whereas Hopscotch does not:

Luckily we can replicate this feature :slight_smile::

The thing is though, when you use a variable each time you recurse the function, you want to be able to retain that value ... it's a bit hard to explain.

But you can see in the code that each time I call the ability again, I multiplying length by a ratio, and it will remain that way even when I need to use the previous value that length was. Hence the undoing of that by dividing the length by that same ratio after the call...

(There's another way to do the 'undoing' of an argument, and that is by undoing it at the end of the ability, but I don't think all of this makes much sense until someone sees it for themselves though.)


Congrats on the feature!!!!


Thanks @JonnyGamer :smile: (I was not expecting it! – this was just for fun :joy:)


I just found out more fractals, even made in Minecraft!

And found out about names of other ones called:

  • Sierpinski pyramid (3d version of Sierpinski triangle)
  • square Sierpinski carpet
  • Menger sponge


Ooh! Nice!
I also found this free fractal app!


Wooah that sounds cool! Tempted to do coding for a lot of them... :yum: drawings can take a bit of a while to load on Hopscotch though.