Homework 1: Growing a fern in MatLab
Due in Owlspace by 5pm on Wednesday September 5.

We will be growing ferns by random repetition of a few simple matrix/vector transformations. The old-school fern below was produced by this code . You see that at each step it generates a random number and applies one of two possible transformations, the first with probability 0.3 and the second with probability 0.7.

Your task is to disect and document this existing code and then to write and run code that produces a significantly more interesting fern. In particular, your new program should successively generate a random number and should

apply z = [0 0;0 0.16]*z with probability 0.01

apply z = [0.85 0.04; -0.04 0.85]*z + [0; 1.6] with probability 0.85

apply z = [0.2 -0.26; 0.23 0.22]*z + [0; 1.6] with probability 0.07

apply z = [-0.15 0.28; 0.26 0.24]*z + [0; 0.44] with probability 0.07

You should accomplish this with a single if clause, although, given that your logic now forks four ways, you will want to make use of some subordinate elseif statements.

Your work will be graded as follows:

        1 figure:  15 pts. Use MatLab title command to place your name on plot. 

        1 M-file: 10 pts for header/program description
                     with your name, date and email address AND
                     names of all coworkers.
                  10 pts for further comments in code
                   5 pts for indentation in for loop
                   5 pts for indentation in if clause
                  10 pts for use of elseif
                   5 pts for correct code.

        My advice on writing the header and commenting the code is to follow
        the format of our several circle deformers. Please reread the
        Process page before starting - and realize that each individual is solely responsible 
        for commenting and headering their code and for labeling their own plots.

        Once in Owlspace make sure you upload BOTH attachments before
        hitting the SUBMIT button.

        You should also save copies of ALL your work to your Owlnet U-drive.

For those who wish to dig deeper, please check out the text, Fractals Everywhere by M.F. Barnsley, or hit the wiki page on Iterated function system.