The Chaos Game in Pentagon, Octagon, and Square (math visualization)

Sdílet
Vložit
  • čas přidán 9. 03. 2023
  • To buy me a coffee, head over to www.buymeacoffee.com/VisualPr...
    Thanks!
    In this video, we explore the differences between starting with a random dot in a regular pentagon, octagon, and square and iterating the procedure of choosing a vertex (or midpoint for square) at random and moving a given distance from the current dot to the chosen vertex. In each case, the limiting set is fascinating.
    If you like this video, check out my others and consider subscribing. Thanks!
    #chaos #chaosgame #pentagon #square #octagon #mathvideo​ #math​ #mtbos​ #manim​ #animation​ #theorem​​​ #iteachmath #mathematics #dynamicalsystems #iteratedfunctionsystem #dynamics #fractals
    For more videos related to the Chaos game from me, see
    • Chaos Game in a Hexagon
    • Mandelbrot Quintet Fra...
    • Twin Dragon Fractal (a...
    • The Lévy Dragon from t...
    • Chaos game - Sierpinsk...
    • Shorts
    • Shorts
    If you want to know more about the Chaos game, see the following links:
    en.wikipedia.org/wiki/Chaos_game
    mathworld.wolfram.com/ChaosGa...
    math.bu.edu/DYSYS/chaos-game/...
    • Chaos Game - Numberphile
    • Chaos Game | Fractals ...
    See more here (larryriddle.agnesscott.org/sy...) and on his website: larryriddle.agnesscott.org/if...
    To learn more about animating with manim, check out:
    manim.community
    _________________________________________
    Music in this video:
    Behind The Sun by Vlad Gluschenko | / vgl9
    Music promoted by www.free-stock-music.com
    Creative Commons / Attribution 3.0 Unported License (CC BY 3.0)
    creativecommons.org/licenses/...

Komentáře • 35

  • @ottlight
    @ottlight Před rokem +7

    i created a program where you can do chaos game in any regular polygon while also adding restrictoons on which verticies it can select( such as not being able to select a vertex 2 away on a pentagon or not being able ro select the same vertex twice in a row)

  • @PhilBoswell
    @PhilBoswell Před rokem +18

    It might be nice to explain at some point why 0·618 is used in the pentagon: I vaguely recognise it as related to the Golden Ratio and thereby √5 but why have you used that particular quantity? Same for √2/2 for the octagon and 2/3 for the square: why do these numbers work?

    • @jakobr_
      @jakobr_ Před rokem +7

      0.618 is 1/phi
      If the side length is 1, then the length of a pentagon’s diagonal (from one vertex to another not along a side) is phi.
      So if that diagonal length is 1, then the side length is 1/phi. Look across the horizontal diagonal: pink, light blue, yellow. The light blue and yellow distance is exactly the same as the side of the pentagon (1/phi).
      Imagine the pink corner is chosen. For a point close to the yellow corner, it’s enough to go 1/phi to guarantee that the new point is in the pink pentagon.

    • @MathVisualProofs
      @MathVisualProofs  Před rokem +3

      Maybe I’ll try a follow up. But I like the wonder this is inspiring in the comments :)

    • @J7Handle
      @J7Handle Před rokem +5

      In order to understand this process, imagine it in a slightly different way. Imagine taking a whole pentagon, and scaling it down while keeping one vertex pinned in place.
      The effective result is that every single point in the pentagon has been moved toward the pinned vertex by a common proportion of their distance from that vertex.
      Doing a separate copy of this procedure for each vertex as the pinned vertex yields 5 miniaturized pentagons. The next step of making the fractal simply repeats this process, but instead of scaling down the full scale pentagon, you’re scaling down the resulting figure at each step.
      In order to acquire the desired fractal, the scaled down pentagons must be just the right size to touch at their vertices.
      Looking at the pentagon figure, if the side length of the outer pentagon is 1, and the side length of the next largest pentagon (the scale factor) is x, we have 1 - x = sqrt(x) -> x^2 - 2x + 1 = x -> x^2 = 3x - 1, doesn’t look familiar?
      Well for the chaos game, we don’t actually move points by the scale factor but by 1 minus the scale factor, so let’s set y = 1 - x -> x = 1 - y -> (1 - y)^2 = 3(1 - y) - 1 -> y^2 - 2y + 1 = 2 - 3y -> y^2 = -y + 1. Okay, this should be familiar. This indicates y is the negative golden ratio. Since we want y to be positive, we take the negative version of the golden ratio, giving us y ~= 0.618.
      A similar game for the octagon and square, though the square includes the midpoints as pinnable, so it’s a bit different.

    • @potaatobaked7013
      @potaatobaked7013 Před rokem

      @@J7Handle I've never seen a proper explanation on why the chaos game works at all. Thank you! It makes more sense now

  • @alexthi
    @alexthi Před rokem +1

    I spent some time studying a variant of the square case, in which you take the midpoint, but never pick the same vertex twice in a row. The resulting set is quite fascinating, fractal but not self-similar. I found a characterization of the limit set using the binary representation of the coordinates, and was even able to make a 3D render of the cube version in Blender!

    • @MathVisualProofs
      @MathVisualProofs  Před rokem +1

      Nice! I bet the Blender version is quite excellent to look at!

    • @alexthi
      @alexthi Před rokem +1

      @@MathVisualProofs I am quite proud of it! It's my desktop background now :)

    • @MathVisualProofs
      @MathVisualProofs  Před rokem +1

      @@alexthi That's a math win!

  • @monoman4083
    @monoman4083 Před rokem +1

    another great one. thanks..

  • @samueleprandini1024
    @samueleprandini1024 Před rokem +7

    Amazing work, dude! But how were the distances set? Is there a formula that can be generalized for a n-sides polygon?

    • @jakobr_
      @jakobr_ Před rokem +5

      Keep in mind that the process is different for the square in this video because the midpoints are included with the vertices.
      Triangle: 1/2
      Square: 1/2
      Pentagon: (sqrt(5)-1)/2
      Hexagon: 2/3
      Octagon: sqrt(1/2)
      These are the minimum ratios (travel this fraction of the distance to the selected vertex) that guarantee the resulting mini-polygons do not overlap.
      I think this is the idea: Look at all of a regular polygon’s diagonals, and take note of where they intersect other diagonals, as a fraction of the total length of that diagonal. Find the maximum of these over all diagonals, and there’s your number. (Triangles are the exception because they have no diagonals and the smaller ones don’t have any vertices that aren’t on an edge.)
      Edit: Looking closer, at the octagon, it’s clear that this method isn’t right. Clearly certain diagonals (2 away, 3 away) are more important than others (all the way across).

    • @MathVisualProofs
      @MathVisualProofs  Před rokem +1

      Can you work out what distances might work?

    • @jakobr_
      @jakobr_ Před rokem +2

      @@MathVisualProofs I gave this some more thought, and I figured something out but it’s not an explicit formula yet.
      The magic number for a regular n-gon is: d/(d+s) where s is the side length and d is the length of either the longest or second-longest diagonal. In cases where n = 0 mod 4, this is the second-longest diagonal, otherwise it is the longest. (Note that an edge may be considered a “diagonal”, this is important for n=3,4)

    • @MathVisualProofs
      @MathVisualProofs  Před rokem

      @@jakobr_ nice!

  • @GSGOVIND1729
    @GSGOVIND1729 Před rokem +1

    Nice one:)

  • @Lasersharp
    @Lasersharp Před rokem +1

    Question about this algorithm - does it also work if, rather than randomly choosing a point at the beginning, the point you start with is actually one of the vertices themselves? So your next point chosen will be at the specified distance between that vertex and another one, and then the algorithm continues from there.
    This would eliminate the possibility of starting on a random point that's not on the fractal.

  • @jakobthomsen1595
    @jakobthomsen1595 Před 10 měsíci +1

    Interesting. Is there a general formula for chaos game in an n-gon ?

    • @MathVisualProofs
      @MathVisualProofs  Před 10 měsíci

      I think there probably is. But I don’t know it or remember it if I leaned it :) check the links in the description to find out more

  • @shrimpscampy
    @shrimpscampy Před rokem +3

    Me who puts the dot directly in the center:

    • @MathVisualProofs
      @MathVisualProofs  Před rokem +1

      Haha! It still ends here just with a few outliers :)

    • @catherinebernard3282
      @catherinebernard3282 Před rokem +3

      It still eventually recreates the pattern, you just have a dot in the center

  • @ashisrout8400
    @ashisrout8400 Před rokem

    Is it practicaly possible to play with friends?

    • @MathVisualProofs
      @MathVisualProofs  Před rokem +1

      What do you mean?

    • @ashisrout8400
      @ashisrout8400 Před rokem +1

      @@MathVisualProofs I was planning to play this with my friends, and astonish them with this figure, but it is quite difficult...

    • @MathVisualProofs
      @MathVisualProofs  Před rokem +1

      @@ashisrout8400 Oh! Hah! Make sure to have fun with friends too. The math will always be there later :)

  • @BalderOdinson
    @BalderOdinson Před rokem +1

    Well...I saw something neat, but don't feel I learned anything. Without any explanations, how is this a proof? Not even a mention of what it's a proof for...

    • @MathVisualProofs
      @MathVisualProofs  Před rokem

      Not a proof here besides the fact that I showed it happen randomly. There are linked resources in the description if you want to know more.

    • @BalderOdinson
      @BalderOdinson Před rokem

      @@MathVisualProofs but *what* was proven? If it's a proof that an algorithm can produce a pattern, then I'm with ya ;-)

    • @MathVisualProofs
      @MathVisualProofs  Před rokem +1

      @@BalderOdinson It's not that a pattern shows up, but that THIS same pattern always shows up no matter what random choices occur along the way. :)