How I made my own Fractal

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
[Music] hey everyone this is kavina here and welcome back to another video a fractal can be colloquially defined as a self-similar shape for example one that contains within it multiple smaller versions of itself based on just a few simple rules it can create really intricate patterns if you come up with an interesting iterative process it's usually pretty easy to implement it with computer code and generate some beautiful fractals and so that's exactly what i did i made my own fractal and it looks like this i call it the kuvina triangle here's how it works so you've probably seen pascal's triangle you know the thing where you start with a one and then go down row by row and to determine each new number you just add the two above it treating blank spaces as zeros my fractal is very similar but instead of adding the two numbers above you're adding three numbers to do this we can rearrange the numbers from a triangular grid into a square one again we start off with an empty row except for a singular one this is row zero then for each cell in the next row we determine its number by adding the three above so row one consists of one one and one row two consists of one two three two and one and this process goes on and on for every row so this is all well and good but how is this a fractal well to form the fractal we need to change the rules a bit instead of just adding the three above we're going to take that sum and put it through the modulo operator by 4 this is the same as dividing by 4 and taking the remainder that remainder has a cyclical pattern of 0 1 2 3 and then repeats when we calculate a few rows this way it looks like this now since we only have four possible numbers we can assign a color to each one in this case zero is black one is cyan two is blue and three is magenta when you let that run for 256 generations you end up with this i could go on and on about all the interesting things you can notice like however you row at a power of two contains the pattern one two three two one or how blue can be found in isolation but cyan and magenta are always found together but i think the coolest thing has to be these black triangles if we set all non-zero values to the same color we can get a closer look there are clearly patterns to the madness like rows of 4 groups of 6 or lines of 12 but it's just so hard to predict where these patterns will show up despite this every time we double the number of rows we get the same triangle but with higher resolution and more intricate patterns but if you think this one is cool just wait till you see the rest because this fractal actually has an infinite number of siblings this one was defined by looking at the three squares above and taking their sum mod 4 but this 4 was actually only chosen because it's my favorite whole number in fact we can use any whole number greater than one so what do those look like well first we're going to have to define a color scheme that can be auto-generated for each number n so here's how it works 0 is always black then for the remaining n minus 1 we give them different hues at evenly spaced intervals with saturation and value set to maximum starting off with level 2 we get this if these patterns look familiar that's because they're actually the same as the isolated blue sections of level 4. and it does make some sense when you think about it because with 2s and 0s mod 4 we're always going to be stuck with even numbers then we get to level 3 which looks like this if this one is familiar that's because it's actually very similar to another famous fractal the sierpinski triangle where a triangle of emptiness divides the fractal into three copies of itself in this one though you have triplets of triangles dividing it into six copies of itself and then this is what four looks like in the auto-generated color scheme next is level five you can see it starts off with a row of two triangles then a row of four and a row of six then there's another row of six but two of them are double length after that is a growth two again but the triangles are four times the length and this pattern repeats with these bigger triangles which you could just barely see down here and then there's level six where i began to notice something if you remove this turquoise color corresponding to three the pattern of black triangles is actually the exact same as level three but if you remove blue and chartreuse corresponding to two and four the pattern is identical to level two in other words level six contains features from both levels two and three two and three are actually the factors of six and this is no coincidence in fact prime numbers always produce unique patterns of triangles and composite numbers reflect the prime numbers that make them up and so maybe it doesn't come as a surprise but level 7 features another unique triangle pattern this time it's rows of 2 4 5 8 10 and 8 again which is too far down but you can see it in the smaller version then it repeats on a larger scale then there's level 8. if we eliminate the number 4 we're left with level 4's pattern then if we eliminate all multiples of 2 we're left with level 2's pattern and now you can kind of see how prime patterns are represented in composite ones in level 9 you can eliminate multiples of 3 to get level 3. in level 10 you can eliminate 5 to get level 5 or multiples of 2 to get level 2 and there's just so much that could be said about each one but for now i'm just going to quickly show each number up to 27 and then a few highlights after that if you just want to get to the variance though then feel free to skip ahead by about one and a half minutes [Music] foreign [Music] so i hope you enjoyed all of those but there's actually a lot more that can be done with this idea instead of just using bigger and bigger numbers for the modular operation we can change the rule itself to something else the first thing i thought of was instead of adding the three above you add the two on the sides but subtract the one in the middle we can repeat this with every level of the original to get what i like to call the shadow version of it but surprisingly this actually barely changes anything in fact the shadow version of two is no different than the original for the rest the shadow versions are just like the originals but with slightly different color schemes which i think is pretty remarkable considering that one of the numbers is literally doing the opposite of its original purpose so we've tried adding the one in the middle and subtracting it but what about ignoring it and just using the sum of the other two this actually has the same effect as a spaced out pascal's triangle that can still produce very interesting results though so let's take a look at those since pascal's triangle can be used for binomial expansion i'm going to call these ones the bi versions so by 2 is actually just the sierpinski triangle not a weird version of it but just the original then by 3 is actually the same basic pattern as the original level 3 just scaled differently by 4 is just by 2 added onto itself since 4 is 2 times 2. then by 5 goes back to the basics again dividing itself into 15 smaller copies of itself arranged in a triangle with length 5. that's because 15 is actually the fifth triangle number by 6 is actually pretty similar to the original level 6 because you can eliminate 3 to get by 3 or eliminate 2 and 4 to get by 2. then by 7 divides itself into 28 copies because 28 is the 7th triangle number and at this point you can see the pattern prime numbers divide themselves into smaller copies arranged in a triangle while composite numbers are just combinations of their component factors just like the original fractals so these were made by ignoring the number in the middle but what if instead we ignore the one on the right well i'm going to call these the buy sku versions because it's just the buy versions but skewed to the right but now let's go back to the subtracting idea for a bit which gave us the shadow versions what if we add the ones on the left and in the middle but subtract the one on the right does it make another skewed triangle actually no it doesn't instead it's barely different than the originals or at least that's what i thought because the first ones i tried were shadows u4 and ii but then it got to shadow sku3 for whatever reason it actually makes a completely unique and never before seen pattern and then shadow skew 5 ends up looking like bi 5. shadow skew 6 shows us that these ones do continue the tradition of composite numbers reflecting patterns from their factors but then shadow sku7 has another new pattern it's very similar to regular level 7 but has slightly different triangle placement and the same thing keeps happening with all the shadow skew triangles out of all the variants i think the shadow sku variation has to be the most mysterious type my next idea was the following before the modula operator just add one i've decided to call these the psychedelic versions for reasons that will become apparent this is a very simple change but as huge consequences because now non-zero values can appear even when the three squares above are all zero starting at level two it looks like this instead of black voids we're left with black and red stripes then there's level three where instead of black we just have solid red at level 4 we're back to the red and black stripes again but then level 5 is where it gets crazy the black voids are replaced with a cycle of four colors and at this point you can begin to understand why i call these ones the psychedelic versions and the psychedelic theme continues for all numbers except for powers of three but it gets even better just like the originals each psychedelic triangle has its own shadow version where we subtract the one in the middle instead of adding it again level two is the same but then level three actually has a cycle of three stripes this time level four now has a cycle of four and five has five and i think you can see where this is going because by level seven you can clearly see that we get a beautiful rainbow forming and it just gets better and better as we keep going and if we set it to something like 107 then we can see the spectrum in its full glory and then there's one final idea that i had instead of adding the three numbers what if you multiply them this idea is very simple but it's hard to get it to work since the top row is all zeros except for one the next row will just be completely zeros to fix this you can make it start with three in a row but even still it just dies out if you want to get actual patterns you have to start with three in a row and make the rule be multiplying them and then adding one and this finally produces the product versions they can be pretty hard to look at so to combat this i've only done 64 generations for each one level two just has a striped background and a vertical line in the middle then level three has two lines forming a capital letter lambda and the stripes are offset within the narrow triangle it forms four is two times two so level four is just a fancy vertical line in the middle then level five starts off promising but then it just dies off which is honestly pretty sad level six is two times three so it has the narrow triangle from three and a line in the middle from two then level seven has a solid background for ones and it goes back to a wide triangle much like the original fractals level eight is two cubed so it's just a fancy vertical line level nine is three squared so it has a fancy capital lambda level ten is two times five so it dies off like level five but still retains the line from level 2. and then level 11 makes this interesting pine tree looking pattern and they basically continue with the same rules as always prime numbers make original patterns and composite numbers reflect the patterns of their factors so i'll just show a few highlights level 30 has rgb stripes with a rainbow line in the middle and level 48 is basically the opposite with pan colored stripes and an rgb line in the middle then level 67 we finally have a solid background again 102 makes this beautiful rainbow and 103 has a solid background then 222 has this weird divided rainbow and 223 is back to a solid color again and i do realize that for these last few i've been focusing on the backgrounds more so than the actual triangles but often in math the most interesting things are found when you're not looking for them and i think that's an important lesson to learn and a good way to invent your own fractals you come up with an interesting process and then keep modifying it and just see where it takes you you'll probably be surprised by the results this whole idea has an infinite number of potential variations but those are all the ones i have for today and now i leave you with a question which variation and which specific level was your favorite tell me in the comments i value comments a lot so i would really appreciate it also subscribe to the channel and watch my other videos because i have some exciting stuff planned that you won't want to miss thanks for watching and i'll see you next time [Music] foreign
Info
Channel: Kuvina Saydaki
Views: 78,448
Rating: undefined out of 5
Keywords: math, fractal, shapes, geometry, colors, rainbow, cute
Id: gQyIZWYZwns
Channel Id: undefined
Length: 17min 33sec (1053 seconds)
Published: Tue May 31 2022
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.