Wednesday, February 11, 2009

A Blog for our class

Folks,

We meet so little and time is so precious and short so i decided to use other means to communicate with you and one of them is the Blog. What I expect is really devotion to this class and to everything else you do. It is just basically being honest because deeply inside we all want to grow and learn but there may be a lot of interference and dust. However I am also aware how much pressure many of you face, having to juggle work, college, relationship.... What helps me is the choice to believe the EVERTHING works out for the good. This being said, let us turn to the Math.

Math is essentially fun like life and music. Look at these two Mathematica programs that Jasper (a young teenager for Ithaca send me). He just played with Mathematica for a while and found these programs. I will also try to connect between then and the loops:

Program 1:

Table[TreePlot[
Flatten[Table[{i -> 2 i + j - 1}, {j, 2}, {i, 2^n - 1}]],
Center], {n, 2, 7}]



In the comments to this blog you can write comments about this program and play with it for a while. What do the some of the numbers means? You may say that the "largest" tree is of "Depth" 7. How can you make it deeper for example. Did you notice how the table command worked?

Here is another program Jasper sent me:

Paste it into Mathematica and see the amazing results. Note that this program uses the Do loop that is also used in lab 3 and will help you understand it:

Do[Print[
"You gave me " <> RandomChoice[WordData[All, "Noun"]] <> "."
], {5}]
Print["And I gave you Love."]

The output will be different each time. Here is what happened for me:

You gave me Julia Ward Howe.
You gave me Felis onca.
You gave me professional golfer.
You gave me utility man.
You gave me Jamaica sorrel.
And I gave you Love.

Can you explain in the comments the meaning of this program? Note that <> means means to join two strings (words) together and WordData is a kind of ordered dictionary bank that is embedded in Mathematica.

By the way David just emailed me and wrote"...I tell them that we have an entire semester to learn mathematica and latex. It is not expected to master it after 3 weeks. They'll get there."

I thought it is a good thing to share

1 comment:

  1. These are neat programs. I understand what they both do, but how does the criteria within the table brackets determine the structure of the trees?

    ~Scott Constable

    ReplyDelete