Introduction to fractals and recursion

#21

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

#22

No, our school blocks the app store lol

#23

#24

And I thought my parents were overprotective lol
LGBOT

#25

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

#26

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.

#27

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

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

#28

Here is some binary trees but in Hopscotch:

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

• 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

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 :

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.)

#29

Congrats on the feature!!!!

#30

Thanks @JonnyGamer (I was not expecting it! â this was just for fun )

#31

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

http://www.fractal-explorer.com/minecraftbasics.html

And found out about names of other ones called:

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

#32

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

#33

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