In the early 1970s S, R. may proposed a well-known model for studying insect population reproduction patterns: X [n + 1] = k * X [n] * (1-x [n])
X [n] indicates the number of nth generation groups. Given an initial X2 [0] value, and then iteratively, people find that the obtained sequence X2 n has many interesting phenomena with K values. When the K value is between 0 and 1, x [n] tends to be 0 after a certain number of iterations. when the k value is between 1 and 3, it tends to be 1/k. When the k value is greater than 3, X [n] Changes alternately between the two values after a certain number of iterations, when the K value is increased to the vicinity of 3.449, the alternating value changes to four. The K value continues to increase. The number of alternating values of X [n] rapidly doubles in the order of 4 → 8 → 16 → 32, and finally becomes chaotic. However, when the K value is near 3.835, after a certain number of iterations, χ [n] is very simple to alternate between the three values, then it grew rapidly in the order of 3 to 6 to 12. Such repetition hides surprising complexity in simple equations. Shows the variation of X [n] with k:
To reflect the infinite mysteries of this complexity, the small program compiled with TC2.0 uses the size of [n] to control the pronunciation frequency of PC speakers and set different K values, we can hear the sound of chaos.
# Include
# Include
Main (){
Int fMin = 20, fMax = 16000;/* fMin indicates the lowest frequency, and fMax indicates the highest frequency */
Int fDis, I, j;/* fDis indicates the difference between the highest frequency and the lowest frequency */
/* I, j is used for cyclic counting */
Float x = 0.1, k;/* x indicates the size of x [n]. set its initial value to 0.1, that is, x [0] = 0.1 */
FDis = fMax-fMin;
For (j = 1; j ++ ){
Printf ("Please input The value of k (1-4.0) \ n");/* input k value */
Printf ("If you want to quit, Please input: 0 \ n");/* If k = 0, exit */
Scanf ("% f", & k );
If (k = 0) break;
For (I = 1; I <100; I ++)/* remove the first 100 points */
X = k * x );
For (I = 1; I <100; I ++ ){
X = k * x * ();/* calculate the value of x */
Sound (x * fDis + 20);/* use the value of x to control the pronunciation frequency of PC speakers */
Delay (1000 );}
Nosound ();}}
When the above applet is executed, the K value is equivalent to a "Tuning knob ". When the K value is set between 1 and 3, there is only one tone in the speaker, which is repetitive and annoying. When the K value is slightly greater than 3, the rhythm is also-mi-so-mi .... When the K value increases to 3.449, it becomes so-fa-la-mi-so-fa-la-mi ..., With the K value increased, the rhythm became more complex and finally became the music work of the Modern Abstract composite. However, the rhythm is not infinitely complex with the increase of K value. When the K value increases to 3.835, the tone becomes mi-so-ti-mi-so-ti ..., Increasing the K value quickly becomes more complicated. Constantly changing the K value, listening carefully, will hear the infinite mysteries of chaos.