(* You should be able to copy and paste this text file directly into Mathematica. These notes will be interpreted as commented code. *) (* For problem 6 *) tentmap[x_] := Piecewise[{{3 x, x <= 1/2}, {3 - 3 x, x > 1/2}}] (* This defines the tent map *) Reduce[0 <= tentmap[x] <= 1] (* Reduces the inequality 0 <= tentmap[x] <= 1 to as simple a form as possible. In this case, Mathematica will return a list of inequalities separated by the "or" operator || *) (* In general, Reduce[] will reduce an expression to as simple a form as Mathematica can find. *) Reduce[0 <= Nest[tentmap, x, 2] <= 1] (* This finds the intervals that are mapped inside [0,1] by two iterations of the tent map. *) (* Nest[f,x,n] will compute the nth iterate f^n[x]. *) (* For problem 7 *) q[x_] := x^2 - 6 r1[x_] := Nest[q, x, 8] list1 := NSolve[r1[x] == x, x] (* This asks Mathematica to numerically compute the 256 points of order dividing 8 for q *) r1[x] - x /. list1 (* This evaluates r1[x] - x where x is replaced, successively, by the values in list1 *) (* If the computations are accurate, the results should be close to zero *) r2[x_] := (Nest[q, x, 8] - x)/(Nest[q, x, 4] - x) list2 = NSolve[r2[x] == 0, x] (* This asks Mathematica to numerically compute the 240 points of order exactly 8 for q *) (* This computation may take some time! *) r1[x] - x /. list2 (* This evaluates r1[x] - x where x is replaced, successively, by the values in list2 *) (* If the computations are accurate, the results should be close to zero *)