Visualization of the Chaos Game for non-hyperbolic iterated function system

The chaos game is a random algorithm generally applied to contracting (hyperbolic) iterated function system (IFS) which makes it possible to obtain the unique attractor of the dynamic system. However, when applied to non-contractive IFS extremely interesting results can be obtained that are not only important from a theoretical and application point of view, but can also be part of a mathematical didactics that seeks to modernize teaching. In this sense, this research present some results related to the application of the chaos game to non-contracting IFS are presented. PALABRAS CLAVE: Chaos game, dynamic systems, iterated function system. RESUMEN El juego del caos es un algoritmo aleatorio generalmente aplicado a sistemas de funciones iteradas (IFS) contractivas (hiperbólicas), lo que hace posible obtener un único atractor del sistema dinámico. Sin embargo, cuando se aplica a IFS no contractivos se pueden obtener resultados extremadamente interesantes que no solo son importantes desde el punto de vista teórico y de aplicación, sino que puede ser parte de la didáctica matemática que busque modernizar la enseñanza. En este sentido, https://doi.org/10.35290/ro.v1n2.2020.302


Introduction
The chaos game is an algorithm that serves to create fractal figures (M. Barnsley, 1988Barnsley, , 2004Barnsley, , 2006; M. Barnsley & Vince, 2011). Traditionally it has been visualized for contractive or contractive on average iterative function systems (IFS), such that the theorem of the contractive mapping guarantees the existence of a single attractor (M. Barnsley, 2006;Peitgen, Jürgens, & Saupe, 2004), one of the best-known cases is the Sierpinski triangle. A great contribution to the generalization of the chaos game to non-contractive IFS was proposed by Barnsley and Vince (2011) where it is exposed how the chaos game can be used to obtain the attractor of general IFS if the system has a single attractor. However, in the works that this document is aware of, no varied literature has been found related to the visualization of the chaos game corresponding to noncontractive IFS, both in cases where a single attractor is obtained and in which no.
Although theoretical progress has been made in the cases of non-hyperbolic IFS (M. Barnsley & Vince, 2011;Díaz & Matias, 2018;La Torre & Mendivil, 2013) this paper do not seek to present theoretical aspects that contribute to the works of these authors and theory in general, but it is sought to show the figures that result from applying the chaos game, with special emphasis on how functions and linear transformations associated with a non-hyperbolic IFS can create beautiful and complex but not necessarily fractal figures.
The visualization is significant particularly in math teaching didactics, as it is important to establish relations of what is being looking at and what it stated in a formal symbolic way (Gatica & Ares, 2012). Even though, this investigation is not approached from an education point of view but from a general way that seeks to encourage the interested in topics that are non-typical in today math curriculum.

Hyperbolic IFS
First let's consider some fundamental definitions that are necessary to understand the difference between a contractive and a non-contractive IFS.

Definition 1. An iterated function system or IFS consists of a finite sequence of transformations
for where is an integer and is a complete metric space. An IFS is usually denoted by .
An IFS with probabilities consist of and IFS and a sequence of probabilities positive real numbers such that , thus each function is associated with a probability.
Definition 2. A transformation in a metric space is called contractive if the scale factor s is less than one and equal or greater than zero, thus the distance associate to the metric space is given by equation 1. A full proof of theorem 1 is detailed in Barnsley (1995). Many visualizations of chaos game according to eq. 2 can be reviewed in literature (Devaney, 2018;Fabre, 2011;Garrison, 2016;Huisman, 2017;Piretzidis, 2020;Wang-Hoyer, 2020). However, this work shows what happen when the conditions of this theorem are not fulfilled. Therefore, the difference is reduced to the scaling factor such that s is greater than one, thus obtaining a non-hyperbolic IFS. This change that seems insignificant makes a big difference in the behaviour of the dynamic system.

Methodology
Be a set of points called from now vertices located in a circle of radius one and be any point i P the chaos game considered in this article is to move in the direction of any vertex (selected with a p probability that for simplicity is equal for each vertex) according to a scaling factor s in such a way to obtain a new point 1 i P + , this is held theoretically infinite times; although is constrain to around 7 10 iterations due to hardware restriction. So, all the results shown were obtained by applying equation 3 following the proposed methodology. For this a programming in MATLAB was used. k is a factor such that this is a generalization of a hyperbolic IFS where ; v n x = and v n y = are the coordinates of the n vertex randomly selected; T is a rotation transformation.
Equation 3 can be modified and different results will be obtained, it is possible to add not only rotations, but also translations, reflections and shears, that is, different transformations. This means that the results shown below apply to all these cases in general.

Results
Although the dynamic system studied is not contractive, the points obtained from the iterations can be delimited to a closed set or can quickly tend to infinity, thus having or not a unique attractor.
Hence, an interesting question to ask is the following: ¿from which scaling factor value does the system quickly tend to infinity? To answer this question from a geometric point of view consider figure 1 (i) where any two vertices ( 1 v and 2 v ) are shown at a distance between them, in addition there is a distance d to any point . The general idea is to find a scaling factor such that the maximum distance between the point of the next iteration 1 i P + and any vertex is less than or equal to the maximum distance (Euclidean) between the point i P and the vertices, this guarantees that successive iterations are within a closed set of points. This can be written in an inequality form (4).
Where s is the scaling factor such that 1 s k = ; maximum distance between any two vertices; d maximum distance between point and vertices; By rearranging 4, we get and inequality in terms of s (5). and 0 s > The graph of this inequality with is shown in Figure 1 (ii), a simple intuitive interpretation of this result can be explained as follows: since the scaling factor s is assumed constant, for small values of d the distance between the points of the iterations and the vertices will increase but the increase will be contained in the limit to infinity of the iterations if the scaling factor is less than 2, otherwise the points will go away more and more from the vertices and quickly diverge to infinity (recalling that this is an iterative process).

Source: P. J. Mavares, 2020
The previous result is very simple; it enhances the understanding of chaotic dynamical system, particularly the chaos game. Although this work does not intend to discuss in deep about the contributions of the chaos game to math education, obtaining and interpreting inequality 5 from the proposed question can be a small challenge to students since it could improve the reasoning of application of inequalities beyond just the resolution of structured exercises. To visualize the above, consider Figure 2 which shows the case for a scaling factor of 1.25, thus 1 s > and the functions are non-contractive; however it is noted that successive iterations converge, including a fractal figure even in a non-hyperbolic IFS. On the other hand, Figure 3 shows the behavior of the system for the singular case . In this case the system generates a set with a strong symmetry that grows as the iterations increase, that is, it does not converge to a single attractor.
Henceforth the starting point is considered as .
(i) (ii) (iii)  Therefore, a small change in the scaling factor ds such that 2 s ds + > will cause the points to move away from the vertices very quickly, this can see in Figure 4 (ii). In addition, it is remarkable that when the vertices can be approximated to a single point, so the points of each iteration will lie on an approximated straight line (it is important to mention that visually it gives the impression of being a continuous line, but the behavior is discrete). It is clear that linear transformations applied affect the resulting set, in Figure 4 an example is presented with a rotation of 45°, and since 360 45 8°°= , eight uniformly separated sets of points arranged in a straight line will be obtained around the origin (since the vertices are fixed around it). An interesting result is the in which there is a small rotation angle 1 q <°, this will create a large number of points around the origin, which seems to generate a curve around (however the set of points is finite) resulting similar to a logarithmic spiral; therefore, in polar coordinates when the dynamic system can be expressed by equation 6.
Where: i r is the radius and is the angle of point i P in polar coordinates; 1 i r + is the radius of point 1 i P + in polar coordinates; s is the scaling factor; is the rotation angle; Unlike a hyperbolic IFS where it is guaranteed to have a single attractor regardless of the sequence of vertices selected for the iterations, Figure 6 evidence that for a scaling factor equal to two the set of points does depend on the order of selection of vertices (in each case created randomly thanks to MATLAB's rand function). In all cases, although the figures are not fractal, they are extremely beautiful, so it is again evident that chaotic dynamic systems can create extremely complex figures from very simple functions that without going into details of theoretical aspects and of applications, by themselves they seem created by an artist.

Conclusions
The chaos game has traditionally been used to obtain fractal figures in hyperbolic IFS. Despite this, its use for non-contracting systems is equally interesting, being able to generate figures with high beauty and symmetry. The visualization of the chaos game for non-hyperbolic IFS can be as striking as the presentation of the best-known fractal figures, which can generate interest on the part of the students in seeking to understand the theoretical foundations behind these dynamic systems, particularly it was visible that a small change in the scaling factor generates an abrupt change in the behavior of the dynamic system, therefore this serves as an intuition of what chaos is.
Dynamic systems have been interesting in recent years because they have hidden interesting patterns related to various aspects including mathematics, medicine, biology and nature in general. That is why it is recommended to investigate even more in non-hyperbolic systems, since they can still hide patterns to be found.