Fractals. R. J. Renka 11/14/2016. Department of Computer Science & Engineering University of North Texas. R. J. Renka Fractals

Similar documents
Fractals and Dimension

NOTES ON BARNSLEY FERN

Take a line segment of length one unit and divide it into N equal old length. Take a square (dimension 2) of area one square unit and divide

Fractals. Justin Stevens. Lecture 12. Justin Stevens Fractals (Lecture 12) 1 / 14

INTRODUCTION TO FRACTAL GEOMETRY

Fractals and iteration function systems II Complex systems simulation

CMSC 425: Lecture 12 Procedural Generation: Fractals

Fractal Geometry Time Escape Algorithms and Fractal Dimension

Patterns in Nature 8 Fractals. Stephan Matthiesen

Expectations over Fractal Sets

The Order in Chaos. Jeremy Batterson. May 13, 2013

An Introduction to Self Similar Structures

An Investigation of Fractals and Fractal Dimension. Student: Ian Friesen Advisor: Dr. Andrew J. Dean

Fractals. Krzysztof Gdawiec.

Self-similar Fractals: Projections, Sections and Percolation

USING THE RANDOM ITERATION ALGORITHM TO CREATE FRACTALS

Examensarbete. Fractals and Computer Graphics. Meritxell Joanpere Salvadó

Hausdorff Measure. Jimmy Briggs and Tim Tyree. December 3, 2016

Analytic Continuation of Analytic (Fractal) Functions

Analysis III Theorems, Propositions & Lemmas... Oh My!

THE CONLEY ATTRACTORS OF AN ITERATED FUNCTION SYSTEM

Iterated Function Systems

Topological properties of Z p and Q p and Euclidean models

arxiv: v2 [math.ds] 17 Apr 2012

Chapter 8. Fractals. 8.1 Introduction

CHAOS/FRACTAL

Julia Sets and the Mandelbrot Set

CMSC 425: Lecture 11 Procedural Generation: Fractals and L-Systems

AN INTRODUCTION TO FRACTALS AND COMPLEXITY

Self-Referentiality, Fractels, and Applications

NOTIONS OF DIMENSION

FRACTALS: OBJECTS TO BETTER EXPLAIN OUR WORLD

CONTRACTION MAPPING & THE COLLAGE THEOREM Porter 1. Abstract

Aperiodic Substitution Tilings

UNIVERSITY OF TORONTO Faculty of Arts and Science DECEMBER 2011 EXAMINATIONS. MAT335H1F Solutions Chaos, Fractals and Dynamics Examiner: D.

Construction of Smooth Fractal Surfaces Using Hermite Fractal Interpolation Functions. P. Bouboulis, L. Dalla and M. Kostaki-Kosta

Contents Ordered Fields... 2 Ordered sets and fields... 2 Construction of the Reals 1: Dedekind Cuts... 2 Metric Spaces... 3

Math 320-2: Midterm 2 Practice Solutions Northwestern University, Winter 2015

V -variable fractals and superfractals

THE SHIFT SPACE FOR AN INFINITE ITERATED FUNCTION SYSTEM

Analysis Finite and Infinite Sets The Real Numbers The Cantor Set

Set-Theoretic Geometry

Mathematical Analysis Outline. William G. Faris

EXPECTATIONS OVER ATTRACTORS OF ITERATED FUNCTION SYSTEMS

Course 212: Academic Year Section 1: Metric Spaces

Approximation of the attractor of a countable iterated function system 1

Self-Simi lar Structure in Hilbert's Space-Fi l 1 ing Curve

Fractals list of fractals by Hausdoff dimension

Fractals list of fractals - Hausdorff dimension

Metric Spaces and Topology

Fractals: A Mathematical Framework

FINAL PROJECT TOPICS MATH 399, SPRING αx 0 x < α(1 x)

LAMC Intermediate Group October 18, Recursive Functions and Fractals

MATH 202B - Problem Set 5

MAT 570 REAL ANALYSIS LECTURE NOTES. Contents. 1. Sets Functions Countability Axiom of choice Equivalence relations 9

Immerse Metric Space Homework

Introduction to Chaotic Dynamics and Fractals

INTRODUCTION TO TOPOLOGY, MATH 141, PRACTICE PROBLEMS

AN EXPLORATION OF FRACTAL DIMENSION. Dolav Cohen. B.S., California State University, Chico, 2010 A REPORT

Hyperbolic Component Boundaries

April 13, We now extend the structure of the horseshoe to more general kinds of invariant. x (v) λ n v.

MATH 4200 HW: PROBLEM SET FOUR: METRIC SPACES

Iterated function systems on functions of bounded variation

Zoology of Fatou sets

AN INTRODUCTION TO FRACTALS AND COMPLEXITY

Chapter 2: Unconstrained Extrema

Singular Perturbations in the McMullen Domain

Notions such as convergent sequence and Cauchy sequence make sense for any metric space. Convergent Sequences are Cauchy

Introduction to Topology

HIDDEN VARIABLE BIVARIATE FRACTAL INTERPOLATION SURFACES

+ ε /2N) be the k th interval. k=1. k=1. k=1. k=1

Fast Basins and Branched Fractal Manifolds of Attractors of Iterated Function Systems

DYNAMICAL SYSTEMS PROBLEMS. asgor/ (1) Which of the following maps are topologically transitive (minimal,

3 (Due ). Let A X consist of points (x, y) such that either x or y is a rational number. Is A measurable? What is its Lebesgue measure?

Introduction to Real Analysis Alternative Chapter 1

Language-Restricted Iterated Function Systems, Koch Constructions, and L-systems

Region Description for Recognition

Math 5210, Definitions and Theorems on Metric Spaces

arxiv: v1 [math.ds] 31 Jul 2018

Changes to the third printing May 18, 2013 Measure, Topology, and Fractal Geometry

d(x n, x) d(x n, x nk ) + d(x nk, x) where we chose any fixed k > N

The Hausdorff Measure of the Attractor of an Iterated Function System with Parameter

Lozi-like maps. M. Misiurewicz and S. Štimac. May 13, 2017

Math 320-2: Final Exam Practice Solutions Northwestern University, Winter 2015

Spectral decimation & its applications to spectral analysis on infinite fractal lattices

Dynamics and time series: theory and applications. Stefano Marmi Scuola Normale Superiore Lecture 5, Feb 12, 2009

Metric Spaces Math 413 Honors Project

Based on the Appendix to B. Hasselblatt and A. Katok, A First Course in Dynamics, Cambridge University press,

BASICS OF FRACTAL GEOMETRY

Some Function Problems SOLUTIONS Isabel Vogt Last Edited: May 24, 2013

Integration on Measure Spaces

ITERATED FUNCTION SYSTEMS WITH A GIVEN CONTINUOUS STATIONARY DISTRIBUTION

Lecture 9 Metric spaces. The contraction fixed point theorem. The implicit function theorem. The existence of solutions to differenti. equations.

Math 426 Homework 4 Due 3 November 2017

Set Inversion Fractals

Fractals: How long is a piece of string?

Unconventional Space-filling Curves

ON THE DIAMETER OF THE ATTRACTOR OF AN IFS Serge Dubuc Raouf Hamzaoui Abstract We investigate methods for the evaluation of the diameter of the attrac

We are going to discuss what it means for a sequence to converge in three stages: First, we define what it means for a sequence to converge to zero

NATIONAL BOARD FOR HIGHER MATHEMATICS. Research Scholarships Screening Test. Saturday, January 20, Time Allowed: 150 Minutes Maximum Marks: 40

Transcription:

Fractals R. J. Renka Department of Computer Science & Engineering University of North Texas 11/14/2016

Introduction In graphics, fractals are used to produce natural scenes with irregular shapes, such as coastlines, clouds, forests, and rugged terrain. We begin with an example of an artificially constructed fractal. The triadic von Koch curve (Koch curve) can be constructed as follows. Begin with a line segment of length L = 1. Divide it into three equal-length segments, and replace the middle segment by two sides of an equilateral triangle as depicted in the figure on the following page for the transition from the order-0 prefractal to the order-1 prefractal. Then apply the same procedure to each of the four segments of the order-1 curve to get the order-2 prefractal. The Koch curve is the result of continuing this procedure ad infinitum. If, instead of starting with a line segment, we start with an equilateral triangle and apply the procedure to each side, we obtain the Koch snowflake.

Triadic von Koch Curve Order-0, L = 1 Order-1, L = (4/3) Order-2, L = (4/3) 2

Koch Snowflake

Definition of Fractal Since the order-k curve has length (4/3) k, the Koch curve has infinite length, despite being contained in a bounded region. The extent of the curve cannot be measured in one-dimensional units (length). Magnifying an arbitrarily small piece of the curve replicates the infinite-length curve. This is self-similarity. Defn: A fractal is a set of points (in R n ) whose (fractal) Hausdorff dimension is greater than its topological dimension. Roughly, topological dimension is the number of parameters needed to specify an arbitrary point in the set: one for a smooth curve, which is topologically equivalent (homeomorphic) to a line. More precisely, a countable set has topological dimension zero, and the dimension of a set S is one greater than the minimum dimension of sets that can completely separate any part of S from the rest. Since any part of the Koch curve can be completely separated from the rest by a point (zero-dimensional set), the Koch curve has topological dimension 1.

Fractal Dimension A simple planar curve has finite length 1 L = x (t) 2 + y (t) 2 dt 0 for x(t), y(t) C[0, 1] and x (t), y (t) piecewise continuous; i.e., with a finite number of discontinuities in the tangent. This includes any continuous curve that we can define by a finite number of expressions. A fractal curve must therefore be made of an infinite number of pieces. A smooth (piecewise C 1 ) curve, sufficiently magnified, is a line: f (t + t) f (t) + t f (t). While the lengths of polygonal approximations to a smooth curve converge to the curve length as the number of pieces increases, the approximations diverge to when applied to a nonsmooth curve. Fractals provide a means to artificially construct infinitely rugged curves and surfaces. The irregularity is repeated at all scales rather than disappearing under magnification.

Fractal Dimension continued The extent of a set can only be measured in units that are consistent with its dimension. 1 The area of a line, volume of a line or plane, and length of a point are zero. 2 The length of a 2-D region is infinite because an infinitely long curve can be contained in any 2-D region. If a k-dimensional unit is used to measure an n-dimensional set, the result will be 0 for n < k, and for n > k. The extent of a curve with fractal dimension larger than 1 cannot be measured in units of length. Fractal dimension D will be defined so that measuring the set with units of dimension D produces a positive finite value.

Capacity Dimension Defn: Given S R k, S bounded, cover S by a set of k-dimensional square boxes with side lengths ɛ n = r n for 0 < r < 1. Let N n (S) be the smallest number of boxes in R k needed to cover S. If log(n n (S)) D = lim n log(r n ) exists, then S has fractal dimension D. Note that the base of log is irrelevant because log a x/ log b x is constant. Example 1: Let S be a discrete set of M points in R k. Then N n (S) = M for large n N and any r (0, 1). Hence log(m) D = lim n log(r n ) = 0

Capacity Dimension continued Example 2: Let S = [a, b] R. Then N n (S) = b a r and n log(n n (S)) log(r n ) log((b a)/r n ) log(r n ) = log(b a) log(r n ) + log(r n ) log(r n ) 1 as n, using log(ab) = log(a) + log(b) and r n = 1/r n. The approximation is not a problem; it is easily shown that log(n n (S))/ log(r n ) is bounded above and below by quantities that converge to 1.

Capacity Dimension continued Example 3: Let S be the unit square [0, 1] [0, 1], and take r = 1/2. Then n = 1 r n = 1/2 N 1 = 4 n = 2 r n = 1/4 N 2 = 4 2 n = 3 r n = 1/8 N 3 = 8 2 = 4 3 n = 4 r n = 1/16 N 4 = 16 2 = 4 4 i.e., N n = (2 n ) 2 = 2 2n = 4 n and log(4 n ) D = lim n log(2 n ) = lim n log 2 (4) n n log 2 (2) = 2. More generally, if the number of boxes times the box area is 1, then N n = 1/(r n ) 2 = r 2n log(r 2n ) 2n log r D = lim n log(r n = ) n log r = 2. D is well-defined and independent of the choice of r.

Capacity Dimension continued Example 4: Let S be a D-dimensional box. Then N n = k/ɛ D n for constant (box volume) k. Hence log(n n ) log(r n ) = log(r nd ) + log(k) nd log(r) + log(k) log(r n = D ) n log(r) as n for any r < 1. Example 5: Let S be the Koch curve in R 2. Since S can be constructed as the union of four scaled down copies of itself, each of size 1/3, it is convenient to take r = 1/3. n = 1 r n = 1/3 N 1 = 4 n = 2 r n = 1/9 N 2 = 4 2 In general N n = 4 n the number of pieces in the order-n curve. Thus, log(4 n ) D = lim n log(3 n ) = log 4 log 3 1.262.

Capacity Dimension continued Example 6: Let S be the Sierpinski triangle with vertices at (0,0), (1,0), and (0,1), and let r = 1/2. n = 1 r n = 1/2 N 1 = 3 n = 2 r n = 1/4 N 2 = 3 2 Thus, N n = 3 n and log(3 n ) D = lim n log(2 n ) = log 3 log 2 1.585.

Capacity Dimension continued Example 7: Let S be the classical Cantor set, and let r = 1/3. n = 1 r n = 1/3 N 1 = 2 n = 2 r n = 1/9 N 2 = 4 Thus, N n = 2 n and log(2 n ) D = lim n log(3 n ) = log 2 log 3 0.631.

Random Midpoint Displacement for Curves A simple method for generating a fractal curve is as follows. Starting with a line segment, displace the midpoint vertically (for a function) or orthogonally (for a planar curve) by a random value r, replacing the line segment by two segments. Repeat the process on the new line segments, iterating until a minimum segment length is reached. The displacement is taken to be r = rand*rug*l, where L is the length rand is a uniformly distributed random value in [-1,1] rug is a ruggedness factor related to the fractal dimension maybe.10 to.40 Then r has mean 0, and the mean of r is proportional to the length L so that the ruggedness is independent of scale (does not increase as length decreases). This is necessary to retain statistical self-similarity, which is what defines the curve as a fractal.

Random Midpoint Displacement for Surfaces Consider a triangle mesh surface with the topology of a planar triangulation. One method for refining a planar triangulation is to connect edge midpoints, replacing each triangle by four equal-area similar subtriangles. The random midpoint displacement method can be extended to a triangle mesh surface by applying it to the midpoint of each edge, and connecting the displaced midpoints in a manner that produces the same topology as the refined triangulation. In the case of a polygonal surface with quadrilateral faces, the face midpoints, along with the edge midpoints are displaced at each iteration. The scale factor for the face midpoint should be the average of the four side lengths.

Mandelbrot Set Defn: The Mandelbrot set M is the set of complex numbers c C such that the sequence z 0 = 0, z k = z 2 k 1 + c for k > 0 is bounded. Following are some properties of M. M is connected The boundary of M is a fractal curve with Haussdorff dimension between 1 and 2. M is contained in the rectangle [ 2,.5] [ 1.75, 1.75]. The sequence defining M is bounded if and only if z k 2 for all k.

Mandelbrot Set continued The last property provides a means of approximating M: iterate until either z k 2 4 (implying that c = z 1 / M) or k max iterations are executed, in which case c is assumed to be in M. The value k max = 50 is sufficient to correctly depict the entire set at the resolution of a typical monitor, but k max must be increased in order to zoom in on and resolve smaller portions of the boundary. An image of M can be produced by mapping a portion of the complex plane into a viewport. For each pixel in the viewport, the mapping is inverted to give the correspond complex number c = z 1. The iteration count k (discrete escape time) then determines the pixel color as follows: background color (black) is assigned to points of M (k = k max ), and the set of counts 1 to k max 1 is partitioned into n subranges with a color index assigned to each: i = ((k n)/k max mod 255) + 1. for 256 distinct colors.

Mandelbrot Set Image

Mandelbrot Set continued A more complete characterization of the Mandelbrot set M is as follows. For fixed c, the set of initial values z 0 for which z k increases without bound is the basin of attraction A c of infinity; its boundary is the Julia set J c ; and its complement K c is the filled Julia set associated with c. Each such K c is either connected or has a one-to-one correspondence with the classical Cantor set. M is the set of c for which K c is connected or, equivalently, the set of c for which K c contains 0 (or contains c). M thus represents an infinite number of Julia sets (magnification of M in the vicinity of c appears similar to K c ) and is therefore not self-similar.

Iterated Function Systems Iterated Function Systems provide a means of constructing self-similar fractals. They were popularized by Michael Barnsley in Fractals Everywhere, Academic Press, Inc., 1988. We begin with some mathematics background. Defn: A metric space (X, d) is a set X, along with a mapping d : X X R such that 1 0 d(p, q) < and d(p, q) = 0 iff p = q p, q X 2 d(p, q) = d(q, p) p, q X 3 d(p, q) d(p, r) + d(r, q) p, q, r X Defn: A complete metric space is a metric space in which every Cauchy sequence converges; i.e., if d(p n, p m ) 0 as n and m approach independently, then d(p n, p) 0 for some p X. Examples of complete metric spaces include R n and closed subsets of R n with Euclidean distance.

Contraction Mapping Theorem Let f : X X be a transformation on a complete metric space (X, d). Defn: A fixed point of f is a point p X such that f ( p) = p. Defn: f is a contraction mapping if there exists a contractivity factor (Lipschitz constant) s such that 0 s < 1 and d(f (p), f (q)) sd(p, q) p, q X. Contraction Mapping Theorem: A contraction mapping f on a complete metric space (X, d) has a unique fixed point p. Also, for every point p X, f n (p) p as n.

Proof of Contraction Mapping Theorem proof of Contraction Mapping Theorem: Let s be a contractivity factor for f, and fix p X. Then, for k = 0, 1, 2,... d(p, f k (p)) d(p, f (p)) + d(f (p), f 2 (p)) + + d(f k 1 (p), f k (p)) (1 + s + s 2 + + s k 1 )d(p, f (p)) = 1 sk 1 s d(p, f (p)) 1 d(p, f (p)). (1 s) Also, for m, n = 0, 1, 2,..., with m n, d(f n (p), f m (p)) sd(f n 1 (p), f m 1 (p)) s 2 d(f n 2 (p), f m 2 (p)) s m d(f n m (p), p) s m /(1 s)d(p, f (p)) < ɛ for m, n sufficiently large. Hence, (Cauchy sequences converge) f n (p) p as n for some p. Since f is contractive, f is continuous and f ( p) = f (lim f n (p)) = lim f n+1 (p) = p. Also, if p 1 = f (p 1 ) and p 2 = f (p 2 ) then d(p 1, p 2 ) = d(f (p 1 ), f (p 2 )) sd(p 1, p 2 ) (1 s)d(p 1, p 2 ) 0 p 1 = p 2.

Contraction Mappings Example 1: Define f : R R by f (x) = ax + b. Then f is an affine contraction mapping iff s < 1 such that f (p) f (q) = ap aq = a p q s p q p, q R iff a < 1. The unique fixed point is defined by p = f ( p) = a p + b; i.e., p = b/(1 a). Example 2: Suppose f C 1 [R] and a < b. Then α [a, b] such that Hence f (b) f (a) b a = f (α). f (b) f (a) = f (α) b a s b a for some 0 s < 1 iff f (α) < 1. Hence, if f has range R(f ) [a, b] and f (α) < 1 for all α (a, b), then f is a contraction mapping on [a, b].

Contraction Mappings continued Example 3: Let f : R 2 R 2 be defined by f (p) = Ap + b for matrix A. Then f (p) f (q) = Ap Aq = A(p q) A p q, and f is an affine contraction mapping iff A < 1 for operator norm compatible with the vector norm. The fixed point is p = A p + b p = (I A) 1 b, where I A is invertible for A < 1 by the following argument. Suppose (I A)p = 0. Then Ap = p, but ρ(a) A < 1 implies that 1 cannot be an eigenvalue of A. Therefore p = 0.

Web Diagram for Affine Contraction Mapping y = x y = f(x) p 0 p 2 p 1

Hausdorff Distance Defn: Given a metric space (X, d), denote by H(X ) the set of nonempty compact (closed and bounded) subsets of X. The Hausdorff distance h : H(X ) H(X ) R is a metric defined as follows. For sets A, B H(X ), the distance from p X to B is d(p, B) = min{d(p, q) : q B}. The distance from A to B is d(a, B) = max{d(p, B) : p A}. This is not symmetric, and therefore not a metric. The Haussdorff distance between A and B is h(a, B) = max{d(a, B), d(b, A)}. Theorem: If (X, d) is complete, then (H(X ), h) is a complete metric space.

Iterated Function System Defn: A (hyperbolic) iterated function system (IFS) is a finite set of contraction mappings on a complete metric space: w 1, w 2,..., w N with contractivity factor s = max{s 1, s 2,..., s N }. Theorem: Let {X ; w 1, w 2,..., w N } be an IFS with contractivity factor s. Define W : H(X ) H(X ) by W (B) = N n=1w n (B) B H(X ), where w n (B) = {w n (p) : p B}. Then W is a contraction mapping on (H(X ), h) with contractivity factor s; i.e., h(w (B), W (C)) sh(b, C) B, C H(X ). Since (H(X ), h) is complete, W has a unique fixed point A H(X ) such that A = W (A) = N n=1w n (A) = lim k W k (B) for any B H(X ). A is the attractor of the IFS.

Outline of Proof A contraction mapping w n is continuous, and continuous functions map compact sets to compact sets. Thus w n : H(X ) H(X ) is well-defined. It is easily shown that w n is a contraction mapping on H(X ) with contractivity factor s n. Finally, properties of h and an inductive argument show that W = N n=1 is a contraction mapping on H(X ) with contractivity factor s = max{s 1,..., s N }. The contraction mapping theorem then applies to W. An IFS is similar to a dynamical system which often has an attractor, referred to as a strange attractor if it is a fractal.

IFS Examples Example 1: Define the IFS {R; w 1, w 2 } by w 1 (x) = x/3, w 2 (x) = x/3 + 2/3. Then both are contractions with s 1 = s 2 = 1/3 and fixed points 0 and 1, respectively. Let B 0 = [0, 1]. Then W (B 0 ) = w 1 (B 0 ) w 2 (B 0 ) = [0, 1/3] [2/3, 1] W 2 (B 0 ) = w 1 ([0, 1/3] [2/3, 1]) w 2 ([0, 1/3] [2/3, 1]) = [0, 1/9] [2/9, 1/3] [2/3, 7/9] [8/9, 1]. A = lim n W n (B 0 ) is the classical Cantor set. To verify this, W (A) = w 1 (A) w 2 (A) = (1/3)A {(1/3)A + 2/3} = A.

IFS Examples continued Example 2: Define the IFS {R; w 1, w 2 } by w 1 (x) = x/2, w 2 (x) = x/2 + 1/2. Then, s 1 = s 2 =0.5, and the fixed points are 0 and 1, respectively. For B 0 = [1, 2], W (B 0 ) = [1/2, 3/2], W 2 (B 0 ) = [1/4, 5/4], W 3 (B 0 ) = [1/8/, 9/8],... i.e., W k (B 0 ) = [2 k, 2 k + 1], and the attractor is A = lim k W k (B 0 ) = [0, 1] not a fractal. Theorem: An IFS consisting of two affine contraction mappings on R has an attractor that is either connected or totally disconnected (the only nonempty connected subsets are those consisting of single points).

IFS Examples continued Example 3: Define the IFS {R 2 ; w 1, w 2, w 3 } by w 1 (p) =.5p, w 2 (p) =.5p + (.5, 0) w 3 (p) =.5p + (0,.5). Then, s 1 = s 2 = s 3 =0.5, and the fixed points are (0,0), (1,0), and (0,1), respectively. The attractor is a Sierpinski triangle or Sierpinski gasket with vertices at the fixed points. It could be defined as the end result of the following process. Partition a triangle into four similar equal-area subtriangles by connecting the midpoints of the edges, and then remove the middle triangle. Now apply the same procedure to each of the three remaining subtriangles. Continue the procedure ad infinitum. Since the area is scaled by 3/4 at each iteration, the attractor has area 0, while the sum of edge lengths (total perimeter of the holes) is infinite. It s fractal dimension is log(3)/ log(2) 1.585.

IFS Examples continued Similar to the Sierpinski triangle is the Sierpinski carpet defined by the following rule: a rectangle is partitioned into nine equal-area subrectangles, and the middle subrectangle is removed. The rule is then applied to each of the eight remaining subrectangles to get the next level of approximation. This is the two-dimensional analogue of the classical Cantor set. The Sierpinski sponge is the three-dimensional analogue of the Cantor set. A 3-D box is uniformly partitioned into a 3 by 3 by 3 grid consisting of 27 equal-volume cells (sub-boxes). The level-1 approximation is then obtained by removing the center cell and the cell at the center of each of the six faces, leaving 8 corners and 12 edge centers, defining 20 fixed points f i with corresponding affine contraction mappings w i (p) = f i + (p f i )/3. The Sierpinski sponge has infinite surface area and zero volume (fractal dimension log(20)/ log(3) 2.73). As a storage medium, it would require an infinite amount of packing material to store nothing.

Deterministic Algorithm A deterministic algorithm for creating an image of the attractor associated with an IFS on R 2 is as follows. Choose any bounded set A 0 R 2 for n = 1, 2,... Replace A n 1 by A n = N i=1 w i(a n 1 ) A n 1 is stored in a color buffer (read buffer) as the set of pixels with nonzero values, and A n must be stored in a second (write) buffer. Each iteration, in addition to clearing the write buffer, requires that every pixel in the read buffer be tested to find the points of A n 1. The algoritm is therefore very slow, but has the advantage that we can watch the attractor evolve from an arbitrary starting set.

Random Iteration Algorithm The much faster random iteration algorithm is as follows. Choose an initial point p = (x, y) for n = 1 to maxit Choose w k at random (or with probability p k ) Replace p with w k (p) set pixel(p) If the initial point is a fixed point of one of the mappings, or any other point of the attractor A, all points will be in A. The probabilities must satisfy p k > 0 and N k=1 p k = 1. For efficiency, they should be chosen so that p k is approximately the ratio of the area of w k (S) to the area of S for S R 2. Since, for w k (p) = A k p + b k, area(w k (S)) = det(a k ) area(s), a good choice is p k = det(a k ) / N j=1 det(a j) with an adjustment in the case of det(a k ) = 0 so that p k > 0.

IFS Example with Probabilities Example 4: Define the IFS {R 2 ; w 1, w 2, w 3, w 4 } by w 1 (x, y) = (.25x,.5y), w 2 (x, y) = (.75x +.25,.5y) w 3 (x, y) = (.25x,.5y +.5), w 4 (x, y) = (.75x +.25,.5y +.5) The contractivity factors are s 1 = s 3 =.5 and s 2 = s 4 =.75, and a good choice for the probabilities is p 1 = p 3 = 1/8 and p 2 = p 4 = 3/8. The fixed points are (0,0), (1,0), (0,1), and (1,1), and the attractor is the unit square.

The Fractal Fern Example 5: Define the IFS {R 2 ; w 1, w 2, w 3, w 4 } by w 1 (x, y) = (.85x +.04y,.04x +.85y + 1.6) w 2 (x, y) = (.20x.26y,.23x +.22y + 1.6) w 3 (x, y) = (.15x +.28y,.26x +.24y +.44) w 4 (x, y) = (0,.16y) with probabilities p 1 =.85, p 2 = p 3 =.07 and p 4 =.01. The fixed points are given by f i = (I A) 1 b for affine mapping w i (p) = Ap + b: f 1 = f 3 = [ 2.655601660 9.958506224 [ 0.153769346 0.631552671 ] [ 0.608365019, f 2 = 1.871892366 ] [ 0, f 4 = 0 The attractor is a fractal fern contained in [ 2.5, 2.5] [0, 10]. ] ]

Condensation Sets Defn: Define w 0 : H(X ) H(X ) by w 0 (B) = C B H(X ), where C is a fixed condensation set in H(X ). The constant function w 0 is a contraction mapping with s = 0. Its unique fixed point is C. Even though w 0 is not defined on X, it may be included in the IFS, and the theorem still holds. The algorithms must be modified. For the random iteration algorithm, we include p 0 > 0 and whenever w 0 is to be applied to p, we select a point from C at random. For the deterministic algorithm, we simply take the initial set A 0 to be C and add to rather than replace the previous set (eliminate the clear screen command). The reason is the following. Let W (B) = N n=1 w n(b) and W 0 (B) = N n=0 w n(b) = C W (B) B. Then W 0 (C) = C W (C) and W 2 0 (C) = W 0(C W (C)) = C W (C W (C)) = C W (C) W 2 (C). Thus, the attractor is A = C W (C) W 2 (C).... Note that W 0 (A) = C W (A) = A.

The Collage Theorem Given an IFS with contractivity factor s, and a target image T H(X ), h(t, A) h(t, W (T )) + h(w (T ), A) = h(t, W (T )) + h(w (T ), W (A)) h(t, W (T )) + sh(t, A) (1 s)h(t, A) h(t, W (T )) h(t, A) 1 h(t, W (T )), 1 s where A is the attractor. Thus, if T is close to W (T ), and s is not close to 1, A is close to T ; i.e., given a target T, we can construct an IFS whose attractor is close to T by making W (T ) close to T. This is the basis for image compression.

Fractal Dimension Theorem: Let {R m ; w 1, w 2,..., w N } be an IFS with attractor A, where each w n is a similitude (rigid body transformation plus uniform scaling) with scale factor s n, s n < 1. If the IFS is totally disconnected or just-touching, then A has fractal dimension D given by the unique solution to N s n D = 1, D [0, m]. n=1 If the IFS is overlapping then D D, where D is the solution of N s n D = 1, D [0, ). n=1

Fractal Dimension Examples Example 1: A = Sierpinski triangle (just-touching); N = 3, s n =.5 for n = 1, 2, 3 3(.5) D = 1 D = log(3)/ log(2) 1.585. Example 2: A = Cantor set (totally disconnected); N = 2, s 1 = s 2 = 1/3 2(1/3) D = 1 D = log(2)/ log(3) 0.631. Example 3: A = Koch curve (just-touching); N = 4, s n = 1/3 for n = 1, 2, 3 4(1/3) D = 1 D = log(4)/ log(3) 1.262.