(************** Content-type: application/mathematica ************** CreatedBy='Mathematica 5.2' Mathematica-Compatible Notebook This notebook can be used with any Mathematica-compatible application, such as Mathematica, MathReader or Publicon. The data for the notebook starts with the line containing stars above. To get the notebook into a Mathematica-compatible application, do one of the following: * Save the data starting with the line of stars above into a file with a name ending in .nb, then open the file inside the application; * Copy the data starting with the line of stars above to the clipboard, then use the Paste menu command inside the application. Data for notebooks contains only printable 7-bit ASCII and can be sent directly in email or through ftp in text mode. Newlines can be CR, LF or CRLF (Unix, Macintosh or MS-DOS style). NOTE: If you modify the data for this notebook not in a Mathematica- compatible application, you must delete the line below containing the word CacheID, otherwise Mathematica-compatible applications may try to use invalid cache data. For more information on notebooks and Mathematica-compatible applications, contact Wolfram Research: web: http://www.wolfram.com email: info@wolfram.com phone: +1-217-398-0700 (U.S.) Notebook reader applications are available free of charge from Wolfram Research. *******************************************************************) (*CacheID: 232*) (*NotebookFileLineBreakTest NotebookFileLineBreakTest*) (*NotebookOptionsPosition[ 31888, 1298]*) (*NotebookOutlinePosition[ 32591, 1323]*) (* CellTagsIndexPosition[ 32547, 1319]*) (*WindowFrame->Normal*) Notebook[{ Cell[TextData[{ "Introduction to ", StyleBox["Mathematica \[MathematicaIcon]", FontSlant->"Italic"] }], "Title"], Cell["2. More about Functions and Lists", "Subtitle"], Cell["\<\ P. S. Cally, School of Mathematical Sciences, Monash \ University\ \>", "Author"], Cell[CellGroupData[{ Cell["Ways to Define Functions, Map, and Apply", "Section"], Cell["The following three definitions are equivalent:", "Text"], Cell[BoxData[ \(\(f[x_] = x\^2;\)\)], "Input"], Cell[BoxData[ \(\(g = Function[x, x\^2];\)\)], "Input"], Cell[BoxData[ \(\(h = #\^2 &;\)\)], "Input"], Cell["\<\ (# represents the argument, and & says this is a pure function). \ Let's check:\ \>", "Text"], Cell[BoxData[ \(TableForm[Table[{x, f[x], g[x], h[x]}, {x, 1, 6}], TableHeadings \[Rule] {None, {"\", "\", "\", \ "\"}}]\)], "Input"], Cell["\<\ We don't need these definitions anymore, so let's clear them.\ \>", \ "Text"], Cell[BoxData[ \(Clear[f, g, h]\)], "Input"], Cell["\<\ g and h are called \"pure functions\". They are very useful for use \ with many utilities such as Map, Apply, and Nest. For example \ Map[function,list] maps the function onto the list:\ \>", "Text"], Cell[BoxData[ \(Map[Exp, {1, 2, 3, 4, 5}]\)], "Input"], Cell[TextData[{ "That's fine if your function has a simple name. But what if we wanted to \ find ", Cell[BoxData[ \(TraditionalForm\`1\/\(x + 1\)\)]], " for a set of values" }], "Text"], Cell[BoxData[ \(Map[1\/\(1 + #\) &, {1, 2, 3, 4, 5}]\)], "Input"], Cell["\<\ The function here must be \"pure\", i.e., just the function name, \ and not the [\[Ellipsis]] part. A more convenient short-cut notation for Map \ is /@, thus\ \>", "Text"], Cell[BoxData[ \(\(1\/\(1 + #\) &\)\ /@ \ {1, 2, 3, 4, 5}\)], "Input"], Cell["\<\ Actually, there's an even simpler way to do this sort of thing in \ many instances:\ \>", "Text"], Cell[BoxData[ \(Exp[Range[1, 5]]\)], "Input"], Cell["\<\ This works because the exponential function has the attribute \ Listable, so it automatically applies individually to every element of a \ list.\ \>", "Text"], Cell[BoxData[ \(Attributes[Exp]\)], "Input"], Cell["\<\ Now take some arbitrary function which is not defined to be \ Listable:\ \>", "Text"], Cell[BoxData[ \(Attributes[f]\)], "Input"], Cell[BoxData[ \(f[Range[1, 5]]\)], "Input"], Cell["\<\ Do you see that f did not thread over the list. But we can change \ that:\ \>", "Text"], Cell[BoxData[ \(SetAttributes[f, Listable]\)], "Input"], Cell[BoxData[ \(f[Range[1, 5]]\)], "Input"], Cell["Of course, we could also have done this:", "Text"], Cell[BoxData[ \(f /@ Range[1, 5]\)], "Input"], Cell["Many built-in mathematical functions are Listable", "Text"], Cell[BoxData[ \(Attributes[FresnelS]\)], "Input"], Cell["\<\ but of course many are not. It would not make sense to make this \ Listable:\ \>", "Text"], Cell[BoxData[ \(Attributes[Eigenvalues]\)], "Input"], Cell["\<\ Now here is Apply[function,list], which applies the function to the \ whole list, e.g, Apply[f,{a,b,c,\[Ellipsis]}]=f[a,b,c,\[Ellipsis]]. Here is a \ common example:\ \>", "Text"], Cell[BoxData[ \(Apply[Plus, {1, 2, 3, 4, 5}]\)], "Input"], Cell["or more conveniently", "Text"], Cell[BoxData[ \(Plus @@ Range[5]\)], "Input"], Cell["This adds all the elements in a list. To multiply them", "Text"], Cell[BoxData[ \(Times @@ Range[5]\)], "Input"], Cell["which is of course", "Text"], Cell[BoxData[ \(\(5!\)\)], "Input"] }, Closed]], Cell[CellGroupData[{ Cell["Nest and its ilk", "Section"], Cell[TextData[{ "Given a \"seed\" x, we can form a list {", StyleBox["x, f(x), f(f(x), f(f(f(x))), \[Ellipsis]", FontSlant->"Italic"], "} using NestList" }], "Text"], Cell[BoxData[ \(NestList[Cos, 1. , 40]\)], "Input"], Cell["\<\ If you are only interested in the final value, just use Nest \ instead, rather than NestList which gives all the intermediate results.\ \>", \ "Text"], Cell[BoxData[ \(Nest[Cos, 1. , 40]\)], "Input"], Cell[TextData[{ "Noiw, the sharp witted amongst you will have noticed that our NestList \ example above seemed to be settling down to some limit. How can we find what \ that is? Of course, we could try NestList with a big enough ", StyleBox["n", FontSlant->"Italic"], ", but we don't know how big ", StyleBox["n", FontSlant->"Italic"], " should be except by trial and error. A better idea is to use FixedPoint:" }], "Text"], Cell[BoxData[ \(FixedPoint[Cos, 1. ]\)], "Input"], Cell[TextData[{ "FixedPoint keeps applying more and more layers of f until the result \ doesn't change any more. In this way we have actually solved the \ trancendental equation cos ", StyleBox["x ", FontSlant->"Italic"], "= ", StyleBox["x", FontSlant->"Italic"], " using the fixed point method!" }], "Text"], Cell[BoxData[ \(Cos[%] \[Equal] %\)], "Input"], Cell[TextData[{ StyleBox["Mathematica", FontSlant->"Italic"], "'s built in general purpose root finder FindRoot (which in this instance \ uses Newton's method with 0.7 as a starting guess) agrees:" }], "Text"], Cell[BoxData[ \(FindRoot[Cos[x] \[Equal] x, {x, .7}]\)], "Input"], Cell[TextData[{ "But of course, the fixed point method doesn't always work (we can show \ that solving ", StyleBox["f(x)", FontSlant->"Italic"], "=", StyleBox["x", FontSlant->"Italic"], " to find the solution ", StyleBox["x", FontSlant->"Italic"], "=", StyleBox["X", FontSlant->"Italic"], " by the fixed point method only works if ", StyleBox["| f ' (X) | < 1", FontSlant->"Italic"], "). For example, solving ", Cell[BoxData[ \(TraditionalForm\`x\^2 = \ x\)]], ", we obviously have two solutions, 0 and 1. Let's try using the fixed \ point method to find the x=1 root by starting out iterations very close to \ it:" }], "Text"], Cell[BoxData[ \(NestList[#\^2 &, .999, 20]\)], "Input"], Cell[TextData[{ "Clearly, it ran away from x=1 and homed in on x=0. This is predictable \ from the graph, since the slope of ", Cell[BoxData[ \(TraditionalForm\`x\^2\)]], "at 1 exceeds 1, but vanishes at 0." }], "Text"], Cell[BoxData[ \(\(Plot[{x, x\^2}, {x, \(- .2\), 1.2}];\)\)], "Input"], Cell[TextData[{ "Here we see the rapid convergence to the ", StyleBox["x=0", FontSlant->"Italic"], " root." }], "Text"], Cell[BoxData[ \(FixedPointList[#\^2 &, .999]\)], "Input"], Cell["We can get rid of all those ludicrously small numbers:", "Text"], Cell[BoxData[ \(FixedPointList[Chop[#\^2] &, .999]\)], "Input"] }, Closed]], Cell[CellGroupData[{ Cell["Functions with Conditions", "Section"], Cell["\<\ Frequently, we wish to define function only for certain values of \ their argument. For example, we may set\ \>", "Text"], Cell[BoxData[ \(f[x_] := \@x /; x \[GreaterEqual] 0\)], "Input"], Cell[TextData[{ "meaning that f(x) is ", Cell[BoxData[ \(TraditionalForm\`\@x\ on\ the\ condition\ that\ x\ is\ non - negative\)]], ";" }], "Text"], Cell[BoxData[ \(f[4]\)], "Input"], Cell[BoxData[ \(f[\(-3\)]\)], "Input"], Cell[TextData[{ StyleBox["f", FontSlant->"Italic"], " is undefined for negative arguments! Of course, we can also define ", StyleBox["f", FontSlant->"Italic"], " for negative ", StyleBox["x ", FontSlant->"Italic"], "if we wish:" }], "Text"], Cell[BoxData[ \(f[x_] := Sin[x] /; x < 0\)], "Input"], Cell[BoxData[ \(\(Plot[f[x], {x, \(-5\), 5}];\)\)], "Input"], Cell[TextData[{ "Let's just check how ", StyleBox["Mathematica", FontSlant->"Italic"], " thinks of ", StyleBox["f", FontSlant->"Italic"], "." }], "Text"], Cell[BoxData[ \(\(?f\)\)], "Input"], Cell[BoxData[ \(Clear[f]\)], "Input"], Cell["Now here is an interesting function you will know all about.", "Text"], Cell[BoxData[ \(g[x_] := Sin[x]\/x\)], "Input"], Cell["It is easily evaluated at any point,", "Text"], Cell[BoxData[ \(g[1.0]\)], "Input"], Cell[TextData[{ "\[Ellipsis] except ", StyleBox["x=0", FontSlant->"Italic"], ", where it is not defined (or, as ", StyleBox["Mathematica", FontSlant->"Italic"], " says, it is Indeterminate)." }], "Text"], Cell[BoxData[ \(g[0. ]\)], "Input"], Cell["\<\ Yet we know how to \"fill in the gap\" to make the function \ continuous\ \>", "Text"], Cell[BoxData[ \(Limit[g[x], x \[Rule] 0]\)], "Input"], Cell[BoxData[ \(Clear[g]\)], "Input"], Cell[BoxData[ \(g[x_] := Sin[x]\/x /; x \[NotEqual] 0\)], "Input"], Cell[BoxData[ \(g[0] = 1; g[0. ] = 1;\)], "Input"], Cell[BoxData[ \(\(?g\)\)], "Input"], Cell[BoxData[ \(TableForm[Table[{x, g[x]}, {x, \(-5. \), 5. }]]\)], "Input"], Cell[BoxData[ \(\(Plot[g[x], {x, \(-25\), 25}, PlotPoints \[Rule] 100, PlotRange \[Rule] All, Frame \[Rule] True];\)\)], "Input"], Cell[BoxData[ \(Clear[g]\)], "Input"], Cell["\<\ There is an even more convenient way to do this sort of thing in \ some cases. Say I want to define a function which applies for integer \ arguments only.\ \>", "Text"], Cell[BoxData[ \(f[n_Integer] := \ Range[n]\)], "Input"], Cell["\<\ This says that f is defined for any argument that has integer \ \"head\". Let's see what heads some types of numbers have:\ \>", "Text"], Cell[BoxData[ \(Head[3]\)], "Input"], Cell[BoxData[ \(Head[1\/3]\)], "Input"], Cell[BoxData[ \(Head[4.5]\)], "Input"], Cell[BoxData[ \(Head[1 + 2 \[ImaginaryI]]\)], "Input"], Cell[BoxData[ \(Head[y]\)], "Input"], Cell["So, let's try it for integer argument", "Text"], Cell[BoxData[ \(f[3]\)], "Input"], Cell["and for non-integer", "Text"], Cell[BoxData[ \(f[3.1]\)], "Input"], Cell[BoxData[ \(Clear[f]\)], "Input"] }, Closed]], Cell[CellGroupData[{ Cell["Piecewise Functions", "Section"], Cell["\<\ There are many ways to define piecewise functions. We have already \ seen how to do it with /; but here are some other methods. The basic \ If[test,then,else] construct is fine if there are only two \ possibilities:\ \>", "Text"], Cell[BoxData[ \(\(Plot[If[x > 0, 1 - x\^2, \(-1\)], {x, \(-1.1\), 1.1}, PlotStyle \[Rule] {{RGBColor[0, 0, 1]}}];\)\)], "Input"], Cell["With more, it is better to use Piecewise", "Text"], Cell[BoxData[ \(f[x_] := Piecewise[{{x\^2, x \[GreaterEqual] 1}, {x, \(-1\) < x < 1}, {\(-1\), x \[LessEqual] \(-1\)}}]\)], "Input"], Cell[BoxData[ \(\(Plot[f[x], {x, \(-3\), 3}];\)\)], "Input"], Cell["\<\ or equivalently pw followed by ctr+, and ctrl+enter to \ construct\ \>", "Text"], Cell[BoxData[ RowBox[{\(g[x_]\), ":=", RowBox[{"\[Piecewise]", GridBox[{ {\(x\^2\), \(x \[GreaterEqual] 1\)}, {"x", \(\(-1\) < x < 1\)}, {\(-1\), \(x \[LessEqual] \(-1\)\)} }]}]}]], "Input"], Cell[BoxData[ \(\(Plot[g[x], {x, \(-3\), 3}];\)\)], "Input"], Cell["Another option is Which:", "Text"], Cell[BoxData[ \(h[x_] := Which[x \[GreaterEqual] 1, x\^2, \(-1\) < x < 1, x, True, \(-1\)]\)], "Input"], Cell[BoxData[ \(\(Plot[h[x], {x, \(-3\), 3}];\)\)], "Input"], Cell["Clean up!", "Text"], Cell[BoxData[ \(Clear[f, g, h]\)], "Input"] }, Closed]], Cell[CellGroupData[{ Cell["Rules and Pattern Matching", "Section"], Cell["\<\ ReplaceAllexpression,rule], or expression /. rule, specifies that \ the rule is used to make substitutions in expression. For example,\ \>", \ "Text"], Cell[BoxData[ \(x\^2 /. x \[Rule] 3\)], "Input"], Cell[TextData[{ "In this case, ", StyleBox["x", FontSlant->"Italic"], " is replaced by a and ", Cell[BoxData[ \(TraditionalForm\`x\^2\ by\ x\ at\ the\ same\ \(\(time\)\(.\)\)\)]] }], "Text"], Cell[BoxData[ \(x + x\^2 /. {x \[Rule] a, x\^2 \[Rule] x}\)], "Input"], Cell["\<\ Here though, the replacement is performed repeatedly until nothing \ changes.\ \>", "Text"], Cell[BoxData[ \(x + x\^2 //. {x \[Rule] a, x\^2 \[Rule] x}\)], "Input"], Cell[TextData[{ "Solutions coming from many ", StyleBox["Mathematica", FontSlant->"Italic"], " utilities are presented in the form of rules, e.g.," }], "Text"], Cell[BoxData[ \(FindRoot[x\^5 + x\^\[Pi] \[Equal] 1, {x, .5}]\)], "Input"], Cell["\<\ Sometimes, when wanting to make substitutions, we may need to use \ \"pattern matching\":\ \>", "Text"], Cell[BoxData[ \(f[a] + f[b] /. f[x_] \[Rule] x\^2\)], "Input"], Cell["although this could also have been done with", "Text"], Cell[BoxData[ \(f[a] + f[b] /. f \[Rule] Function[x, x\^2]\)], "Input"], Cell["\<\ Here we try to find the positions in a list which are powers of x. \ Try\ \>", "Text"], Cell[BoxData[ \(Position[{Sin[x], Tan[x], x\^3, y\^2, Log[x], x\^4 + z\^3 + 2}, x\^n_]\)], "Input"], Cell[TextData[{ "The {3} is easy to understand, but what does the {6,2} mean? Well, element \ 6 is ", Cell[BoxData[ \(x\^4 + z\^3 + 2\)]], ". How does ", StyleBox["Mathematica", FontSlant->"Italic"], " define this?" }], "Text"], Cell[BoxData[ \(FullForm[x\^4 + z\^3 + 2]\)], "Input"], Cell["And what is the second part?", "Text"], Cell[BoxData[ \(%\[LeftDoubleBracket]2\[RightDoubleBracket]\)], "Input"], Cell["Aha, now that makes sense.", "Text"], Cell[TextData[{ "Fine, so we found the ", Cell[BoxData[ \(TraditionalForm\`x\^3\ alright, \ and\ the\ part\ of\ the\ \(6\^th\) element\ that\ is\ a\ power\ of\ x, \ but\ it\ did\ not\ find\ the\ powers\ of\ y\ or\ \(\(z\)\(.\)\)\)]], " If we wanted them as well we may do" }], "Text"], Cell[BoxData[ \(Position[{Sin[x], Tan[x], x\^3, y\^2, Log[x], x\^4 + z\^3 + 2}, x_\^n_]\)], "Input"] }, Closed]], Cell[CellGroupData[{ Cell["Functions with Defaults", "Section"], Cell["\<\ Frequently, we want to define functions of several variables where \ one or more arguments need not be given if they are to take on default \ values. For example, define\ \>", "Text"], Cell[BoxData[ \(f[x_, y_] := x\^y\)], "Input"], Cell[BoxData[ \(f[2, 3]\)], "Input"], Cell[BoxData[ \(f[a, b]\)], "Input"], Cell[TextData[{ "Of course, ", StyleBox["f(3)", FontSlant->"Italic"], " is undefined:" }], "Text"], Cell[BoxData[ \(f[3]\)], "Input"], Cell[TextData[{ "But here is how we can define ", StyleBox["y", FontSlant->"Italic"], " to have default 1." }], "Text"], Cell[BoxData[ \(Clear[f]\)], "Input"], Cell[BoxData[ \(f[x_, y_: 1] := x\^y\)], "Input"], Cell[BoxData[ \(f[2, 3]\)], "Input"], Cell[BoxData[ \(f[3]\)], "Input"], Cell["\<\ Another useful way to include optional arguments, especially option \ rules, is to use the triple underline a___ rather than a_ in the function \ definition. This refers to zero or more entries. For example, here opts can \ be any (or no) sequence of options to Plot.\ \>", "Text"], Cell[BoxData[ \(Clear[f]\)], "Input"], Cell[BoxData[ \(plt[f_, a_, b_, opts___] := Plot[f[x] + f[x]\^2, {x, a, b}, opts]\)], "Input"], Cell[BoxData[ \(\(plt[Sin[#] + Cos[#\^2] &, 0, 3 \[Pi]];\)\)], "Input"], Cell[BoxData[ \(\(plt[Sin[#] + Cos[#\^2] &, 0, 3 \[Pi], Frame \[Rule] True, Axes \[Rule] {True, False}, FrameLabel \[Rule] {"\", "\"}, PlotStyle \[Rule] {{Hue[ .6]}}, RotateLabel \[Rule] False, Epilog -> {PointSize[0.03], Hue[1], Point[{\[Pi], 4}]}, PlotPoints \[Rule] 250];\)\)], "Input"] }, Closed]], Cell[CellGroupData[{ Cell["Recursion and Functions which Remember", "Section"], Cell[TextData[{ "Of course, ", StyleBox["Mathematica", FontSlant->"Italic"], " has a built in factorial function" }], "Text"], Cell[BoxData[ \(\(13!\)\)], "Input"], Cell["\<\ But just as an exercise, let's see how we could write one ourselves \ (just for integers).\ \>", "Text"], Cell[BoxData[ \(\(fac[0] = 1;\)\)], "Input"], Cell[BoxData[ \(fac[n_Integer] := n*fac[n - 1]\)], "Input"], Cell[BoxData[ \(fac[9]\)], "Input"], Cell[BoxData[ \(\(?fac\)\)], "Input"], Cell[TextData[{ "This works through recursion. This may be a little inefficient though if \ we intend to use fac many times. For example, if I wanted fac(12) it would \ first have to work out fac(1), then fac(2), etc. But I may have already \ calculated fac(9) earlier. It ", StyleBox["might", FontWeight->"Bold"], " make sense to store these (it doesn't for the factorial because they are \ so cheap to calculate -- it's a trade off between computation time and \ storage). Here's how to do it:" }], "Text"], Cell[BoxData[ \(Clear[fac]\)], "Input"], Cell[BoxData[ \(\(fac[0] = 1;\)\)], "Input"], Cell[BoxData[ \(fac[n_Integer] := \(fac[n] = n*fac[n - 1]\)\)], "Input"], Cell[BoxData[ \(fac[9]\)], "Input"], Cell[TextData[{ "Let's now see how ", StyleBox["Mathematica", FontSlant->"Italic"], " defines f." }], "Text"], Cell[BoxData[ \(\(?fac\)\)], "Input"], Cell["\<\ All values up to f[9] are stored, along with the recursion rule. If \ we now ask for f(12), it picks up from there and fills the gap.\ \>", "Text"], Cell[BoxData[ \(fac[12]\)], "Input"], Cell[BoxData[ \(\(?fac\)\)], "Input"], Cell[BoxData[ \(Clear[fac]\)], "Input"] }, Closed]], Cell[CellGroupData[{ Cell["Vectors", "Section"], Cell["\<\ We can do vector calculus with the aid of a standard package:\ \>", \ "Text"], Cell[BoxData[ \(<< Calculus`VectorAnalysis`\)], "Input"], Cell["Choose our coordinate system:", "Text"], Cell[BoxData[ \(SetCoordinates[Cartesian[x, y, z]]\)], "Input"], Cell["Check:", "Text"], Cell[BoxData[ \({CoordinateSystem, Coordinates[]}\)], "Input"], Cell["Define a scalar field:", "Text"], Cell[BoxData[ \(f[x_, y_, z_] := x\ \(y\^2\) Cos[x\ z]\)], "Input"], Cell["Now we can take its grad:", "Text"], Cell[BoxData[ \(gradf = Grad[f[x, y, z]]\)], "Input"], Cell["\<\ Of course, you know what happens when you take the curl of a \ grad:\ \>", "Text"], Cell[BoxData[ \(Curl[gradf]\)], "Input"], Cell["Define a constant vector:", "Text"], Cell[BoxData[ \(\(a = {1, 2, 3};\)\)], "Input"], Cell["Take a dot product", "Text"], Cell[BoxData[ \(a . gradf\)], "Input"], Cell["or", "Text"], Cell[BoxData[ \(DotProduct[a, gradf]\)], "Input"], Cell["And a cross product:", "Text"], Cell[BoxData[ \(CrossProduct[a, f]\)], "Input"], Cell["Here's div:", "Text"], Cell[BoxData[ \(Div[gradf]\)], "Input"], Cell[BoxData[ \(% // Simplify\)], "Input"], Cell["\<\ \[Ellipsis] and much much more. You can also do all this in many \ other coordinate systems;\ \>", "Text"], Cell[BoxData[ FormBox[GridBox[{ {Cell[TextData[StyleBox["Bipolar", GridBoxOptions->{RowSpacings->0.4, RowLines->False}]], GridBoxOptions->{RowSpacings->0.4, RowLines->False}], Cell[TextData[StyleBox["Bispherical", GridBoxOptions->{RowSpacings->0.4, RowLines->False}]], GridBoxOptions->{RowSpacings->0.4, RowLines->False}]}, {Cell[TextData[StyleBox["Cartesian", GridBoxOptions->{RowSpacings->0.4, RowLines->False}]], GridBoxOptions->{RowSpacings->0.4, RowLines->False}], Cell[TextData[StyleBox[ "ConfocalEllipsoidal", GridBoxOptions->{RowSpacings->0.4, RowLines->False}]], GridBoxOptions->{RowSpacings->0.4, RowLines->False}]}, {Cell[TextData[StyleBox["ConfocalParaboloidal", GridBoxOptions->{RowSpacings->0.4, RowLines->False}]], GridBoxOptions->{RowSpacings->0.4, RowLines->False}], Cell[TextData[StyleBox["Conical", GridBoxOptions->{RowSpacings->0.4, RowLines->False}]], GridBoxOptions->{RowSpacings->0.4, RowLines->False}]}, {Cell[TextData[StyleBox["Cylindrical", GridBoxOptions->{RowSpacings->0.4, RowLines->False}]], GridBoxOptions->{RowSpacings->0.4, RowLines->False}], Cell[TextData[StyleBox[ "EllipticCylindrical", GridBoxOptions->{RowSpacings->0.4, RowLines->False}]], GridBoxOptions->{RowSpacings->0.4, RowLines->False}]}, {Cell[TextData[StyleBox["OblateSpheroidal", GridBoxOptions->{RowSpacings->0.4, RowLines->False}]], GridBoxOptions->{RowSpacings->0.4, RowLines->False}], Cell[TextData[StyleBox[ "ParabolicCylindrical", GridBoxOptions->{RowSpacings->0.4, RowLines->False}]], GridBoxOptions->{RowSpacings->0.4, RowLines->False}]}, {Cell[TextData[StyleBox["Paraboloidal", GridBoxOptions->{RowSpacings->0.4, RowLines->False}]], GridBoxOptions->{RowSpacings->0.4, RowLines->False}], Cell[TextData[StyleBox["ProlateSpheroidal", GridBoxOptions->{RowSpacings->0.4, RowLines->False}]], GridBoxOptions->{RowSpacings->0.4, RowLines->False}]}, {Cell[TextData[StyleBox["Spherical", GridBoxOptions->{RowSpacings->0.4, RowLines->False}]], GridBoxOptions->{RowSpacings->0.4, RowLines->False}], Cell[TextData[StyleBox["Toroidal", GridBoxOptions->{RowSpacings->0.4, RowLines->False}]], GridBoxOptions->{RowSpacings->0.4, RowLines->False}]} }, ColumnAlignments->{Left}], TraditionalForm]], "Text"] }, Closed]], Cell[CellGroupData[{ Cell["Exercises", "ExerciseMain"], Cell["\<\ Do not look at the solution until you have completed the \ exercise!\ \>", "Text", TextAlignment->Center, FontFamily->"Helvetica", FontSize->18, FontWeight->"Bold", FontColor->RGBColor[1, 0, 0]], Cell[CellGroupData[{ Cell["Using Map and Apply", "Exercise"], Cell[TextData[{ "Write a function ", StyleBox["h", FontSlant->"Italic"], " which calculates the sum of the prime factors of an integer (e.g., ", Cell[BoxData[ \(TraditionalForm\`h( 12) = \(h(\(2\^2\) 3) = \(\(2 + 2 + 3\)\(=\)\(7\)\(\ \)\)\)\)]], "). You will need FactorInteger. Make sure it only applies to integers. \ Construct a table of ", StyleBox["h(n)", FontSlant->"Italic"], " against ", StyleBox["n", FontSlant->"Italic"], " for ", StyleBox["n", FontSlant->"Italic"], "=1,2,\[Ellipsis],100, and plot it using ListPlot. (Try to make the table \ without using Table[\[Ellipsis]].)" }], "Text"] }, Open ]], Cell[CellGroupData[{ Cell["Solution", "Subsubsection"], Cell[BoxData[ \(Clear[h]\)], "Input"], Cell[BoxData[ \(h[n_Integer] := Plus @@ \((\(Times @@ # &\) /@ FactorInteger[n])\)\)], "Input"], Cell[BoxData[ \(Table[{n, h[n]}, {n, 1, 100}]\)], "Input"], Cell["or alternatively", "Text"], Cell[BoxData[ \(\({#, h[#]} &\) /@ Range[100]\)], "Input"], Cell[BoxData[ \(\(ListPlot[%];\)\)], "Input"], Cell[BoxData[ \(Clear[h]\)], "Input"] }, Closed]], Cell[CellGroupData[{ Cell["Fixed Point and Root Finding", "Exercise"], Cell[TextData[{ "Graphically estimate the first positive root of tan ", StyleBox["x ", FontSlant->"Italic"], "= 2", StyleBox["x", FontSlant->"Italic"], ". Is the obvious fixed point scheme ", Cell[BoxData[ \(TraditionalForm\`x = \(1\/2\) tan\ x\ convergent\ for\ this\ \(\(point\)\(?\)\(\ \)\)\)]], "If not, construct a ", StyleBox["convergent", FontWeight->"Bold"], " fixed point method and apply it to solve for ", StyleBox["x", FontSlant->"Italic"], ". Check your answer using FindRoot." }], "Text"] }, Open ]], Cell[CellGroupData[{ Cell["Solution", "Subsubsection"], Cell[BoxData[ \(\(Plot[{Tan[x], 2 x}, {x, 0, 1.4}];\)\)], "Input"], Cell[BoxData[ \(\(Plot[{ArcTan[2 x], x}, {x, 0, 1.4}];\)\)], "Input"], Cell[BoxData[ \(NestList[\(1\/2\) Tan[#] &, 1.2, 23]\)], "Input"], Cell[BoxData[ \(FullForm /@ FixedPointList[ArcTan[2 #] &, 1.2]\)], "Input"], Cell[BoxData[ \(x /. FindRoot[Tan[x] \[Equal] 2 x, {x, 1.2}] // FullForm\)], "Input"] }, Closed]], Cell[CellGroupData[{ Cell["Finding a Needle in a Haystack", "Exercise"], Cell[TextData[{ "Construct a list ", StyleBox["v", FontWeight->"Bold"], " of 100 integers randomly chosen from 1,2,\[Ellipsis],100, and then \ construct an ", StyleBox["ordered", FontWeight->"Bold"], " list of all those which are prime. Finally, make an ordered list of all \ primes in 1,2,\[Ellipsis],100 which are ", StyleBox["not", FontWeight->"Bold"], " in your list. You will need to rumage around in the help utility to find \ how to do this." }], "Text"] }, Open ]], Cell[CellGroupData[{ Cell["Solution", "Subsubsection"], Cell[BoxData[ \(v = Table[Random[Integer, {1, 100}], {100}]\)], "Input"], Cell[BoxData[ \(p = Select[v, PrimeQ] // Sort\)], "Input"], Cell[BoxData[ \(allprimes = Prime[Range[PrimePi[100]]]\)], "Input"], Cell[BoxData[ \(Complement[allprimes, p]\)], "Input"], Cell["\<\ By the way, note that Prime has the attribute Listable, so we \ didn't need to write Prime/@Range[PrimePi[100]], though this would of course \ still work.\ \>", "Text"], Cell[BoxData[ \(?? Prime\)], "Input"] }, Closed]], Cell[CellGroupData[{ Cell["Define a function of an arbitrary number of variables", "Exercise"], Cell[TextData[{ "Define a function ", StyleBox["f", FontSlant->"Italic"], " which takes an arbitrary number of arguments x,y,z,\[Ellipsis] and \ returns ", Cell[BoxData[ \(TraditionalForm\`x\^\(y\^\(z\^\[AscendingEllipsis]\)\)\)]], ". By the way, does ", StyleBox["Mathematica", FontSlant->"Italic"], " interpret ", Cell[BoxData[ \(TraditionalForm\`x\^\(y\^z\)\)]], "as x^(y^z) or as (x^y)^z?" }], "Text"] }, Open ]], Cell[CellGroupData[{ Cell["Solution", "Subsubsection"], Cell[BoxData[ \(f[x_, y___] := x\^y\)], "Input"], Cell[BoxData[ \(f[a, b, c, d]\)], "Input"], Cell[BoxData[ \(f[2, 3, 4]\)], "Input"], Cell[BoxData[ \({2^\((3^4)\), \((2^3)\)^4}\)], "Input"], Cell[BoxData[ \(Clear[f]\)], "Input"] }, Closed]], Cell[CellGroupData[{ Cell["Recursion", "Exercise"], Cell[TextData[{ "Write a function ", StyleBox["with memory", FontWeight->"Bold"], " to generate the Fibonacci sequence 1,1,2,3,5,8,\[Ellipsis], where each \ element is the sum of the two previous. Counting from one, so that fib(1)=1, \ fib(2)=1, etc, find fib(10) and fib(20). Check using the built-in function \ Fibonnaci[\[Ellipsis]]." }], "Text"] }, Open ]], Cell[CellGroupData[{ Cell["Solution", "Subsubsection"], Cell[BoxData[ \(Clear[fib]\)], "Input"], Cell[BoxData[ \(\(fib[1] = \(fib[2] = 1\);\)\)], "Input"], Cell[BoxData[ \(fib[n_Integer] := \(fib[n] = fib[n - 1] + fib[n - 2]\)\)], "Input"], Cell[BoxData[ \(fib[10]\)], "Input"], Cell[BoxData[ \(fib[20]\)], "Input"], Cell[BoxData[ \(Fibonacci[20]\)], "Input"], Cell[BoxData[ \(\(?fib\)\)], "Input"], Cell[BoxData[ \(Clear[fib]\)], "Input"] }, Closed]], Cell[CellGroupData[{ Cell["Vectors", "Exercise"], Cell[TextData[{ "Set your default coordinate system to be spherical {r,\[Theta],\[Phi]}. \ Use CoordinatesToCartesian[ ] to find the Cartesian coordinates of r=2, ", Cell[BoxData[ \(TraditionalForm\`\[Theta] = 30 \[Degree], \[Phi] = 15 \[Degree]\)]], ". Check your answer using CoordinatesFromCartesian[ ]. Letting ", Cell[BoxData[ \(TraditionalForm\`f(r, \[Theta], \[Phi]) = r\^3\)]], " sin(\[Theta]+\[Phi])cos(3\[Theta]-2\[Phi]), find ", Cell[BoxData[ FormBox[ RowBox[{ StyleBox["\[Del]", FontWeight->"Bold"], "f"}], TraditionalForm]]], ", ", Cell[BoxData[ \(TraditionalForm\`\(\(\[Del]\^2 f\)\(,\)\)\)]], " ", StyleBox["\[Del]", FontWeight->"Bold"], "\[Times](", StyleBox["f ", FontSlant->"Italic"], StyleBox["\[Del]", FontWeight->"Bold"], StyleBox["f", FontSlant->"Italic"], "). Explain this last result." }], "Text"] }, Open ]], Cell[CellGroupData[{ Cell["Solution", "Subsubsection"], Cell[BoxData[ \(SetCoordinates[Spherical[r, \[Theta], \[Phi]]]\)], "Input"], Cell["Check:", "Text"], Cell[BoxData[ \({CoordinateSystem, Coordinates[]}\)], "Input"], Cell[BoxData[ \(CoordinatesToCartesian[{2, 30 Degree, 15 Degree}]\)], "Input"], Cell[BoxData[ \(CoordinatesFromCartesian[%] // N\)], "Input"], Cell[BoxData[ \({2, 30 Degree, 15 Degree} // N\)], "Input"], Cell[BoxData[ \(f[r_, \[Theta]_, \[Phi]_] := r\^3\ Sin[\[Theta] + \[Phi]] Cos[3 \[Theta] - 2 \[Phi]]\)], "Input"], Cell[BoxData[ \(Grad[f[r, \[Theta], \[Phi]]] // Simplify\)], "Input"], Cell[BoxData[ \(Laplacian[f[r, \[Theta], \[Phi]]] // Simplify\)], "Input"], Cell[BoxData[ \(Curl[f[r, \[Theta], \[Phi]] Grad[f[r, \[Theta], \[Phi]]]] // Simplify\)], "Input"], Cell[TextData[{ StyleBox["\[Del]", FontWeight->"Bold"], "\[Times](", StyleBox["f ", FontSlant->"Italic"], StyleBox["\[Del]", FontWeight->"Bold"], StyleBox["f", FontSlant->"Italic"], ") = ", StyleBox["\[Del]", FontWeight->"Bold"], StyleBox["f", FontSlant->"Italic"], " \[Times] ", StyleBox["\[Del]", FontWeight->"Bold"], StyleBox["f", FontSlant->"Italic"], " + ", StyleBox["f ", FontSlant->"Italic"], StyleBox["\[Del]", FontWeight->"Bold"], "\[Times]", StyleBox["\[Del]", FontWeight->"Bold"], StyleBox["f = ", FontSlant->"Italic"], StyleBox["0 ", FontWeight->"Bold", FontSlant->"Italic"], StyleBox["+ ", FontSlant->"Italic"], StyleBox["0 ", FontWeight->"Bold", FontSlant->"Italic"], StyleBox[".", FontSlant->"Italic"] }], "Text"] }, Closed]] }, Open ]] }, FrontEndVersion->"5.2 for X", ScreenRectangle->{{0, 1280}, {0, 1024}}, WindowSize->{817, 941}, WindowMargins->{{1, Automatic}, {Automatic, 1}}, ShowSelection->True, Magnification->1, StyleDefinitions -> "Classroom.nb" ] (******************************************************************* Cached data follows. If you edit this Notebook file directly, not using Mathematica, you must remove the line containing CacheID at the top of the file. The cache data will then be recreated when you save this file from within Mathematica. *******************************************************************) (*CellTagsOutline CellTagsIndex->{} *) (*CellTagsIndex CellTagsIndex->{} *) (*NotebookFileOutline Notebook[{ Cell[1754, 51, 122, 4, 70, "Title"], Cell[1879, 57, 53, 0, 41, "Subtitle"], Cell[1935, 59, 91, 3, 39, "Author"], Cell[CellGroupData[{ Cell[2051, 66, 59, 0, 64, "Section"], Cell[2113, 68, 63, 0, 28, "Text"], Cell[2179, 70, 50, 1, 49, "Input"], Cell[2232, 73, 59, 1, 51, "Input"], Cell[2294, 76, 48, 1, 49, "Input"], Cell[2345, 79, 103, 3, 28, "Text"], Cell[2451, 84, 169, 3, 63, "Input"], Cell[2623, 89, 87, 3, 28, "Text"], Cell[2713, 94, 47, 1, 47, "Input"], Cell[2763, 97, 209, 4, 46, "Text"], Cell[2975, 103, 58, 1, 47, "Input"], Cell[3036, 106, 197, 6, 32, "Text"], Cell[3236, 114, 69, 1, 64, "Input"], Cell[3308, 117, 182, 4, 28, "Text"], Cell[3493, 123, 74, 1, 64, "Input"], Cell[3570, 126, 107, 3, 28, "Text"], Cell[3680, 131, 49, 1, 47, "Input"], Cell[3732, 134, 168, 4, 28, "Text"], Cell[3903, 140, 48, 1, 47, "Input"], Cell[3954, 143, 95, 3, 28, "Text"], Cell[4052, 148, 46, 1, 47, "Input"], Cell[4101, 151, 47, 1, 47, "Input"], Cell[4151, 154, 97, 3, 28, "Text"], Cell[4251, 159, 59, 1, 47, "Input"], Cell[4313, 162, 47, 1, 47, "Input"], Cell[4363, 165, 56, 0, 28, "Text"], Cell[4422, 167, 49, 1, 47, "Input"], Cell[4474, 170, 65, 0, 28, "Text"], Cell[4542, 172, 53, 1, 47, "Input"], Cell[4598, 175, 100, 3, 28, "Text"], Cell[4701, 180, 56, 1, 47, "Input"], Cell[4760, 183, 189, 4, 28, "Text"], Cell[4952, 189, 61, 1, 47, "Input"], Cell[5016, 192, 36, 0, 28, "Text"], Cell[5055, 194, 49, 1, 47, "Input"], Cell[5107, 197, 70, 0, 28, "Text"], Cell[5180, 199, 50, 1, 47, "Input"], Cell[5233, 202, 34, 0, 28, "Text"], Cell[5270, 204, 39, 1, 47, "Input"] }, Closed]], Cell[CellGroupData[{ Cell[5346, 210, 35, 0, 44, "Section"], Cell[5384, 212, 175, 5, 28, "Text"], Cell[5562, 219, 55, 1, 47, "Input"], Cell[5620, 222, 160, 4, 28, "Text"], Cell[5783, 228, 51, 1, 47, "Input"], Cell[5837, 231, 441, 10, 64, "Text"], Cell[6281, 243, 53, 1, 47, "Input"], Cell[6337, 246, 326, 10, 46, "Text"], Cell[6666, 258, 50, 1, 47, "Input"], Cell[6719, 261, 217, 5, 28, "Text"], Cell[6939, 268, 70, 1, 47, "Input"], Cell[7012, 271, 679, 23, 64, "Text"], Cell[7694, 296, 60, 1, 51, "Input"], Cell[7757, 299, 231, 6, 28, "Text"], Cell[7991, 307, 73, 1, 51, "Input"], Cell[8067, 310, 129, 5, 28, "Text"], Cell[8199, 317, 62, 1, 51, "Input"], Cell[8264, 320, 70, 0, 28, "Text"], Cell[8337, 322, 68, 1, 51, "Input"] }, Closed]], Cell[CellGroupData[{ Cell[8442, 328, 44, 0, 44, "Section"], Cell[8489, 330, 131, 3, 28, "Text"], Cell[8623, 335, 68, 1, 51, "Input"], Cell[8694, 338, 168, 6, 29, "Text"], Cell[8865, 346, 37, 1, 47, "Input"], Cell[8905, 349, 42, 1, 47, "Input"], Cell[8950, 352, 264, 10, 28, "Text"], Cell[9217, 364, 57, 1, 47, "Input"], Cell[9277, 367, 64, 1, 47, "Input"], Cell[9344, 370, 171, 8, 28, "Text"], Cell[9518, 380, 39, 1, 47, "Input"], Cell[9560, 383, 41, 1, 47, "Input"], Cell[9604, 386, 76, 0, 28, "Text"], Cell[9683, 388, 51, 1, 64, "Input"], Cell[9737, 391, 52, 0, 28, "Text"], Cell[9792, 393, 39, 1, 47, "Input"], Cell[9834, 396, 221, 8, 28, "Text"], Cell[10058, 406, 39, 1, 47, "Input"], Cell[10100, 409, 96, 3, 28, "Text"], Cell[10199, 414, 57, 1, 47, "Input"], Cell[10259, 417, 41, 1, 47, "Input"], Cell[10303, 420, 70, 1, 64, "Input"], Cell[10376, 423, 54, 1, 47, "Input"], Cell[10433, 426, 39, 1, 47, "Input"], Cell[10475, 429, 80, 1, 47, "Input"], Cell[10558, 432, 142, 2, 47, "Input"], Cell[10703, 436, 41, 1, 47, "Input"], Cell[10747, 439, 178, 4, 28, "Text"], Cell[10928, 445, 59, 1, 47, "Input"], Cell[10990, 448, 146, 3, 28, "Text"], Cell[11139, 453, 40, 1, 47, "Input"], Cell[11182, 456, 43, 1, 64, "Input"], Cell[11228, 459, 42, 1, 47, "Input"], Cell[11273, 462, 59, 1, 47, "Input"], Cell[11335, 465, 40, 1, 47, "Input"], Cell[11378, 468, 53, 0, 28, "Text"], Cell[11434, 470, 37, 1, 47, "Input"], Cell[11474, 473, 35, 0, 28, "Text"], Cell[11512, 475, 39, 1, 47, "Input"], Cell[11554, 478, 41, 1, 47, "Input"] }, Closed]], Cell[CellGroupData[{ Cell[11632, 484, 38, 0, 44, "Section"], Cell[11673, 486, 239, 5, 46, "Text"], Cell[11915, 493, 141, 2, 51, "Input"], Cell[12059, 497, 56, 0, 28, "Text"], Cell[12118, 499, 156, 3, 51, "Input"], Cell[12277, 504, 64, 1, 47, "Input"], Cell[12344, 507, 100, 3, 28, "Text"], Cell[12447, 512, 249, 6, 85, "Input"], Cell[12699, 520, 64, 1, 47, "Input"], Cell[12766, 523, 40, 0, 28, "Text"], Cell[12809, 525, 123, 3, 51, "Input"], Cell[12935, 530, 64, 1, 47, "Input"], Cell[13002, 533, 25, 0, 28, "Text"], Cell[13030, 535, 47, 1, 47, "Input"] }, Closed]], Cell[CellGroupData[{ Cell[13114, 541, 45, 0, 44, "Section"], Cell[13162, 543, 160, 4, 28, "Text"], Cell[13325, 549, 52, 1, 49, "Input"], Cell[13380, 552, 208, 7, 28, "Text"], Cell[13591, 561, 74, 1, 51, "Input"], Cell[13668, 564, 101, 3, 28, "Text"], Cell[13772, 569, 75, 1, 51, "Input"], Cell[13850, 572, 169, 5, 28, "Text"], Cell[14022, 579, 79, 1, 51, "Input"], Cell[14104, 582, 113, 3, 28, "Text"], Cell[14220, 587, 66, 1, 49, "Input"], Cell[14289, 590, 60, 0, 28, "Text"], Cell[14352, 592, 75, 1, 51, "Input"], Cell[14430, 595, 96, 3, 28, "Text"], Cell[14529, 600, 110, 2, 51, "Input"], Cell[14642, 604, 247, 9, 28, "Text"], Cell[14892, 615, 58, 1, 51, "Input"], Cell[14953, 618, 44, 0, 28, "Text"], Cell[15000, 620, 76, 1, 47, "Input"], Cell[15079, 623, 42, 0, 28, "Text"], Cell[15124, 625, 319, 8, 46, "Text"], Cell[15446, 635, 111, 2, 51, "Input"] }, Closed]], Cell[CellGroupData[{ Cell[15594, 642, 42, 0, 44, "Section"], Cell[15639, 644, 193, 4, 46, "Text"], Cell[15835, 650, 50, 1, 47, "Input"], Cell[15888, 653, 40, 1, 47, "Input"], Cell[15931, 656, 40, 1, 47, "Input"], Cell[15974, 659, 108, 5, 28, "Text"], Cell[16085, 666, 37, 1, 47, "Input"], Cell[16125, 669, 129, 5, 28, "Text"], Cell[16257, 676, 41, 1, 47, "Input"], Cell[16301, 679, 54, 1, 47, "Input"], Cell[16358, 682, 40, 1, 47, "Input"], Cell[16401, 685, 37, 1, 47, "Input"], Cell[16441, 688, 291, 5, 46, "Text"], Cell[16735, 695, 41, 1, 47, "Input"], Cell[16779, 698, 105, 2, 51, "Input"], Cell[16887, 702, 76, 1, 51, "Input"], Cell[16966, 705, 338, 5, 87, "Input"] }, Closed]], Cell[CellGroupData[{ Cell[17341, 715, 57, 0, 44, "Section"], Cell[17401, 717, 135, 5, 28, "Text"], Cell[17539, 724, 40, 1, 47, "Input"], Cell[17582, 727, 114, 3, 28, "Text"], Cell[17699, 732, 48, 1, 47, "Input"], Cell[17750, 735, 63, 1, 47, "Input"], Cell[17816, 738, 39, 1, 47, "Input"], Cell[17858, 741, 41, 1, 47, "Input"], Cell[17902, 744, 518, 10, 64, "Text"], Cell[18423, 756, 43, 1, 47, "Input"], Cell[18469, 759, 48, 1, 47, "Input"], Cell[18520, 762, 76, 1, 47, "Input"], Cell[18599, 765, 39, 1, 47, "Input"], Cell[18641, 768, 119, 5, 28, "Text"], Cell[18763, 775, 41, 1, 47, "Input"], Cell[18807, 778, 157, 3, 28, "Text"], Cell[18967, 783, 40, 1, 47, "Input"], Cell[19010, 786, 41, 1, 47, "Input"], Cell[19054, 789, 43, 1, 47, "Input"] }, Closed]], Cell[CellGroupData[{ Cell[19134, 795, 26, 0, 44, "Section"], Cell[19163, 797, 87, 3, 28, "Text"], Cell[19253, 802, 60, 1, 47, "Input"], Cell[19316, 805, 45, 0, 28, "Text"], Cell[19364, 807, 67, 1, 47, "Input"], Cell[19434, 810, 22, 0, 28, "Text"], Cell[19459, 812, 66, 1, 47, "Input"], Cell[19528, 815, 38, 0, 28, "Text"], Cell[19569, 817, 71, 1, 49, "Input"], Cell[19643, 820, 41, 0, 28, "Text"], Cell[19687, 822, 57, 1, 47, "Input"], Cell[19747, 825, 92, 3, 28, "Text"], Cell[19842, 830, 44, 1, 47, "Input"], Cell[19889, 833, 41, 0, 28, "Text"], Cell[19933, 835, 51, 1, 47, "Input"], Cell[19987, 838, 34, 0, 28, "Text"], Cell[20024, 840, 42, 1, 47, "Input"], Cell[20069, 843, 18, 0, 28, "Text"], Cell[20090, 845, 53, 1, 47, "Input"], Cell[20146, 848, 36, 0, 28, "Text"], Cell[20185, 850, 51, 1, 47, "Input"], Cell[20239, 853, 27, 0, 28, "Text"], Cell[20269, 855, 43, 1, 47, "Input"], Cell[20315, 858, 46, 1, 47, "Input"], Cell[20364, 861, 116, 3, 28, "Text"], Cell[20483, 866, 3105, 69, 175, "Text"] }, Closed]], Cell[CellGroupData[{ Cell[23625, 940, 33, 0, 46, "ExerciseMain"], Cell[23661, 942, 214, 8, 35, "Text"], Cell[CellGroupData[{ Cell[23900, 954, 39, 0, 48, "Exercise"], Cell[23942, 956, 654, 20, 64, "Text"] }, Open ]], Cell[CellGroupData[{ Cell[24633, 981, 33, 0, 48, "Subsubsection"], Cell[24669, 983, 41, 1, 47, "Input"], Cell[24713, 986, 106, 2, 47, "Input"], Cell[24822, 990, 62, 1, 47, "Input"], Cell[24887, 993, 32, 0, 28, "Text"], Cell[24922, 995, 62, 1, 47, "Input"], Cell[24987, 998, 49, 1, 47, "Input"], Cell[25039, 1001, 41, 1, 47, "Input"] }, Closed]], Cell[CellGroupData[{ Cell[25117, 1007, 48, 0, 34, "Exercise"], Cell[25168, 1009, 557, 18, 50, "Text"] }, Open ]], Cell[CellGroupData[{ Cell[25762, 1032, 33, 0, 48, "Subsubsection"], Cell[25798, 1034, 71, 1, 47, "Input"], Cell[25872, 1037, 74, 1, 47, "Input"], Cell[25949, 1040, 69, 1, 64, "Input"], Cell[26021, 1043, 80, 1, 47, "Input"], Cell[26104, 1046, 90, 1, 47, "Input"] }, Closed]], Cell[CellGroupData[{ Cell[26231, 1052, 50, 0, 34, "Exercise"], Cell[26284, 1054, 487, 14, 46, "Text"] }, Open ]], Cell[CellGroupData[{ Cell[26808, 1073, 33, 0, 48, "Subsubsection"], Cell[26844, 1075, 76, 1, 47, "Input"], Cell[26923, 1078, 62, 1, 47, "Input"], Cell[26988, 1081, 71, 1, 47, "Input"], Cell[27062, 1084, 57, 1, 47, "Input"], Cell[27122, 1087, 178, 4, 46, "Text"], Cell[27303, 1093, 41, 1, 47, "Input"] }, Closed]], Cell[CellGroupData[{ Cell[27381, 1099, 73, 0, 34, "Exercise"], Cell[27457, 1101, 443, 15, 51, "Text"] }, Open ]], Cell[CellGroupData[{ Cell[27937, 1121, 33, 0, 48, "Subsubsection"], Cell[27973, 1123, 52, 1, 47, "Input"], Cell[28028, 1126, 46, 1, 47, "Input"], Cell[28077, 1129, 43, 1, 47, "Input"], Cell[28123, 1132, 59, 1, 47, "Input"], Cell[28185, 1135, 41, 1, 47, "Input"] }, Closed]], Cell[CellGroupData[{ Cell[28263, 1141, 29, 0, 34, "Exercise"], Cell[28295, 1143, 359, 8, 46, "Text"] }, Open ]], Cell[CellGroupData[{ Cell[28691, 1156, 33, 0, 48, "Subsubsection"], Cell[28727, 1158, 43, 1, 47, "Input"], Cell[28773, 1161, 61, 1, 47, "Input"], Cell[28837, 1164, 87, 1, 47, "Input"], Cell[28927, 1167, 40, 1, 47, "Input"], Cell[28970, 1170, 40, 1, 47, "Input"], Cell[29013, 1173, 46, 1, 47, "Input"], Cell[29062, 1176, 41, 1, 47, "Input"], Cell[29106, 1179, 43, 1, 47, "Input"] }, Closed]], Cell[CellGroupData[{ Cell[29186, 1185, 27, 0, 34, "Exercise"], Cell[29216, 1187, 932, 29, 64, "Text"] }, Open ]], Cell[CellGroupData[{ Cell[30185, 1221, 33, 0, 48, "Subsubsection"], Cell[30221, 1223, 79, 1, 47, "Input"], Cell[30303, 1226, 22, 0, 28, "Text"], Cell[30328, 1228, 66, 1, 47, "Input"], Cell[30397, 1231, 84, 1, 47, "Input"], Cell[30484, 1234, 65, 1, 47, "Input"], Cell[30552, 1237, 65, 1, 47, "Input"], Cell[30620, 1240, 126, 2, 49, "Input"], Cell[30749, 1244, 73, 1, 47, "Input"], Cell[30825, 1247, 78, 1, 47, "Input"], Cell[30906, 1250, 109, 2, 47, "Input"], Cell[31018, 1254, 842, 40, 28, "Text"] }, Closed]] }, Open ]] } ] *) (******************************************************************* End of Mathematica Notebook file. *******************************************************************)