Experiment: The Computer May Lie

Goal: The aim of this experiment is to compute a number of orbits for several different functions and record the results. We will see as we proceed that the results generated by the computer can often be misleading or just plain wrong!

Procedure: Consider the following three functions.
1. F(x)  = (x^2) - 2
2. F(x)  = (x^2) + c for some c < -2 (you choose c)
3. The doubling function D.
For each of these functions, choose ten different initial seeds. For the doubling function,each seed should be in the interval [0,1). For F(x)  = (x^2) - 2, each seed should be in the interval (-2,2). For each chosen seed, compute the first 100 points on the corresponding orbit. Record the results by listing the initial seed together with what happened to the orbit; that is, determine whether the orbit is fixed, periodic, eventually periodic, or has no visible pattern.

Results: After collecting all your data, write a brief essay summarizing what you have seen for each function. Given your data, can you make any conjectures about the behavior of these functions? For a given function, do all (or almost all) orbits behave in the same way? Include in your essay your conjectures and speculations about each function.

Notes and Questions: 
1. For the doubling function, you should try certain rational values such as (Subscript[x, 0]) = (1/5)and (Subscript[x, 0]) = (1/9)whose orbits we already know. Do your results agree with what we already know? Or does the computer give false results? If so, can you explain why this happens? In a further essay, discuss the results of this experiment together with your theory for why the computer reacted the way it did.
2. As a hint, consider what would happen if your computer actually stored numbers in binary form. The computer would not store the entire binary expansion of a given number; rather, it would truncate this expansion so that only an approximation to the number is stored. That is, numbers in the interval 0 ≤ x < 1would be stored in the computer as a finite sum of the form\(TraditionalForm\`\(\^*\)\)
((Subscript[a, 1])/2) + ((Subscript[a, 2])/(2^2)) +  ...  + ((Subscript[a, n])/(2^n)).
What happens to such numbers under iteration of the doubling function?
3. If you have access to a program that does exact rational arithmetic (e.g. Mathematica), use this to compute orbits or rational numbers of the form p/q under the doubling function. What do you now see? Can you make any conjectures about orbits of rational points? 

\(TraditionalForm\`\(\^*\)\)In practice, the computer would most likely store the number in floating point form, which is a slight variation on this theme.

Initialization cell

You should change the definition of Equation for each case you want to analize. In this case it is set for (x^2) + c. The value of the parameter c will be given in the next cell.

Equation = Function[x, (x^2) + c];
$TextStyle = {FontFamily -> "Times", 
          FontSize -> 14};

Orbits for different seeds

With this cell we see the orbit of the InitialSeed. The variable n stands for the number of iterations.

c = -2;
n = 10;
InitialSeed = 0.1;
Orbit = NestList[Equation, InitialSeed, n]
\(ListPlot[Orbit, Frame -> True, Axes -> True, 
      PlotLabel -> \ \*""Time series for \!\(x\_0\) ="" <> 
          ToString[N[InitialSeed]], PlotJoined -> True, 
      PlotRange -> Automatic, 
      FrameLabel -> {"n", \*""\!\(x\_n\)""}, 
      RotateLabel -> False, ImageSize -> 500]; 
    Clear[n];\)