2 Feb.: Iterated Function Systems (IFS).
We derived the IFS for the Cantor set and the von Koch curve. In general,
to derive the IFS of a fractal (this is the problem of encoding
a fractal), look first at a way to decompose the fractal into self-similar
pieces and then which affine transformations w_i
(i.e., w_i = A + v where A is a
2 by 2 matrix and v is a vector in R^2 (the 'shift') ) will map the fractal F
onto these pieces, i.e., w_i(F) = F_i. See the
28 January comments from last year and page 239
in the text.
For a review of matrices as transformations, read pages 234-236
in the text.
We did some experiments with the
Fractal Pattern VB program and the
Fractal Movie applet. For example,
using the Fractal Pattern program we saw what
happens if one of the transformations that make up an IFS is not a
'contraction'; the image 'explodes' (it keeps changing as the IFS
iterates). For this I modified the Sierpinski IFS to make the third
transformation (the one that produces the square on the top in the
blue print) a dilation by 1.5 (so the entries are a = 1.5,
b = 0, c = 0, d = 1.5, in
the matrix and the shift was e = 0, f = 0).
You can see for yourself the 'Sierpinski variations' that are displayed
on pages 246-248 of the text by using this program. In addition, you
can make up your own fractal (just make sure the 'p' parameter is set to
1/k if there are k transformations in your IFS; this is for the 'Chaos
Game' command ('Chaos Game' button)
that will draw the fractal - remember, the 'Chaos Game'
is much more efficient in drawing the fractal than iterating the IFS (this is
the 'Fractal' command button).
With the applet Fractal Movie,
we saw how sliding the top transformation of the
Sierpinski IFS from one side to the other affects the resulting fractal.
Here, the initial w_3 transformation was (a,b,c,d,e,f) = (0.5, 0, 0, 0.5,
0, 0.5) and the final w_3 transformation was (0.5, 0, 0, 0.5, 0.5, 0.5).
Note that you can check the blueprints of these transformation (as well
as a bigger picture of the resulting fractals) using the VB program
Fractal Pattern
(input the above parameter values for w_3 of the Sierpinski
data).
Using the applet Fractal Movie
we also saw how rotating the top transformation of the sierpinski
transformation changes the fractal (here, the initial w_3 transformation
was (0.5, 0, 0, 0.5, 0.25, 0.5) and the final w_3 transformation
was (0, -0.5, 0.5, 0, 0.75, 0.5) ). You may want to look at these initial
and final blueprints using the VB program Fractal Pattern
just to see what they are.
The final w_3 transformation is the initial one rotated by 90 degrees
counter clockwise (see page 235 to remind yourself what the matrix of
a rotation is). Can you identify which of the
Sierpinski variations the final fractal is? (look at Figure
5.21)
With the applet Fractal Movie
we looked at the transformation of the von Koch curve into the Fern
(like Figure 5.36); here we took the intial pattern to be the von Koch
curve and the final pattern to be the Fern.
16 Feb. : The Chaos Game (continued).
Finding the 'rules' of the chaos game: we derived the formula
(*) z_(k+1) = q_i + A_i(z_k - q_i)
where z_k is the current game point
and z_(k+1) is the next game point, obtained by applying the
transformation w_i to z_k (so the number i was chosen randomly at that
iteration of the game). Here, w_i = A_i + v_i, where
A_i is a matrix and v_i is the shift vector, and q_i is the fixed point of
w_i (we obtained formula (*) by solving the equation w_i(q_i) = q_i for
v_i, and then substituting that into the equation z_(k+1) = w_i(z_k) ).
From this we can find the rules of the game in
'plain english'. For example, if the IFS is for the Sierpinski triangle,
then each A_i is the matrix (a,b,c,d) = (0.5, 0, 0, 0.5),
and equation (*) reads "from z_k move one-half the distance towards
the point q_i".
If the IFS is for the Sierpinski variation, where w_1 and w_2 are as for the
Sierpinski IFS, but w_3 is dilation by 0.5 followed by rotation by 90
degrees counterclockwise, then if 3 is chosen
at that iteration of the game, (*) reads, "from z_k move one half the
distance towards the point p_3, and then rotate by 90 degrees counterclockwise
about the point p_3". The rules for moving the game point when 2 or 3 are
chosen are as for the Sierpinski game.
Adjusting the probabilities (Section 6.3; pages 321 - 327).
Note that a run of the chaos game for an IFS with k transformations
w_1,...,w_k
is determined by the sequence {s_i}
of random numbers from {1,2,...,k} and the initial game point z_0
(since the game points are {z_0, z_1 = w_s1(z_0), z_2 = w_s2 w_s1(z_0), ...} ). Let's consider the Sierpinski IFS (so {1,..k} = {1,2,3} and the random sequence {s_i} is a sequence of 1's, 2's and 3's). Whenever a 1 appears in the sequence {s_i}, the transformation w_1 is applied to the
current game point to obtain the next game point. If the initial
game point z_0 is on the fractal, then all subsequent game points will
be on the fractal (in particular, z_k is on the fractal),
so the next game point z_(k+1) = w_1(z_k) will land in the triangle
D_1 with address 1 (see page 317). More generally, if the string
t_1...t_m of integers of 1's, 2's, and 3's
appears in the sequence {s_i}, then a game point will
land in the small triangle with address t_m...t_1. So to determine how
many game points will lie in some small triangle with address t_m...t_1,
you need to know how many times the string t_1...t_m appears in the
sequence {s_i}. This can be calculated knowing the probabilities
p_1, p_2 and p_3. By the definition of probability, the
probability that the string t_1...t_m occurs is p_(t_1)p(t_2)...p_(t_m)
(the product of probabilities; if p_1=p_2=p_3=1/3, then
this product is (1/3)^m). Call this number p. Then if the
chaos game is played with 10,000 game points (so the sequence of random
numbers {s_i}
is of length 10,000), then we expect (10,000)(p) points to land in the
triangle with address t_1...t_m (see page 325, 326).
Now we can understand what affect changing the probabilities p_1,p_2,p_3
has on the image obtained with the chaos game. If the product
p = p_(t_1)p_(t_2)...p_(t_m) is small, then few points will lie in
the small triangle with the address t_1...t_m, while if the product p
is large then a lot of points will lie in that small triangle. See
Figure 6.21. Applying these ideas to the Barnsley Fern fractal, we saw
how the chaos game with equal probabilities p_i = 1/4
can not draw the complete fern (see Figure 6.4). However,
after adjusting the probabilities we are able to draw the fractal
(page 326). To understand this, we need to assign addresses to
the fern like we did with the Sierpinsli triangle; see Figures 5.48
and 6.24.
We did some 'experiments' with the
Fractal Movie applet where we adjusted the probabilities p
of the blue print. The examples shown in class were;
- Start pattern: Sierpinski (via drop down menu). Final
Pattern: Sierpinski, but with p_1 = 0, p_2 = 0, and p_3 = 1.
Here we see the effect of decreasing the probability p_1 and p_2;
more applications of w_1 than w_2 and w_3, so those regions of
the fractal with addresses that contain 1's will be more populated
than those adresses with few 1's. (Try with m = 200, # of iterations =
50,000.)
- Start Pattern: Fern (via drop down menu), but with
equal probabilities p_1 = p_2 = p_3 = p_4 = 1/4.
End Pattern: Fern (via drop down menu, and the 'optimal'
probabilities given there). In this experiment we see how adjusting the
probabilities from equal to non-equal results in a much improved image.
(Try with m=200, # iterations = 10,000.)
- Start Pattern: Full Square (via drop down menu).
End Pattern: Full Square, but with probabilities p_1 = p_3 = 0.5 and
p_2 = p_4 = 0 (try with m = 200, # of iterations = 50,000).
Thus, the final fractal has just the 'lenses' w_1 and
w_3 so the final fractal is the diagonal line. But at intermediate
stages we see a complicated set of 'images' of the main diagonal line.
At intermediate stages the main diagonal line is the 'brightest'
line because the transformations w_1 and w_3 are applied more often
in the chaos game at that stage (remember that this applet draws
the fractal at each time step m by running the chaos game for the
parameters defined at that stage). If w_1 and w_3 are applied
several times, the game points move towards the main diagonal and
so game points are more dense near the main diagonal. Now, the
'images' of the main diagonal are the result of applying the
transformations w_2 and/or w_4 to a game point that lies near the
main diagonal (and 'most' points are somewhere near the main
diagonal). The brightest of those 'image' lines is due to a single
application of w_2 or w_4. The fainter 'images' are due to
two or more applications of w_2 and/or w_4. Since multiple
applications of w_2 and/or w_4 occur less frequently than a single
application of w_2 or w_4, those 'image' lines are fainter than
the 'image' line produced by a single application of w_2 or w_4.
Now think about where a single application of w_2 or w_4 will send
a point that lies neat the main diagonal; then you will understand
why the brightest 'image' line is where it is (and similarly, why the
fainter 'image' lines are where they are). Can you explain the
pattern of squares that is superimposed on the intermediate
images?
See also the 21 Feb comments from last year.