![]() |
![]() |
Computer science and math are usually very exacting. However, there is one field of study known as Chaos Theory that is unlike traditional science. The idea behind chaos theory is that in large, complex systems that appear to be "chaotic," one can actually find order. A classic Chaos Theory tale goes like this: Somewhere in the Amazon, a butterfly flaps it wings causing a storm in New York that manages to delay an airplane landing at JFK causing a banker on board to miss an international monetary fund meeting causing a debate on the refinance of the Brazilian national debt to fail causing the brazilian government to go bankrupt causing an election resulting in a new president who bought victory with the promise of free land in the Amazon rainforest for the slum dwellers of Rio causing one lucky beneficiary name Jorge to claim, and then clear his land in the most efficient way available causing all the birds in their acre of the forest to migrate deeper into the heart of the jungle causing two thousand starving birds to be waiting as our original butterfly is just waking up to start the entire process all over again. This time the banker makes his meeting on time.
The "Sierpinski Triangle", introduced in 1916 by the Polish mathematician
Waclaw Sierpinski (1882-1969), is a rather simple example of "order out of
disorder." Suppose you have an isosceles triangle and on one point
On the right, you can see the triangle get created using a simple JavaScript program. Here is some some sample code that can produce the "Sierpinski Triangle." #define MAX_TRIANGLE_X 320 /* The size of the base */ #define MAX_TRIANGLE_Y 200 /* The height of the triangle */ void SierpinskiTriangle() { int x, /* Current position */ y, i; /* Roll of the die */ x = MAX_TRIANGLE_X / 2; /* Select an initial position */ y = 0; while(1) { i = rand() % 6 + 1; /* Get a number from 1 to 6 */ switch(i) { case 1: case 2: x = (x + (MAX_TRIANGLE_X/2)) / 2; y = (y + 0) / 2; break; case 3: case 4: x = (x + 0) / 2; y = (y + MAX_TRIANGLE_Y) / 2; break; case 5: case 6: x = (x + MAX_TRIANGLE_X) / 2; y = (y + MAX_TRIANGLE_Y) / 2; break; } DrawPoint(x,y); /* Draw a point on the screen */ } } |