A fractal is an object or quantity that displays selfsimilarity, in a somewhat technical sense, on all scales. The object need not exhibit exactly the same structure at all scales, but the same “type” of structures must appear on all scales. A plot of the quantity on a loglog graph versus scale then gives a straight line, whose slope is said to be the fractal dimension. The prototypical example for a fractal is the length of a coastline measured with different length rulers. The shorter the ruler, the longer the length measured, a paradox known as the coastline paradox.
Illustrated above are the fractals known as the Gosper island, Koch snowflake, box fractal, Sierpiński sieve, Barnsley’s fern, and Mandelbrot set.
The Haferman carpet is the beautiful fractal constructed using string rewriting beginning with a cell [1] and iterating the rules
(1)

(Allouche and Shallit 2003, p. 407).
Taking five iterations gives the beautiful pattern illustrated above.
This fractal also appears on the cover of Allouche and Shallit (2003).
Let be the number of black boxes, the length of a side of a white box, and the fractional area of black boxes after the th iteration. Then
(2)


Courtesy : Mathworld Wolfram