Sunday, May 20, 2007

Simplicity in Chaos: The Logistic Map

When most hear the word chaos it conjures up thoughts of disarray, confusion and complexity. Webster defines it as "a state of things in which chance is supreme, especially the confused unorganized state of primordial mater before the creation of distinct forms and the inherent unpredictability in the behavior of a complex natural system (as the atmosphere, boiling water, or the beating heart." The beating heart!? But its also one of those everyday words that has been taken by science to name a theory in a more visual or mnemonic way, like string theory and for many years it was the leading edge of math and physics. Chaos Theory was the buzzword of the 1990's, but it has since been replaced by nanotech or solar energy. You must remember in Jurassic Park (also a film) how the lawyers had to call in the genius chaos theorist to give the dinosaur resurrection the go ahead. Well they didn't listen the chaos guy and well, things went to... chaos.

What is amazing to me, and a foundation of chaos theory, is that simple (albeit nonlinear) systems with simple laws can lead to extremely complex and "chaotic" results. In many cases these simple systems only lead to complex solutions under certain conditions, under other conditions they might yield a single simple answer. It seems to me that popularized fractals like the Mandelbrot Set(seen at right), the Koch Snowflake and the Sierpinski Triangle are mappings of the region between order and chaos. Not only are these maps extremely interesting from an academic standpoint, they have an inherent beauty that stretches to infinity. You can literally zoom in to these maps infinitely and find at least as much depth as the macroscopic view and in many cases much more. There is nothing else like them in the universe. Lets say you were looking at the galaxy from afar, you could zoom in further and further, but eventually you would hit a brick wall called the atom (or would you...). Evey thing we know has a limit, even physicists agree the universe is finite in size, although Einstein called it "infinity with bounds." Einstein was referring to the idea of the universe being finite but not having an "edge," a different idea, but the phrase still seems appropriate for the Logistic Map.

The logistic equation has been around since 1845 when it was developed as a method for modeling population growth, in fact you probably learned about it at some point if you know what a differential equation is. It basically assumes that the rate of population growth is proportional to the population but growth slows and stops as the population reaches the carrying capacity (maximum population). Maybe the equation itself will job your memory, from mathworld (also the top image):
While solving this equation might require some practice, it is fundamentally quite simple and based on some simple ideas. Actually, the logistic equation does not produce chaotic behavior. That is until the mid 1970's when Mitchell Feigenbaum (an interesting guy by the way) discovered that logistic equation could be modified to demonstrate strange behavior in some physical systems he was studying.

If you take the right side of the logistic equation and for a given value of r (rate constant) between 0 and 4, plug in an x value to give the next value of x. In other words, iterate the equation repeatedly using its previous value to give the next value. The initial value of x is another parameter that can be played with, but .4 works well. You just iterate this equation:
Yes, thats it.

The behavior is entirely dependent on the rate constant, defined for each iteration. For some values of r, like r is less than 1, the equation tends towards zero. For other values, for example r above 1 but less than 3, the value of x bifurcates and tends to two stable values, oscillating between them after a large number of iterations. As the rate constant increases further the system (x value ~ population) splits into 4, then 8 stable values of x. At some point the stability breaks down and they system no longer tends towards any given value, it has become chaotic. Plot all the values that the system yields after 50 or so iterations and you get the logistic map: The process gives orderly results for some ranges of r, chaotic results for others and in some cases their is a semi-stable result. If you zoom in to this picture you can see all the detail in the logistic map. In the midst of chaos there are regions of brief order where the map goes back to converging to a finite number of values. This is an perfect example of self-similarity in the sense that these smaller structures of order mirror the larger scale structure, looking almost identical in some cases. Just zoom in and the small scale order will look very familiar (at any zoom with a high res img).

What I find so amazing about this system is how simple the rules are. Take this function to modify a value of x and plug the result back into the equation. Now its not your normal approach to dealing with an equation, but it is simple. Some savvy electrical engineers have come up with an equivalent circuit to the logistic iteration, the output is shown below. I'm not sure how profound this really is, but it certainly suggests that some systems may be orderly under the right circumstances while the same system will be chaotic and completely unpredictable under other conditions... Hmm, that sounds alot like the stock market.
If you are interested in exploring the map check out the program at the bottom of this page, be sure to F1 for the list of commands once you get it running. Here is a program that should work on macs. Comments are appreciated.

Saturday, May 12, 2007

I Heart Interactive Brokers

Yesterday I received this letter via Fed Ex with a check for the full 10th place prize. Lets just say I am very happy with IB right now and I will be buying at least 100 shares of IBKR for a long term investment with the money. I'd like to get my original ipo bid price if possible, which was 25$.

Saturday, April 28, 2007

This Blog

After boldly proclaiming that I am Boba Fett it seems appropriate to introduce the real me, or at least how I see myself, and talk a bit about what this blog is. Going on a diatribe about myself sounds narcissistic and silly, especially since there are only about ten visitors per week (although it was much higher during the competition). So rather, I'll try and layout a few of my qualities that I hope will at least seed the topics of this blog.

From an early age I was fascinated by numbers. Apparently I did pretty well on some standardized tests when I was little because my parents accelerated me in math programs and I can recall being in a something called "project think" in middle school when I lived in West Texas. From the my discovery of the "variable" beyond, my love of mathematics grew. In Middle School I competed all over Texas in all types of Math competitions like mental math, math olympiad and I was one of the best in the calculator competition (calculator of choice: TI-86). For a few years I became intensely interested in fractals and Chaos Theory after reading Gleick's book and others. During that time I can recall being amazed by a chaotic waterwheel I saw at a science fair and feeling blown away by the simplistic complexity of the logistic equation and Mandelbrot set. Once, I ran into my parents bedroom late at night when I programmed my TI-86 to plot and explore the logistic map (seen above). The observation of self similarity is something I am very fond of and will discuss at length in a future post. By the way, self similarity is certainly a profitable concept in the world of market price analysis. Aronofsky's film Pi remains one of my favorites and it has always been a dream of mine to make films with strong mathematical influences, maybe I'll write about a few of those ideas in the future. Sometime in middle school I came up with "pythagoruz" as an AIM alias, then a hotmail account, and now it is my internet persona in various disciplines, anywhere you see it, thats me.

I'm now 24, have degrees in electrical engineering and physics from UCSB and am working on a Ph.D in materials science at UIUC. In my research I look at very small scale crystal structure ("nanocrystals" or quantum dots) and aim to control the growth geometry. I'll talk more about this later, but it basically involves chemistry and 3D geometry(see TEM image at the end). My favorite subject in Physics was Relativity at one point but has since changed to Quantum Mechanics because of the beautiful mathematical construct created around QM. I am also an active trader with an eye for reading charts, you can find out more about that at Stock Geometry. Also, you may have noticed that I recently competed in a auto-trading software competition using this site as a venue for posting trades. In my experience, all good traders have a eye for spotting patterns and a comfort with numbers.

In short, I love to talk and think about mathematics, always have. Over the years I have met others like me and the internet has provided a great venue for such topics. So while I may digress, e.g. Star Wars, the idea here is to celebrate the beauty of mathematics, not unlike Pythagoras and his Pythagoreans did the 500's BC. I would love to get feedback along the way and get some discussions going so please feel free to comment with any thoughts or suggestions you have. From wiki:

Pythagoras and his students believed that everything was related to mathematics and that numbers were the ultimate reality and, through mathematics, everything could be predicted and measured in rhythmic patterns or cycles. According to Iamblichus, Pythagoras once said that "number is the ruler of forms and ideas and the cause of gods and demons."

I took this image of some Iron Oxide nanocrystals i made a few weeks ago. They formed a ring as the solvent evaporated off the thin carbon film on which they rest for transmission electron microscopy(TEM). Can you see the self similarity?

Wednesday, April 18, 2007

I'm Boba Fett

I just took the Star Wars personality test and was worried that I might end up being someone lame like Grand Moff Tarkin. Well, he wasn't all that lame but since he was into engineering the death star and all I just figured... But as it turns out I have the most in common with Boba Fett, the biggest bad ass in all of the Star Wars universe! Sweet! Ya know, now that I think about it they really nailed it.

This is what they told me at the end:

Sunday, April 15, 2007

No Pi for Mr. Palais Please


Its understandable that with the development of Mathematics over the years by countless numbers of highly intelligent people that it has become difficult to contribute meaningfully to the field. It must be pretty tough for up and coming mathematicians to make a name for them selves with the level of complexity that goes into new research and progress. Just about the only field that requires new mathematics is theoretical physics, mainly string theory, and lets just say that 11 dimensional topology is very complex. That being said, I offer no excuses and no sympathy for the attention seeking author of Pi is Wrong.

Let me start by saying that I think it would be inappropriate to change any fundamental constant of nature or mathematics. A massive body of knowledge has been built on the basic principles of math and physics, not to mention civilization as we know it. These principles are apart of who we are, not unlike how history defines culture. To change these constants would in a way be like trying to re-write history. But there is also the issue of it being impractical. Ask any kid what the area of a circle is and he will tell you "pi R squared," ask him what pi is and he'll say "3.14 something." Everybody knows what pi is and what it means. Its written in millions of textbooks, programmed into millions of calculators and taught in thousands of classrooms. Simply put, redefining pi would cause confusion and add complexity. You can imagine some theoretical physicists are working on a groundbreaking problem in string theory, on the verge of a breakthrough, when all of a sudden someone asks "which pi are we talking about?" The train of thought breaks and the geniuses are now caught up in an argument about pi, needlessly.

Ok, so aside from the obvious reasons why no fundamental constant should be changed, how does Mr. Palais's argument stack up? His angle of attack is basically aimed at the semi-common factor of two that appears in front of pi, if it is so common 2pi must be the "real" fundamental constant he says. Now this wouldn't be the first time a constant had an annoying factor. In physics it is rare to see plank's constant without it being divided by two pi. The physicists of the early 1900s became so tired of having to write h/2pi that they created a new constant h-bar which was equal to h/2pi. In many cases this new constant h-bar eliminated not only the factor of two but also the pi, so for those equations the argument is mute. You may recognize plank's constant from the equation of a photon's energy:
As I've already mentioned, the equation for the area of a circle has no factor of two and the volume of a sphere has a factor of four thirds, so no help there. The circumference of a circle is equal to two pi R, but if you write it in terms of the diameter of a circle the factor of two goes away. Besides, why is Mr. Palais so interested in two dimensional geometry, after all we live in a three dimensional world. The surface area of a sphere is four pi R squared, so maybe he should argue that pi should become four pi. I will give him credit for ponying up to the fact that all the angles in a triangle add up to pi radians, strong evidence against his argument. Then we have Euler's identity, which Richard Feynman called the "most remarkable formula in mathematics," no factor of two there. In fact, if you go through all the major formulas that define pi very few actually have the factor of two. In wikipedia's entry on pi I counted only five equations out of 55 listed from mathematics and science where re-defining pi would eliminate a factor. In fact, from a cursory glance, a factor of one half seems much more common. Here are a couple that I ran into:
His argument about the factor of two being everywhere is bogus, laughable really. Mr. Palais really shines when he tries to say that the equation for the area of a circle should look like the equation for kinetic energy. Yes, isn't it obvious, since one half mass times velocity squared is kinetic energy, one half pi (his new version) R squared should be the area of a circle! Genius! I jest, but this is no laughing matter. Pi beautifully appears in many, many equations. Sometimes it appears with other factors, but those factors are not two much more often than they are. Mr. Palais's claim is not only disrespectful the the beauty of pi but outright wrong.


Theres nothing like a blatantly absurd statement like "I believe pi is wrong" to get attention for yourself, and it worked. I found this article doing my daily scan through digg.com as it was one of the most "digged" articles on the web that week. I can only hope that those who "dugg" the article did so because they were amused by the author's idiocy, in fact I was.

Tuesday, April 10, 2007

Pi is Perfect

Ok, I was gonna wait a little longer to begin posting here in full force but some punk at Utah State has brought me out of the woodwork with his blasphemy. Let me just say that pi is irrational, impenetrable, indivisible and all powerful. Yes pi is the ultimate number. I will give a full explanation of why pi is so great and the complete opposite of wrong this weekend. But in the mean time read the link I posted above and think of pi as your own little tiny dancer, magic really: