Drawing through Iterated Fractal Function

Leafy Mathematics
Leafy Mathematics

Have a look at the image on the right. What do you think it is?

Ok, you got it: it’s a fern. What’s the big deal about that? The big deal is that it has been generated mathematically. Generated mathematically? Yes, mimicking what happens in nature.

It also happens to be a ‘fractal’: each part of it is similar to the whole – no matter how much you zoom in.

I read about this on Wikipedia: I decided to give it a try so I built a spreadsheet. Download it here.

Start with x=0, y=0. In each iteration n, choose t randomly from {1, 2, 3, 4} such that it has value 1 with a probability of 0.01, values 2 & 3 with probability of 0.07 each, and value 4 with a probability of 0.85. Now (xn, yn) is

(0, 0.16 yn) if t=1

(0.2 xn – 0.26 yn, 0.23 xn + 0.22 yn + 1.6) if t=2

(-0.15 xn + 0.28 yn, 0.26 xn + 0.24 yn + 0.44) if t=3

(0.85 xn + 0.04 yn, -0.04 xn + 0.85 yn + 1.6) if t=4

So this is what I replicated in the spreadsheet. The first column A, contains random numbers generated using function RAND. The second column contains the calculation for ‘t’: if the value in column A is less than 0.85 – ‘t’ will be selected as 4. If not, and its less than 0.92, ‘t’ will be selected as 3 and so on. This will ensure the required probability distribution for the random values of ‘t’. In columns C & D, values of x and y are calculated respectively, using values in the previous row.

Move over to the second worksheet in the spreadsheet, called ‘Plot’. Can you see the fern similar to the one I showed above? Press F9 to refresh – this will cause the entire set of random numbers to be regenerated, the x & y values to be correspondingly recalculated and the graph redrawn. Even so, the fern shape will be retained. Mathematics is beautiful, isn’t it? The ‘fern’ we just generated is called Barnsley’s fern.

Share

Limericks II

Algebra?
Algebra?

Is Algebra fruitless endeavor?
It seems they’ve been trying for ever
To find x, y, and z
And it’s quite clear to me,
If they’ve not found them yet then they’ll never

Credit: Graham Lester

A wonderful bird is the pelican
His bill can hold more than his belican
He can take in his beak
Food enough for a week
But I’m damned if I see how the helican

Credit: Dixon Merit

A canner exceedingly canny
One morning remarked to his granny:
“A canner can can
Any thing that he can
But a canner can’t can a can, can he?”

Credit: Carolyn Wells

There was a young fellow of Wheeling
Endowed with such delicate feeling
When he read on the door,
“Don’t spit on the floor”
He jumped up and spat on the ceiling!

Share