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.


Safe Browsing Guide – II

Continued from Safe Browsing Guide – I

You might get some ‘warnings’ while opening secure pages, like below:


The first one means that the certificate could have been signed by anyone, including by someone you do not trust. If all I need is encryption: for example if I am sending email, and not sending any corporate presentations, or password, or credit card numbers – I should be fine. Many websites use such certificates – but if it’s a bank website using it – I would not login. To give you an idea of the relative security impact of many of the warnings discussed during this guide: this particular warning has a severity of 40 out of 100. It means even on seeing this warning, I am 60% likely to use the website.

The second one means that the certificate has expired. In this case, I would check what is the expiry date (by clicking on the lock) and if it expired a couple of days back I would allow it. In addition, if its sensitive information, I would not use the site until the issue is fixed. This one has a severity of 30.

The last one says that the website names do not match between the certificate and the actual website you are visiting. This could be a case of phishing, and could be serious. What I do in such a case is I find out what name the certificate is issued to (clicking on the lock icon) and check it against the actual website in the URL. If the website visited is server.icicibank.com and the certificate is for icicibank.com – I continue to use the site. If the two are very different, I don’t use the site. Severity is 80.

Mozilla issues one message for each of the issues as noted above while Internet Explorer (shown above) issues just one message with error icons:


This corresponds to the second warning from Internet Explorer.


This one corresponds to the first warning from Internet Explorer, same actions apply.

Another warning that you might see is this one:


Correspondingly for Mozilla:


This warning means that there is some content on the page which is not encrypted: this could be images or something else. Severity is 50: on GMail it may mean that the emails have such content so it’s ok to continue to do your stuff. However, if on one of the emails you are sending a password – you may want to be careful.

Lastly I would encourage visitors to read this advise on safe browsing from a security expert. This essay from 2004 is still good.

Disclaimer: This is just a guide and is not meant to replace professional advise. No measures can guarantee 100% security. There are a lot of threat vectors outside the scope of this tutorial: such as key loggers on your computer. In addition, the severities explained for warnings are just guides and have no scientific basis.


Safe Browsing Guide – I

When you browse over the Internet, or Chat, or send/receive email – you are not doing that in private. It is important to understand exactly what is private, and what steps you need to follow to maintain the privacy.

When accessing any website such as Yahoo.com, you get connected to the web site’s server which provides you the information you seek – search results, or email. This connection is not direct: you are connected through a series of nodes. Each node can view/alter the information that is flowing through it.

A protocol – ‘https’ provides privacy to your interaction by adding a ‘Secure Socket Layer‘ on top of the normal HTTP protocol. Enough of jargon, back to English!

So when you use this particular protocol you are secure subject to some caveats. Use of this protocol can be confirmed through the ‘https’ at the beginning of the URL, and through the ‘lock’ icon at the bottom right: Lock.

A lot of online websites support HTTPS for logging in. You have to select ‘secure’ at the login screen where you enter username/password. This means that your password is protected during the communication. However, these sites move back to normal mode after the login: your data (for example the email content) is not protected. Gmail supports secure connection even after login but you have to enable it in the settings – this makes sense and you should do it. However, even after doing this it does not mean that all your content is ‘protected’ – more on this later.

Please understand that if its emails in question: just your using a secure connection is not enough. The recipient should also use it for the information to remain inaccessible at the nodes.

Proceed to the next part of the guide.

Disclaimer: This is just a guide and is not meant to replace professional advise. No measures can guarantee 100% security. There are a lot of threat vectors outside the scope of this tutorial: such as key loggers on your computer. In addition, the severities explained for warnings are just guides and have no scientific basis.


The festival of Lohri

Lohri is a major North Indian festival, which to us non-farmers means the start of the decline of the winter season.

The first Lohri after marriage or after a newborn baby is cause of celebration: this includes family and friends in the evening, lighting a bonfire, eating rewri, peanuts, popcorn etc and singing Lohri ‘carols’. One of the carols is about a person called ‘Dulla’ who, in a Robin Hood fashion looted the landowners (zamindars) and distributed the loot among the poor.

Below a photograph of our very own bonfire (from yesterday evening), the first one I lit in my life:


Once we setup the pile of wood ready to light, the children playing around ‘damaged’ it. There after they tried to build it back with no luck, so we had to do it all over again. 🙂



There must have been times when you would have wondered what the difference is in pictures of type “GIF” (having file extension .gif) and those of type “JPEG” (having file extension .jpg). At other times you might have wondered which type to use for a picture you are uploading. Well, today I am going to solve the problem for you.

GIF stands for Graphics Interchange Format, and is more suited for computer generated graphics and images. This is because it can hold a maximum of 256 colors. If the picture you are saving as GIF has more colours, they will be “approximated”. Leaving aside this limitation, GIF is a wonderful format. You can mark some of the pixels as “transparent” which means that those pixels do not have a colour of their own, and will take up the background colour when the picture is displayed. This makes them merge easily with any background. In addition, you can create animations as well using GIF format.

On the other hand, JPEG, standing for “Joint Photographics Experts Group” can store true 24 bit color, and is used more often for real life photographs. This is because real life photographs normally have more than 256 distinct colors. However, these support neither animations, nor transparent pixels.

The compression used by GIF is mostly lossless, while that used by JPEG is lossy – which means that a JPG image will loose some quality each time you save it, where as a GIF will not.


Indian Photographers I: Lala Deen Dayal

I have started this series, called Indian Photographers to throw some light on the works of great Indian photographers.

Deen Dayal was born in Sardhana, Uttar Pradesh. In 1868, Deen Dayal founded his studio Lala Deen Dayal & Sons, and was subsequently commissioned to photograph various temples and palaces of India. He established studios in Secunderabad, Bombay, and Indore in the 1870s. He covered the tour of the Prince and Princess of Wales in 1875, and travelled with Sir Lepel Griffin through Bundelkhand in 1880s.

Some of his old photographs that I like:

Interior of Bashir Bagh Palace, Hyderabad
Interior of Bashir Bagh Palace, Hyderabad
Kashmiri Gate, Delhi
Kashmiri Gate, Delhi
Entrance to the Charminar, Hyderabad
Entrance to the Charminar, Hyderabad

Unjumble on mobile using Twitter

Now the English word unjumbling service at unjumble.SeeingWithC.org is also available via Twitter. It can be accessed directly from the mobile phone using text sms messages. This is what you need to do:

  1. Sign up on twitter if you do not already have an account.
  2. If you want to use mobile phone, your number should be linked to it.
  3. Send message “follow dwealth” (without quotes) to follow dwealth.
  4. Send message “follow t411” (without quotes) to follow t411 which is the parent bot in use.
  5. That’s it, for the setup (configuration)!

When you want to unjumble a word, send a message d t411 unj word where word is the word to be unjumbled to twitter. For example if you SMS

d t411 unj heepntla

you will get a response message containing the word “elephant”.

Please use this, and post comments. Also let me know what will make this more useful.


Gurpurab Celebrations

Gurpurab is a celebration or commemoration based on the lives of one of the Sikh spiritual gurus. They tend to be either birthdays or celebrations of Sikh martyrdom.
The Gurpurab of Tenth Guru, Guru Gobind Singh Ji is coming up, on 5th January. Tomorrow there is a procession in Delhi to mark the occasion. Many other initiatives are on to mark the occasion. Following photos show the decoration that is done daily at our local Gurdwara (Sikh place of worship):

The quote on the first one says “The moment is blessed, which is used to recite the name of the True Lord”. At the center of the flower is “Ik Onkar” which means “God is one”, or rather “Recite the name of the True Lord, One Who is the Creator, the Preserver and the Destroyer (all in One), and like Whom there is no other.
The second one says “No Deva (gods and goddesses) can equal the Guru. The one who has blessing on his forehead falls in selfless service to the Guru”.

I was at the Gurdwara Sahib on the New Year eve, and the thought that struck me was:

ਸਬਦਿ ਮਰਹੁ ਫਿਰਿ ਜੀਵਹੁ ਸਦ ਹੀ ਤਾ ਫਿਰਿ ਮਰਣੁ ਨ ਹੋਈ ॥
ਅੰਮ੍ਰਿਤੁ ਨਾਮੁ ਸਦਾ ਮਨਿ ਮੀਠਾ ਸਬਦੇ ਪਾਵੈ ਕੋਈ ॥੩॥

Through understanding and absorbing the Shabad, you will forget ‘yourself’ and became ‘dead’. Dying in the Word of the Shabad, you shall live forever, and you shall never die again (because you will not need to be born again). The Ambrosial Nectar of the Lord’s Name is ever-sweet to the mind; but how few are those who obtain the Shabad.

‘Shabad’ refers to the Word of the Guru, the hymns.

Have a Happy New Year 2009.


Licensing and information about the blog available here.