James Gleick's book Chaos: Making a New Science (Penguin Books, 1987) is a delightful account of the emerging science of ``chaos theory''. Chaos theory which is largely concerned with nonlinear systems, like our weather.
An early inspiration for chaos theory comes from biology (see pages 62-64 of Gleick's book). Biologists use the logistic difference equation to model the growth of a population over time. For simplicity, one can represent a population, say of fish in a pond, as a fraction between 0 and 1. The fraction 0 represents extinction, while 1 represents the greatest conceivable population of fish that will fit in the pond. A simple linear function, L(x) = r * x, that gives the population for the next year in terms of the current year's population, x, is inadequate, since it does not take limited resources into account. Instead, some biologists in the 1950s started to use a non-linear equation: the logistic difference equation:
P(r, x) = r * x * (1-x)This equation gives next year's population P(r,x) in terms of:
For example, if r is 2.7 and the population at year 0 is 0.02. The population at year 1 is 0.05292 = 2.7 * 0.02 * (1 - 0.02). The population at year 2 is about 0.1353. If you keep computing, you'll see that the population eventually reaches an equilibrium of about 0.6296.
To describe the process more concisely, we'll introduce a bit of notation. The notation is for iterations of a binary function f. Let iterate(f,r,0,x) = x, and for all integers k > 0, let iterate(f,r,k,x) = f(r, iterate(f,r,k-1,x)). The claim above is that for sufficiently large k and x > 0, iterate(P,2.7,k,x) is approximately 0.6296.
Does iterating the logistic difference equation always converge on a equilibrium population? Surprisingly, the answer is no! This is what you will investigate in your homework.
Read chapter 1, and refer to chapters 11 and 6 as needed in The Java Programming Language by Arnold and Gosling (Addison-Wesley, 1996).
Or read chapter 4 of Just Java by van der Linden (Prentice-Hall, 1997).
For reference, see also chapter 22 of The Java Language Specification by Gosling, Joy, and Steele (Addison-Wesley, 1996).
For information about running Java on the department machines, downloading, etc, see How to run Java at Iowa State, where you can also find links to other information about Java, including on-line tutorials.
This homework, like the others in this seminar, will be open-ended and somewhat ill-defined. we'll try to give you some idea of the difficulty/effort involved in each part. Do what you feel you have time for. For this first homework, I've chosen a very easy first part, since we'll be also learning Java syntax, and the Java compilers, linkers, etc. (Please do the entire first part before going on to the other parts).
The problems start out having you write programs. Eventually you can switch over to writing applets. It's best to do both, even if you don't get very far.
Bring a printout of your code to class, and be prepared to discuss it with other people in the class.