(* Content-type: application/mathematica *) (*** Wolfram Notebook File ***) (* http://www.wolfram.com/nb *) (* CreatedBy='Mathematica 7.0' *) (*CacheID: 234*) (* Internal cache information: NotebookFileLineBreakTest NotebookFileLineBreakTest NotebookDataPosition[ 145, 7] NotebookDataLength[ 130864, 4377] NotebookOptionsPosition[ 116361, 3906] NotebookOutlinePosition[ 119313, 4027] CellTagsIndexPosition[ 118748, 4001] WindowFrame->Normal*) (* Beginning of Notebook Content *) Notebook[{ Cell[CellGroupData[{ Cell[TextData[StyleBox["Modeling Change: Springs, Driving Safety, \ Radioactivity, Trees, Fish, and Mammals", FontSize->48]], "Title", PageWidth->PaperWidth, CellChangeTimes->{{3.449076153578125*^9, 3.449076154953125*^9}}], Cell[BoxData[ RowBox[{ RowBox[{"Off", "[", RowBox[{"General", "::", "spell1"}], "]"}], ";"}]], "Input", PageWidth->PaperWidth, CellOpen->False, InitializationCell->True], Cell[CellGroupData[{ Cell["Introduction", "Section", PageWidth->PaperWidth], Cell["\<\ OBJECTIVE: Practice a modeling process: consider a behavior, observe data, \ fit a model, analyze the error, improve the model if appropriate, interpret \ the model, and make predictions.\ \>", "Text", PageWidth->PaperWidth], Cell[TextData[{ "Mathematical models help us better understand things in the world around \ us, like the behavior of springs, safe driving practices, radioactivity in \ medicine, the growth of trees and fish, and the biology of mammals. In this \ module you will learn how to construct mathematical models, how to analyze \ and improve them, how to use them to study the behavior you are modeling, and \ to make predictions. As you will see, a computer algebra system like ", StyleBox["Mathematica", FontSlant->"Italic"], " is a powerful tool that will aid you in your mathematical modeling." }], "Text", PageWidth->PaperWidth], Cell[CellGroupData[{ Cell["Technology Guidelines", "Subsection", PageWidth->PaperWidth, CellDingbat->"\[LightBulb]"], Cell[TextData[{ StyleBox["NOTE: ", CellFrame->True, Background->None], StyleBox["If you have just finished a module, restart ", CellFrame->True, FontSize->18, Background->None], StyleBox["Mathematica", CellFrame->True, FontSize->18, FontSlant->"Italic", Background->None], StyleBox[" or ", CellFrame->True, FontSize->18, Background->None], StyleBox["Quit Kernel", CellFrame->True, FontSize->18, FontSlant->"Italic", Background->None], StyleBox[" under the ", CellFrame->True, FontSize->18, Background->None], StyleBox["Evaluation ", CellFrame->True, FontSize->18, FontSlant->"Italic", Background->None], StyleBox["pull-down menu before executing a new module.", CellFrame->True, FontSize->18, Background->None], StyleBox["\nTO OPEN CELLS, ", CellFrame->True, Background->None], StyleBox["click on the arrow to the left of the cell or put your cursor on \ the right cell bracket and double click. To open ", CellFrame->True, FontSize->18, Background->None], StyleBox["all", CellFrame->True, FontSize->18, FontWeight->"Bold", Background->None], StyleBox[" ", CellFrame->True, FontSize->18, Background->None], StyleBox["cells", CellFrame->True, FontSize->18, FontWeight->"Bold", Background->None], StyleBox[", highlight the bracket on the far right and select ", CellFrame->True, FontSize->18, Background->None], StyleBox["Grouping", CellFrame->True, FontSize->18, FontSlant->"Italic", Background->None], StyleBox[" under the ", CellFrame->True, FontSize->18, Background->None], StyleBox["Cell", CellFrame->True, FontSize->18, FontSlant->"Italic", Background->None], StyleBox[" pull-down menu and select ", CellFrame->True, FontSize->18, Background->None], StyleBox["Open All Subgroups.", CellFrame->True, FontSize->18, FontSlant->"Italic", Background->None], "\nTO STOP AN EXECUTION\n", StyleBox["Select the ", FontSize->18], StyleBox["Evaluation", FontSize->18, FontSlant->"Italic"], StyleBox[" pull-down menu and click on ", FontSize->18], StyleBox["Abort Evaluation.", FontSize->18, FontSlant->"Italic"], StyleBox["\n", FontSlant->"Italic"], "ORDER OF EXECUTION\n", StyleBox["Execute cells in the order given. Do not skip any Input cells \ within a given notebook.", FontSize->18], "\nSAVING NOTEBOOKS\n", StyleBox["You can save anytime to any directory you choose, and it is wise \ to save often. However, before you do your final save to reduce the size of \ your file, it is a good idea to delete all your output by selecting the ", FontSize->18], StyleBox["Delete All Output", FontSize->18, FontSlant->"Italic"], StyleBox[" selection under the ", FontSize->18], StyleBox["Cell", FontSize->18, FontSlant->"Italic"], StyleBox[" pull-down menu.", FontSize->18], "\nEXPERIENCING MAJOR PROBLEMS\n", StyleBox["Save if appropriate, then shut down ", FontSize->18], StyleBox["Mathematica", FontSize->18, FontSlant->"Italic"], StyleBox[" and start it up again.", FontSize->18] }], "Text", PageWidth->PaperWidth, CellChangeTimes->{{3.445688545171875*^9, 3.445688642453125*^9}, { 3.445688796484375*^9, 3.44568884978125*^9}, 3.445688894875*^9, { 3.445688958265625*^9, 3.445689118078125*^9}, {3.44568916803125*^9, 3.44568917609375*^9}, {3.44587469140625*^9, 3.4458747175625*^9}}] }, Closed]] }, Closed]], Cell[CellGroupData[{ Cell["Part I: Vehicular Stopping Distance", "Section", PageWidth->PaperWidth], Cell[CellGroupData[{ Cell["Observing the Data", "Subsection", PageWidth->PaperWidth], Cell["\<\ A rule of thumb that is often given for safe following distance is to allow 2 \ seconds between your car and the car in front of you. Is this rule reasonable? The following data set contains ordered pairs of values. The first element of \ each ordered pair is the traveling speed, and the second element is the total \ stopping distance, the distance traveled by the car during the driver's \ reaction time plus the distance required for the vehicle to come to a stop \ with full braking.\ \>", "Text", PageWidth->PaperWidth], Cell[BoxData[ RowBox[{"data", "=", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"20", ",", "42"}], "}"}], ",", RowBox[{"{", RowBox[{"25", ",", "56"}], "}"}], ",", RowBox[{"{", RowBox[{"30", ",", "73.5"}], "}"}], ",", RowBox[{"{", RowBox[{"35", ",", "91.5"}], "}"}], ",", RowBox[{"{", RowBox[{"40", ",", "116"}], "}"}], ",", RowBox[{"{", RowBox[{"45", ",", "142.5"}], "}"}], ",", RowBox[{"{", RowBox[{"50", ",", "173"}], "}"}], ",", RowBox[{"{", RowBox[{"55", ",", "209.5"}], "}"}], ",", RowBox[{"{", RowBox[{"60", ",", "248"}], "}"}], ",", RowBox[{"{", RowBox[{"65", ",", "292.5"}], "}"}], ",", RowBox[{"{", RowBox[{"70", ",", "343"}], "}"}], ",", RowBox[{"{", RowBox[{"75", ",", "401"}], "}"}], ",", RowBox[{"{", RowBox[{"80", ",", "464"}], "}"}]}], "}"}]}]], "Input", PageWidth->PaperWidth], Cell[BoxData[ RowBox[{"TableForm", "[", RowBox[{"data", ",", RowBox[{"TableDirections", "\[Rule]", RowBox[{"{", RowBox[{"Row", ",", "Column"}], "}"}]}], ",", RowBox[{"TableHeadings", "\[Rule]", RowBox[{"{", RowBox[{"None", ",", RowBox[{"{", RowBox[{"\"\\"", ",", "\"\\""}], "}"}]}], "}"}]}]}], "]"}]], "Input", PageWidth->PaperWidth], Cell["We plot the data to see if there is a recognizable pattern.", "Text", PageWidth->PaperWidth], Cell[BoxData[{ RowBox[{ RowBox[{"xlabel", "=", "\"\\""}], ";"}], "\n", RowBox[{ RowBox[{"ylabel", "=", "\"\\""}], ";"}], "\n", RowBox[{"p1", "=", RowBox[{"ListPlot", "[", RowBox[{"data", ",", RowBox[{"PlotRange", "\[Rule]", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"10", ",", "80"}], "}"}], ",", "Automatic"}], "}"}]}], ",", RowBox[{"PlotStyle", "\[Rule]", RowBox[{"{", RowBox[{ RowBox[{"PointSize", "[", "0.02`", "]"}], ",", RowBox[{"RGBColor", "[", RowBox[{"1", ",", "0", ",", "0"}], "]"}]}], "}"}]}], ",", RowBox[{"AxesLabel", "\[Rule]", RowBox[{"{", RowBox[{"xlabel", ",", "ylabel"}], "}"}]}], ",", RowBox[{"Ticks", "\[Rule]", RowBox[{"{", RowBox[{ RowBox[{"Table", "[", RowBox[{ RowBox[{"15", "+", RowBox[{"i", " ", "10"}]}], ",", RowBox[{"{", RowBox[{"i", ",", "0", ",", "27"}], "}"}]}], "]"}], ",", "Automatic"}], "}"}]}]}], "]"}]}]}], "Input", PageWidth->PaperWidth] }, Closed]], Cell[CellGroupData[{ Cell["Designing a Model", "Subsection", PageWidth->PaperWidth], Cell[TextData[{ "The data suggest a possible quadratic relationship. Now we use the ", StyleBox["Fit[ ]", FontWeight->"Bold"], " function to find the curve of best-fit or the regression curve." }], "Text", PageWidth->PaperWidth], Cell[BoxData[{ RowBox[{ RowBox[{"Clear", "[", "y", "]"}], ";"}], "\n", RowBox[{ RowBox[{"y", "[", "x_", "]"}], "=", RowBox[{"Fit", "[", RowBox[{"data", ",", RowBox[{"{", RowBox[{"1", ",", "x", ",", RowBox[{"x", "^", "2"}]}], "}"}], ",", "x"}], "]"}]}]}], "Input", PageWidth->PaperWidth], Cell["\<\ Next, we plot the regression curve and then show the plot of the data and the \ model together on the same graph.\ \>", "Text", PageWidth->PaperWidth], Cell[BoxData[ RowBox[{"p2", "=", RowBox[{"Plot", "[", RowBox[{ RowBox[{"y", "[", "x", "]"}], ",", RowBox[{"{", RowBox[{"x", ",", "0", ",", "85"}], "}"}], ",", RowBox[{"PlotStyle", "\[Rule]", RowBox[{"{", RowBox[{"RGBColor", "[", RowBox[{"0", ",", "0", ",", "1"}], "]"}], "}"}]}], ",", RowBox[{"AxesLabel", "\[Rule]", RowBox[{"{", RowBox[{"xlabel", ",", "ylabel"}], "}"}]}], ",", RowBox[{"Ticks", "\[Rule]", RowBox[{"{", RowBox[{ RowBox[{"Table", "[", RowBox[{ RowBox[{"0", "+", RowBox[{"i", " ", "10"}]}], ",", RowBox[{"{", RowBox[{"i", ",", "0", ",", "27"}], "}"}]}], "]"}], ",", "Automatic"}], "}"}]}]}], "]"}]}]], "Input", PageWidth->PaperWidth], Cell[BoxData[ RowBox[{"Show", "[", RowBox[{"p2", ",", "p1"}], "]"}]], "Input", PageWidth->PaperWidth], Cell["\<\ The best-fit quadratic function appears to fit the data very well. \ \>", "Text", PageWidth->PaperWidth] }, Closed]], Cell[CellGroupData[{ Cell["Assessing the Errors", "Subsection", PageWidth->PaperWidth], Cell["\<\ We can provide further verification by calculating the residual errors for \ each data point and plotting them. First, we calculate the stopping distances \ predicted by the model.\ \>", "Text", PageWidth->PaperWidth], Cell[BoxData[ RowBox[{"predictedvalues", "=", RowBox[{"Table", "[", RowBox[{ RowBox[{"{", RowBox[{"x", ",", RowBox[{"y", "[", "x", "]"}]}], "}"}], ",", RowBox[{"{", RowBox[{"x", ",", "20", ",", "80", ",", "5"}], "}"}]}], "]"}]}]], "Input", PageWidth->PaperWidth], Cell[BoxData[ RowBox[{"residuals", "=", RowBox[{"Table", "[", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"data", "[", RowBox[{"[", RowBox[{"i", ",", "1"}], "]"}], "]"}], ",", RowBox[{ RowBox[{"data", "[", RowBox[{"[", RowBox[{"i", ",", "2"}], "]"}], "]"}], "-", RowBox[{"predictedvalues", "[", RowBox[{"[", RowBox[{"i", ",", "2"}], "]"}], "]"}]}]}], "}"}], ",", RowBox[{"{", RowBox[{"i", ",", "1", ",", "13"}], "}"}]}], "]"}]}]], "Input", PageWidth->PaperWidth, CellChangeTimes->{{3.449076465515625*^9, 3.449076490875*^9}}], Cell[BoxData[ RowBox[{"ListPlot", "[", RowBox[{"residuals", ",", RowBox[{"PlotStyle", "\[Rule]", RowBox[{"{", RowBox[{ RowBox[{"PointSize", "[", "0.023`", "]"}], ",", RowBox[{"RGBColor", "[", RowBox[{"0", ",", "0", ",", "1"}], "]"}]}], "}"}]}], ",", RowBox[{"AxesLabel", "\[Rule]", RowBox[{"{", RowBox[{"\"\\"", ",", "\"\\""}], "}"}]}]}], "]"}]], "Input", PageWidth->PaperWidth], Cell["\<\ You should notice that these errors have a pattern, with the model \ underestimating the data points from 30 to 50 seconds and then overestimating \ the data points from55 to 70. This shows that the model is not appropriate. Before proceding, we will look at the error in relation to the size of the \ quantity being estimated. For all but the first data point, we can calculate \ the relative error as follows.\ \>", "Text", PageWidth->PaperWidth, CellChangeTimes->{{3.4490772346875*^9, 3.449077407515625*^9}}], Cell[BoxData[ RowBox[{"percenterrors", "=", RowBox[{"Table", "[", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"data", "[", RowBox[{"[", RowBox[{"i", ",", "1"}], "]"}], "]"}], ",", RowBox[{ RowBox[{ RowBox[{"(", RowBox[{ RowBox[{"data", "[", RowBox[{"[", RowBox[{"i", ",", "2"}], "]"}], "]"}], "-", RowBox[{"predictedvalues", "[", RowBox[{"[", RowBox[{"i", ",", "2"}], "]"}], "]"}]}], ")"}], "/", RowBox[{"data", "[", RowBox[{"[", RowBox[{"i", ",", "2"}], "]"}], "]"}]}], "*", "100"}]}], "}"}], ",", RowBox[{"{", RowBox[{"i", ",", "2", ",", "13"}], "}"}]}], "]"}]}]], "Input", PageWidth->PaperWidth, CellChangeTimes->{ 3.449076637828125*^9, {3.4490768484375*^9, 3.44907685384375*^9}}], Cell[BoxData[ RowBox[{"ListPlot", "[", RowBox[{"percenterrors", ",", RowBox[{"PlotStyle", "\[Rule]", RowBox[{"{", RowBox[{ RowBox[{"PointSize", "[", "0.021`", "]"}], ",", RowBox[{"RGBColor", "[", RowBox[{"0", ",", "0", ",", "1"}], "]"}]}], "}"}]}], ",", RowBox[{"PlotRange", "\[Rule]", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"0", ",", "80"}], "}"}], ",", "All"}], "}"}]}], ",", RowBox[{"AxesLabel", "\[Rule]", RowBox[{"{", RowBox[{"\"\\"", ",", "\"\<% error\>\""}], "}"}]}]}], "]"}]], "Input", PageWidth->PaperWidth], Cell["The maximum relative error of this model is close to 4%.", "Text", PageWidth->PaperWidth, CellChangeTimes->{{3.44907691828125*^9, 3.449076921078125*^9}}] }, Closed]], Cell[CellGroupData[{ Cell["Improving the Model", "Subsection", PageWidth->PaperWidth], Cell[TextData[{ "As indicated at the beginning of this module, a rule of thumb that is often \ given for safe following distance is to allow 2 seconds between your car and \ the car in front of you. To use this rule, you would note when the car in \ front of you passes some marker on or near the roadway, and then you count \ the time it takes you to get to the marker. This time should be at least 2 \ seconds. The rationale behind this rule is that if the car in front of you \ were suddenly to come to a complete stop, the 2-second separation distance \ would give you enough time to stop, to avoid hitting the vehicle in front of \ you. To test the 2-second rule of thumb, we will calculate how far your car \ travels in 2 seconds at various speeds and then compare these distances with \ the corresponding stopping distances in our data set. \n\nThe first entry in \ each element of the following table is the traveling speed in miles per hour, \ the second entry is the 2-second distance between the two cars in feet, and \ the third entry is the stopping distance in feet, taken from the test data. \ (To calculate the distance traveled in 2 seconds, we convert the traveling \ speeds from mph to ft/sec by using the conversion, 60 mph ", Cell[BoxData[ FormBox["=", TraditionalForm]]], " 88 ft/sec.)" }], "Text", PageWidth->PaperWidth], Cell[BoxData[ RowBox[{"data2", "=", RowBox[{"Table", "[", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"data", "[", RowBox[{"[", RowBox[{"i", ",", "1"}], "]"}], "]"}], ",", RowBox[{ RowBox[{"(", RowBox[{ RowBox[{"data", "[", RowBox[{"[", RowBox[{"i", ",", "1"}], "]"}], "]"}], "*", RowBox[{"88.", "/", "60."}]}], ")"}], "*", "2"}], ",", RowBox[{"data", "[", RowBox[{"[", RowBox[{"i", ",", "2"}], "]"}], "]"}]}], "}"}], ",", RowBox[{"{", RowBox[{"i", ",", "1", ",", "13"}], "}"}]}], "]"}]}]], "Input", PageWidth->PaperWidth], Cell[BoxData[ RowBox[{"TableForm", "[", RowBox[{"data2", ",", RowBox[{"TableHeadings", "\[Rule]", RowBox[{"{", RowBox[{"None", ",", RowBox[{"{", RowBox[{ "\"\\"", ",", "\"\<2-sec separation dist(ft)\>\"", ",", "\"\\""}], "}"}]}], "}"}]}]}], "]"}]], "Input", PageWidth->PaperWidth], Cell["\<\ The data in the table show that for speeds greater than 20 mph, the stopping \ distance exceeds the 2-second separation distance. Let's find an improved model to provide the basis for a better rule of thumb. \ To do this, we will look at the problem the other way around. We know the \ stopping distance for various speeds. If we force the stopping distance and \ the separation distance to be equal, then we can calculate separation time \ for each speed. We do this by taking the stopping distance (in feet) and \ dividing it by the travel speed (in ft/sec). In the following table, the \ first entry in each element is the traveling speed in miles per hour, and the \ second entry is the separation time in seconds that is required to ensure a \ separation distance equal to the stopping distance.\ \>", "Text", PageWidth->PaperWidth], Cell[BoxData[ RowBox[{"data3", "=", RowBox[{"Table", "[", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"data", "[", RowBox[{"[", RowBox[{"i", ",", "1"}], "]"}], "]"}], ",", RowBox[{ RowBox[{"data", "[", RowBox[{"[", RowBox[{"i", ",", "2"}], "]"}], "]"}], "/", RowBox[{"(", RowBox[{ RowBox[{"data", "[", RowBox[{"[", RowBox[{"i", ",", "1"}], "]"}], "]"}], "*", RowBox[{"88.", "/", "60."}]}], ")"}]}]}], "}"}], ",", RowBox[{"{", RowBox[{"i", ",", "1", ",", RowBox[{"Length", "[", "data", "]"}]}], "}"}]}], "]"}]}]], "Input", PageWidth->PaperWidth], Cell[BoxData[ RowBox[{"TableForm", "[", RowBox[{"data3", ",", RowBox[{"TableHeadings", "\[Rule]", RowBox[{"{", RowBox[{"None", ",", RowBox[{"{", RowBox[{ "\"\\"", ",", " ", "\"\\""}], "}"}]}], "}"}]}]}], "]"}]], "Input", PageWidth->PaperWidth], Cell["Next, we plot the separation time versus speed.", "Text", PageWidth->PaperWidth], Cell[BoxData[{ RowBox[{ RowBox[{"xlabel", "=", "\"\\""}], ";"}], "\n", RowBox[{ RowBox[{"ylabel", "=", "\"\\""}], ";"}], "\n", RowBox[{"p1", "=", RowBox[{"ListPlot", "[", RowBox[{"data3", ",", RowBox[{"PlotRange", "\[Rule]", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"0", ",", "80"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "5"}], "}"}]}], "}"}]}], ",", RowBox[{"PlotStyle", "\[Rule]", RowBox[{"{", RowBox[{ RowBox[{"PointSize", "[", "0.022`", "]"}], ",", RowBox[{"RGBColor", "[", RowBox[{"1", ",", "0", ",", "0"}], "]"}]}], "}"}]}], ",", RowBox[{"AxesLabel", "\[Rule]", RowBox[{"{", RowBox[{"xlabel", ",", "ylabel"}], "}"}]}], ",", RowBox[{"Ticks", "\[Rule]", RowBox[{"{", RowBox[{ RowBox[{"Table", "[", RowBox[{ RowBox[{"0", "+", RowBox[{"i", " ", "10"}]}], ",", RowBox[{"{", RowBox[{"i", ",", "0", ",", "30"}], "}"}]}], "]"}], ",", "Automatic"}], "}"}]}]}], "]"}]}]}], "Input", PageWidth->PaperWidth], Cell["\<\ It appears that the separation time is a linear function of the travel speed \ and not a constant function as the 2-second rule suggests. Let's find the \ best-fit linear function for the separation-time versus speed data and plot \ it together with the data points.\ \>", "Text", PageWidth->PaperWidth], Cell[BoxData[{ RowBox[{ RowBox[{"Clear", "[", "t", "]"}], ";"}], "\n", RowBox[{ RowBox[{"t", "[", "v_", "]"}], "=", RowBox[{"Fit", "[", RowBox[{"data3", ",", RowBox[{"{", RowBox[{"1", ",", "v"}], "}"}], ",", "v"}], "]"}]}]}], "Input", PageWidth->PaperWidth], Cell[BoxData[ RowBox[{"p2", "=", RowBox[{"Plot", "[", RowBox[{ RowBox[{"t", "[", "v", "]"}], ",", RowBox[{"{", RowBox[{"v", ",", "0", ",", "85"}], "}"}], ",", RowBox[{"PlotStyle", "\[Rule]", RowBox[{"{", RowBox[{"RGBColor", "[", RowBox[{"0", ",", "0", ",", "1"}], "]"}], "}"}]}], ",", RowBox[{"AxesLabel", "\[Rule]", RowBox[{"{", RowBox[{"xlabel", ",", "ylabel"}], "}"}]}], ",", RowBox[{"Ticks", "\[Rule]", RowBox[{"{", RowBox[{ RowBox[{"Table", "[", RowBox[{ RowBox[{"0", "+", RowBox[{"i", " ", "10"}]}], ",", RowBox[{"{", RowBox[{"i", ",", "0", ",", "30"}], "}"}]}], "]"}], ",", "Automatic"}], "}"}]}]}], "]"}]}]], "Input", PageWidth->PaperWidth], Cell[BoxData[ RowBox[{"Show", "[", RowBox[{"p2", ",", "p1"}], "]"}]], "Input", PageWidth->PaperWidth] }, Closed]] }, Closed]], Cell[CellGroupData[{ Cell["You Try It: Make a Better Rule of Thumb", "Section", PageWidth->PaperWidth], Cell[CellGroupData[{ Cell["Using the Model", "Subsection", PageWidth->PaperWidth], Cell["\<\ Based upon the results of the analysis in Part I, formulate a better rule of \ thumb for separation time versus travel speed. Keep in mind that a rule of \ thumb should be easy to remember, easy to use, and, most importantly, it \ should be correct.\ \>", "Text", PageWidth->PaperWidth] }, Closed]] }, Closed]], Cell[CellGroupData[{ Cell["Part II: Stretching Springs and Effects of Radioactivity", "Section", PageWidth->PaperWidth], Cell[CellGroupData[{ Cell["Spring Elongation", "Subsection", PageWidth->PaperWidth], Cell[CellGroupData[{ Cell["Observing the Data", "Subsubsection", PageWidth->PaperWidth], Cell["\<\ The response of a spring to various loads can be modeled in order to design a \ vehicle such as a tank, utility vehicle, or luxury car that responds to road \ conditions in a desired way. (See also \"Bungee Cord Jumping: A Classroom \ Experiment,\" another module in this supplement.) We conducted an experiment \ to measure the stretch of a spring in inches as a function of the number of \ units of mass placed on the spring. The following list includes these data \ with the first element in each ordered pair being the mass on the spring and \ the second element its corresponding stretch.\ \>", "Text", PageWidth->PaperWidth], Cell[BoxData[ RowBox[{"data", "=", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"0", ",", "0"}], "}"}], ",", RowBox[{"{", RowBox[{"1", ",", "0.875"}], "}"}], ",", RowBox[{"{", RowBox[{"2", ",", "1.721"}], "}"}], ",", RowBox[{"{", RowBox[{"3", ",", "2.641"}], "}"}], ",", RowBox[{"{", RowBox[{"4", ",", "3.531"}], "}"}], ",", RowBox[{"{", RowBox[{"5", ",", "4.391"}], "}"}], ",", RowBox[{"{", RowBox[{"6", ",", "5.241"}], "}"}], ",", RowBox[{"{", RowBox[{"7", ",", "6.120"}], "}"}], ",", RowBox[{"{", RowBox[{"8", ",", "6.992"}], "}"}], ",", RowBox[{"{", RowBox[{"9", ",", "7.869"}], "}"}], ",", RowBox[{"{", RowBox[{"10", ",", "8.741"}], "}"}]}], "}"}]}]], "Input", PageWidth->PaperWidth], Cell[TextData[{ "A set of data values is usually entered in a list. However, to see the data \ better, we use ", StyleBox["TableForm[ ]", FontWeight->"Bold"], ", as follows." }], "Text", PageWidth->PaperWidth], Cell[BoxData[ RowBox[{"TableForm", "[", RowBox[{"data", ",", RowBox[{"TableDirections", "\[Rule]", RowBox[{"{", RowBox[{"Row", ",", "Column"}], "}"}]}], ",", RowBox[{"TableHeadings", "\[Rule]", RowBox[{"{", RowBox[{"None", ",", RowBox[{"{", RowBox[{"\"\\"", ",", "\"\\""}], "}"}]}], "}"}]}]}], "]"}]], "Input", PageWidth->PaperWidth], Cell[BoxData[ ButtonBox[ ButtonBox[ StyleBox[ RowBox[{ StyleBox["\[MathematicaIcon]", FontSize->18, FontVariations->{"CompatibilityType"->0}, FontColor->RGBColor[0.792981, 0.777356, 0.144533]], StyleBox[" ", FontSize->14, FontSlant->"Italic"], StyleBox["About", FontSize->14, FontColor->RGBColor[0.500008, 0, 0.500008]], StyleBox[" ", FontSize->14, FontSlant->"Italic"], StyleBox["Mathematica", FontSize->14, FontSlant->"Italic", FontColor->RGBColor[0.500008, 0, 0.500008]]}], FontWeight->"Bold"], BaseStyle->"Hyperlink"], BaseStyle->"Hyperlink", ButtonData:>"h1"]], "Input", PageWidth->PaperWidth, Evaluatable->False, CellTags->"h1b"], Cell[TextData[{ "Next, we plot the data to see if there is a recognizable pattern and name \ the plot ", StyleBox["p1", FontWeight->"Bold"], " for later use." }], "Text", PageWidth->PaperWidth], Cell[BoxData[{ RowBox[{ RowBox[{"xlabel", "=", "\"\\""}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"ylabel", "=", "\"\\""}], ";"}], "\[IndentingNewLine]", RowBox[{"p1", "=", RowBox[{"ListPlot", "[", RowBox[{"data", ",", RowBox[{"PlotStyle", "\[Rule]", RowBox[{"{", RowBox[{ RowBox[{"PointSize", "[", "0.017`", "]"}], ",", RowBox[{"RGBColor", "[", RowBox[{"1", ",", "0", ",", "0"}], "]"}]}], "}"}]}], ",", RowBox[{"AxesLabel", "\[Rule]", RowBox[{"{", RowBox[{"xlabel", ",", "ylabel"}], "}"}]}]}], "]"}]}]}], "Input", PageWidth->PaperWidth] }, Closed]], Cell[CellGroupData[{ Cell["Designing a Model", "Subsubsection", PageWidth->PaperWidth], Cell[TextData[{ "The data strongly suggest a linear relationship. Now we use the ", StyleBox["Fit[ ]", FontWeight->"Bold"], " function to find the line of best-fit or the linear regression line." }], "Text", PageWidth->PaperWidth], Cell[BoxData[ ButtonBox[ ButtonBox[ StyleBox[ RowBox[{ StyleBox["\[MathematicaIcon]", FontSize->18, FontVariations->{"CompatibilityType"->0}, FontColor->RGBColor[0.792981, 0.777356, 0.144533]], StyleBox[" ", FontSize->14, FontSlant->"Italic"], StyleBox["About", FontSize->14, FontColor->RGBColor[0.500008, 0, 0.500008]], StyleBox[" ", FontSize->14, FontSlant->"Italic"], StyleBox["Mathematica", FontSize->14, FontSlant->"Italic", FontColor->RGBColor[0.500008, 0, 0.500008]]}], FontWeight->"Bold"], BaseStyle->"Hyperlink"], BaseStyle->"Hyperlink", ButtonData:>"h2"]], "Input", PageWidth->PaperWidth, Evaluatable->False, CellTags->"h2b"], Cell[BoxData[{ RowBox[{ RowBox[{"Clear", "[", "y", "]"}], ";"}], "\n", RowBox[{ RowBox[{"y", "[", "x_", "]"}], "=", RowBox[{"Fit", "[", RowBox[{"data", ",", RowBox[{"{", "x", "}"}], ",", "x"}], "]"}]}]}], "Input", PageWidth->PaperWidth], Cell[BoxData[ ButtonBox[ ButtonBox[ StyleBox[ RowBox[{ StyleBox["\[MathematicaIcon]", FontSize->18, FontVariations->{"CompatibilityType"->0}, FontColor->RGBColor[0.792981, 0.777356, 0.144533]], StyleBox[" ", FontSize->14, FontSlant->"Italic"], StyleBox["About", FontSize->14, FontColor->RGBColor[0.500008, 0, 0.500008]], StyleBox[" ", FontSize->14, FontSlant->"Italic"], StyleBox["Mathematica", FontSize->14, FontSlant->"Italic", FontColor->RGBColor[0.500008, 0, 0.500008]]}], FontWeight->"Bold"], BaseStyle->"Hyperlink"], BaseStyle->"Hyperlink", ButtonData:>"h3"]], "Input", PageWidth->PaperWidth, Evaluatable->False, CellTags->"h3b"], Cell[TextData[{ "The constant of proportionality is 0.874732. Next, we plot the regression \ line, save it as ", StyleBox["p2", FontWeight->"Bold"], ", and then show the plots of the data and the regression line together on \ the same graph." }], "Text", PageWidth->PaperWidth], Cell[BoxData[ RowBox[{"p2", "=", RowBox[{"Plot", "[", RowBox[{ RowBox[{"y", "[", "x", "]"}], ",", RowBox[{"{", RowBox[{"x", ",", "0", ",", "10"}], "}"}], ",", RowBox[{"PlotStyle", "\[Rule]", RowBox[{"{", RowBox[{"RGBColor", "[", RowBox[{"0", ",", "0", ",", "1"}], "]"}], "}"}]}], ",", RowBox[{"AxesLabel", "\[Rule]", RowBox[{"{", RowBox[{"xlabel", ",", "ylabel"}], "}"}]}]}], "]"}]}]], "Input", PageWidth->PaperWidth], Cell[BoxData[ RowBox[{"Show", "[", RowBox[{"p1", ",", "p2"}], "]"}]], "Input", PageWidth->PaperWidth] }, Closed]], Cell[CellGroupData[{ Cell["Assessing the Errors", "Subsubsection", PageWidth->PaperWidth], Cell["\<\ As we expected, the line appears to fit the data very well. We can provide \ further verification by calculating the residual errors for each data point \ and plotting them. First, we need to use the model to calculate the values of \ stretch for each mass value in the original data set.\ \>", "Text", PageWidth->PaperWidth], Cell[BoxData[ RowBox[{"predictedvalues", "=", RowBox[{"Table", "[", RowBox[{ RowBox[{"{", RowBox[{"x", ",", RowBox[{"y", "[", "x", "]"}]}], "}"}], ",", RowBox[{"{", RowBox[{"x", ",", "0", ",", RowBox[{"Length", "[", "data", "]"}]}], "}"}]}], "]"}]}]], "Input", PageWidth->PaperWidth], Cell[BoxData[ ButtonBox[ ButtonBox[ RowBox[{ StyleBox["\[MathematicaIcon]", FontSize->18, FontWeight->"Bold", FontVariations->{"CompatibilityType"->0}, FontColor->RGBColor[0.792981, 0.777356, 0.144533]], StyleBox[" ", FontSize->14, FontWeight->"Bold", FontSlant->"Italic"], StyleBox["About", FontSize->14, FontWeight->"Bold", FontColor->RGBColor[0.500008, 0, 0.500008]], StyleBox[" ", FontSize->14, FontWeight->"Bold", FontSlant->"Italic"], StyleBox["Mathematica", FontSize->14, FontWeight->"Bold", FontSlant->"Italic", FontColor->RGBColor[0.500008, 0, 0.500008]], " "}], BaseStyle->"Hyperlink"], BaseStyle->"Hyperlink", ButtonData:>"h4"]], "Input", PageWidth->PaperWidth, Evaluatable->False, CellTags->"h4b"], Cell["\<\ The residual error (or residual) is the difference between the measured value \ and the value the model predicts for each amount of mass.\ \>", "Text", PageWidth->PaperWidth], Cell[BoxData[ RowBox[{"residuals", "=", RowBox[{"Table", "[", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"i", "-", "1"}], ",", RowBox[{ RowBox[{"data", "[", RowBox[{"[", RowBox[{"i", ",", "2"}], "]"}], "]"}], "-", RowBox[{"predictedvalues", "[", RowBox[{"[", RowBox[{"i", ",", "2"}], "]"}], "]"}]}]}], "}"}], ",", RowBox[{"{", RowBox[{"i", ",", "1", ",", RowBox[{"Length", "[", "data", "]"}]}], "}"}]}], "]"}]}]], "Input", PageWidth->PaperWidth], Cell[BoxData[ ButtonBox[ ButtonBox[ StyleBox[ RowBox[{ StyleBox["\[MathematicaIcon]", FontSize->18, FontVariations->{"CompatibilityType"->0}, FontColor->RGBColor[0.792981, 0.777356, 0.144533]], StyleBox[" ", FontSize->14, FontSlant->"Italic"], StyleBox["About", FontSize->14, FontColor->RGBColor[0.500008, 0, 0.500008]], StyleBox[" ", FontSize->14, FontSlant->"Italic"], StyleBox["Mathematica", FontSize->14, FontSlant->"Italic", FontColor->RGBColor[0.500008, 0, 0.500008]]}], FontWeight->"Bold"], BaseStyle->"Hyperlink"], BaseStyle->"Hyperlink", ButtonData:>"h5"]], "Input", PageWidth->PaperWidth, Evaluatable->False, CellTags->"h5b"], Cell[BoxData[ RowBox[{"ListPlot", "[", RowBox[{"residuals", ",", RowBox[{"PlotStyle", "\[Rule]", RowBox[{"{", RowBox[{ RowBox[{"PointSize", "[", "0.02`", "]"}], ",", RowBox[{"RGBColor", "[", RowBox[{"0", ",", "0", ",", "1"}], "]"}]}], "}"}]}], ",", RowBox[{"AxesLabel", "\[Rule]", RowBox[{"{", RowBox[{"\"\\"", ",", "\"\\""}], "}"}]}]}], "]"}]], "Input", PageWidth->PaperWidth], Cell["\<\ Once again, the observed pattern in the residuals shows that the model is not \ as good as it might be, however the residuals show that the differences are \ indeed small. Small is a relative term, and sometimes it is more meaningful \ to look at the error in relation to the size of the quantity being estimated. \ For all but the first data point, we calculate the relative error by dividing \ the measured value into the residual and multiplying by 100 to express this \ relative error as a percentage. Then, we plot the percentage error for each \ data point.\ \>", "Text", PageWidth->PaperWidth, CellChangeTimes->{{3.4490775746875*^9, 3.449077630109375*^9}}], Cell[BoxData[ RowBox[{"percenterrors", "=", RowBox[{"Table", "[", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"i", "-", "1"}], ",", RowBox[{ RowBox[{ RowBox[{"(", RowBox[{ RowBox[{"data", "[", RowBox[{"[", RowBox[{"i", ",", "2"}], "]"}], "]"}], "-", RowBox[{"predictedvalues", "[", RowBox[{"[", RowBox[{"i", ",", "2"}], "]"}], "]"}]}], ")"}], "/", RowBox[{"data", "[", RowBox[{"[", RowBox[{"i", ",", "2"}], "]"}], "]"}]}], "*", "100"}]}], "}"}], ",", RowBox[{"{", RowBox[{"i", ",", "2", ",", "11"}], "}"}]}], "]"}]}]], "Input", PageWidth->PaperWidth], Cell[BoxData[ RowBox[{"ListPlot", "[", RowBox[{"percenterrors", ",", RowBox[{"PlotStyle", "\[Rule]", RowBox[{"{", RowBox[{ RowBox[{"PointSize", "[", "0.02`", "]"}], ",", RowBox[{"RGBColor", "[", RowBox[{"0", ",", "0", ",", "1"}], "]"}]}], "}"}]}], ",", RowBox[{"PlotRange", "\[Rule]", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"0", ",", "10"}], "}"}], ",", "All"}], "}"}]}], ",", RowBox[{"AxesLabel", "\[Rule]", RowBox[{"{", RowBox[{"\"\\"", ",", "\"\<% error\>\""}], "}"}]}]}], "]"}]], "Input", PageWidth->PaperWidth], Cell[TextData[{ "The maximum relative error for the linear model is ", Cell[BoxData[ FormBox[ RowBox[{"1.7", "%"}], TraditionalForm]]], " in size. Not bad!" }], "Text", PageWidth->PaperWidth, CellChangeTimes->{{3.44907754721875*^9, 3.449077555453125*^9}}] }, Closed]] }, Closed]], Cell[CellGroupData[{ Cell["Radioactivity", "Subsection", PageWidth->PaperWidth], Cell[CellGroupData[{ Cell["Observing the Data", "Subsubsection", PageWidth->PaperWidth], Cell["\<\ A radioactive dye is injected into a patient's veins to facilitate an X-ray \ procedure. Measuring the radioactivity in counts per minute every minute for \ 10 minutes yielded the table of values shown below.\ \>", "Text", PageWidth->PaperWidth], Cell[BoxData[{ RowBox[{ RowBox[{"data", "=", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"0", ",", "10023"}], "}"}], ",", RowBox[{"{", RowBox[{"1", ",", "8174"}], "}"}], ",", RowBox[{"{", RowBox[{"2", ",", "6693"}], "}"}], ",", RowBox[{"{", RowBox[{"3", ",", "5500"}], "}"}], ",", RowBox[{"{", RowBox[{"4", ",", "4489"}], "}"}], ",", RowBox[{"{", RowBox[{"5", ",", "3683"}], "}"}], ",", RowBox[{"{", RowBox[{"6", ",", "3061"}], "}"}], ",", RowBox[{"{", RowBox[{"7", ",", "2479"}], "}"}], ",", RowBox[{"{", RowBox[{"8", ",", "2045"}], "}"}], ",", RowBox[{"{", RowBox[{"9", ",", "1645"}], "}"}], ",", RowBox[{"{", RowBox[{"10", ",", "1326"}], "}"}]}], "}"}]}], ";"}], "\n", RowBox[{"TableForm", "[", RowBox[{"data", ",", RowBox[{"TableDirections", "\[Rule]", RowBox[{"{", RowBox[{"Row", ",", "Column"}], "}"}]}], ",", RowBox[{"TableHeadings", "\[Rule]", RowBox[{"{", RowBox[{"None", ",", RowBox[{"{", RowBox[{"\"\\"", ",", "\"\\""}], "}"}]}], "}"}]}]}], "]"}]}], "Input", PageWidth->PaperWidth], Cell[BoxData[ ButtonBox[ ButtonBox[ StyleBox[ RowBox[{ StyleBox["\[MathematicaIcon]", FontSize->18, FontVariations->{"CompatibilityType"->0}, FontColor->RGBColor[0.792981, 0.777356, 0.144533]], StyleBox[" ", FontSize->14, FontSlant->"Italic"], StyleBox["About", FontSize->14, FontColor->RGBColor[0.500008, 0, 0.500008]], StyleBox[" ", FontSize->14, FontSlant->"Italic"], StyleBox["Mathematica", FontSize->14, FontSlant->"Italic", FontColor->RGBColor[0.500008, 0, 0.500008]]}], FontWeight->"Bold"], BaseStyle->"Hyperlink"], BaseStyle->"Hyperlink", ButtonData:>"h6"]], "Input", PageWidth->PaperWidth, Evaluatable->False, CellTags->"h6b"], Cell["We begin by plotting the data points.", "Text", PageWidth->PaperWidth], Cell[BoxData[{ RowBox[{ RowBox[{"xlabel", "=", "\"\\""}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"ylabel", "=", "\"\\""}], ";", RowBox[{"p1", "=", RowBox[{"ListPlot", "[", RowBox[{"data", ",", RowBox[{"PlotRange", "\[Rule]", RowBox[{"{", RowBox[{"0", ",", "10050"}], "}"}]}], ",", RowBox[{"PlotStyle", "\[Rule]", RowBox[{"{", RowBox[{ RowBox[{"PointSize", "[", "0.02`", "]"}], ",", RowBox[{"RGBColor", "[", RowBox[{"0.996109`", ",", "0", ",", "0"}], "]"}]}], "}"}]}], ",", RowBox[{"AxesLabel", "\[Rule]", RowBox[{"{", RowBox[{"xlabel", ",", "ylabel"}], "}"}]}]}], "]"}]}]}]}], "Input", PageWidth->PaperWidth] }, Closed]], Cell[CellGroupData[{ Cell["Designing a Model", "Subsubsection", PageWidth->PaperWidth], Cell[TextData[{ "There appears to be a trend that we can capture with a mathematical model, \ and now we try to find a suitable model using the ", StyleBox["Fit[ ]", FontWeight->"Bold"], " function. What does the function look like to you? A decaying \ exponential? We try to find a function of the form ", Cell[BoxData[ FormBox[ RowBox[{"y", "=", RowBox[{"a", "+", RowBox[{"b", FormBox[ SuperscriptBox["e", RowBox[{ RowBox[{"-", "k"}], " ", "x"}]], TraditionalForm]}]}]}], TraditionalForm]]], ", where we vary the value of ", StyleBox["k", FontSlant->"Italic"], " and the computer calculates the value of ", StyleBox["a and b", FontSlant->"Italic"], " for the best-fit function of this form." }], "Text", PageWidth->PaperWidth, CellChangeTimes->{{3.44907826065625*^9, 3.449078270609375*^9}}], Cell[BoxData[{ RowBox[{ RowBox[{"k", "=", "0.1"}], ";"}], "\n", RowBox[{ RowBox[{"Clear", "[", "y", "]"}], ";"}], "\n", RowBox[{ RowBox[{"y", "[", "x_", "]"}], "=", RowBox[{"Fit", "[", RowBox[{"data", ",", RowBox[{"{", RowBox[{ RowBox[{"Exp", "[", RowBox[{ RowBox[{"-", "k"}], "*", "x"}], "]"}], ",", "1"}], "}"}], ",", "x"}], "]"}]}]}], "Input", PageWidth->PaperWidth, CellChangeTimes->{{3.449077746640625*^9, 3.449077747890625*^9}, 3.449077799234375*^9, {3.449077829265625*^9, 3.4490778295*^9}, 3.449078222953125*^9, {3.44907829315625*^9, 3.449078293453125*^9}, { 3.449078377921875*^9, 3.44907838196875*^9}, {3.449078415234375*^9, 3.449078433609375*^9}, 3.449078467125*^9, {3.44907852734375*^9, 3.449078527859375*^9}}], Cell[TextData[{ "Next, we plot our model function, save it as ", StyleBox["p2", FontWeight->"Bold"], ", and then show the plots of the data and the model function together on \ the same graph." }], "Text", PageWidth->PaperWidth], Cell[BoxData[ RowBox[{"p2", "=", RowBox[{"Plot", "[", RowBox[{ RowBox[{"y", "[", "x", "]"}], ",", RowBox[{"{", RowBox[{"x", ",", "0", ",", "10"}], "}"}], ",", RowBox[{"PlotRange", "\[Rule]", RowBox[{"{", RowBox[{"0", ",", "10050"}], "}"}]}], ",", RowBox[{"PlotStyle", "\[Rule]", RowBox[{"{", RowBox[{"RGBColor", "[", RowBox[{"0", ",", "0", ",", "1"}], "]"}], "}"}]}], ",", RowBox[{"AxesLabel", "\[Rule]", RowBox[{"{", RowBox[{"xlabel", ",", "ylabel"}], "}"}]}]}], "]"}]}]], "Input", PageWidth->PaperWidth], Cell[BoxData[ RowBox[{"Show", "[", RowBox[{"p2", ",", "p1"}], "]"}]], "Input", PageWidth->PaperWidth], Cell[BoxData[ ButtonBox[ ButtonBox[ StyleBox[ RowBox[{ StyleBox["\[MathematicaIcon]", FontSize->18, FontVariations->{"CompatibilityType"->0}, FontColor->RGBColor[0.792981, 0.777356, 0.144533]], StyleBox[" ", FontSize->14, FontSlant->"Italic"], StyleBox["About", FontSize->14, FontColor->RGBColor[0.500008, 0, 0.500008]], StyleBox[" ", FontSize->14, FontSlant->"Italic"], StyleBox["Mathematica", FontSize->14, FontSlant->"Italic", FontColor->RGBColor[0.500008, 0, 0.500008]]}], FontWeight->"Bold"], BaseStyle->"Hyperlink"], BaseStyle->"Hyperlink", ButtonData:>"h7"]], "Input", PageWidth->PaperWidth, Evaluatable->False, CellTags->"h7b"] }, Closed]], Cell[CellGroupData[{ Cell["Assessing the Errors", "Subsubsection", PageWidth->PaperWidth], Cell[TextData[{ "Our model doesn't appear to be very good! Let's quantify just how good (or \ bad) it is. You guessed right ", Cell[BoxData[ FormBox["-", TraditionalForm]]], " we should calculate the residual errors to do this quantification." }], "Text", PageWidth->PaperWidth], Cell[BoxData[ RowBox[{"residuals", "=", RowBox[{"Table", "[", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"data", "[", RowBox[{"[", RowBox[{"i", ",", "1"}], "]"}], "]"}], ",", RowBox[{ RowBox[{"data", "[", RowBox[{"[", RowBox[{"i", ",", "2"}], "]"}], "]"}], "-", RowBox[{"y", "[", RowBox[{"data", "[", RowBox[{"[", RowBox[{"i", ",", "1"}], "]"}], "]"}], "]"}]}]}], "}"}], ",", RowBox[{"{", RowBox[{"i", ",", "1", ",", RowBox[{"Length", "[", "data", "]"}]}], "}"}]}], "]"}]}]], "Input", PageWidth->PaperWidth], Cell["\<\ To get an overall measure of the error for all of the data points in the set, \ you might be inclined to calculate the average (mean) of the residuals, but \ this can be very misleading. \ \>", "Text", PageWidth->PaperWidth], Cell[BoxData[ RowBox[{"residavg", "=", RowBox[{ RowBox[{"Sum", "[", RowBox[{ RowBox[{"residuals", "[", RowBox[{"[", RowBox[{"i", ",", "2"}], "]"}], "]"}], ",", RowBox[{"{", RowBox[{"i", ",", "1", ",", RowBox[{"Length", "[", "data", "]"}]}], "}"}]}], "]"}], "/", RowBox[{"Length", "[", "data", "]"}]}]}]], "Input", PageWidth->PaperWidth, CellChangeTimes->{{3.4490778735625*^9, 3.44907795403125*^9}, { 3.4490781044375*^9, 3.449078105265625*^9}}], Cell[TextData[{ "As you can see, the mean residual error is very small, especially relative \ to the average size of the measured values of radioactivity in the data set. \ On this basis, we might be led to believe that our model isn't so bad after \ all. Wrong! The problem is that the individual or local errors are actually \ sizable when compared to the measured radioactivity counts, but because some \ of them are positive and some are negative, they tend to cancel each other \ when we add them together to calculate their mean value. Look at the values \ in the list of residual errors or look at the vertical differences between \ the data points and the fit function on the graph, and it is easy to see that \ the average of the residual errors is misleading.\n\nThere is an infinite \ number of ways to address this canceling problem, but one of the most common \ is to calculate the sum of the squares of the residuals and try to find the \ smallest or least value of this sum of squared residuals, hence we have the \ term \"least squares.\" Squaring the residuals removes the canceling effect \ that occurs when we add them together for a measure of the global error. The ", StyleBox["Mathematica", FontSlant->"Italic"], " ", StyleBox["Fit[ ]", FontWeight->"Bold"], " function uses least squares, and some variations of it, to find a best-fit \ function for a set of data. Finding the minimum value for the sum of squared \ residuals is a problem that can be solved using calculus, and you will study \ this problem later on, but for now you can do it by trial and error. Let's \ get back to our radioactivity problem. What we do now is to calculate the sum \ of the squares of the residuals for our data set. " }], "Text", PageWidth->PaperWidth, CellChangeTimes->{{3.44907797059375*^9, 3.449077988890625*^9}, { 3.44907802071875*^9, 3.4490780334375*^9}, {3.44907807015625*^9, 3.449078072265625*^9}, {3.449078567828125*^9, 3.44907857696875*^9}}], Cell[BoxData[ RowBox[{"residsquaresum", "=", RowBox[{"Sum", "[", RowBox[{ RowBox[{ RowBox[{"residuals", "[", RowBox[{"[", RowBox[{"i", ",", "2"}], "]"}], "]"}], "^", "2"}], ",", RowBox[{"{", RowBox[{"i", ",", "1", ",", RowBox[{"Length", "[", "data", "]"}]}], "}"}]}], "]"}]}]], "Input", PageWidth->PaperWidth], Cell["Next, we calculate the mean of the squared residuals.", "Text", PageWidth->PaperWidth], Cell[BoxData[ RowBox[{"msresiduals", "=", RowBox[{"residsquaresum", "/", RowBox[{"Length", "[", "data", "]"}]}]}]], "Input", PageWidth->PaperWidth], Cell[TextData[{ "Comparing the average of the squared residuals with the average of the \ radioactivity counts in the data set would be like comparing apples with \ oranges because ", StyleBox["msresiduals", FontWeight->"Bold"], " is an average of squares, whereas the average radioactivity count is not \ an average of squared values. To make a fair comparison, we take the square \ root of the mean of the squares." }], "Text", PageWidth->PaperWidth], Cell[BoxData[ RowBox[{"rmsresiduals", "=", RowBox[{"Sqrt", "[", "msresiduals", "]"}]}]], "Input", PageWidth->PaperWidth], Cell["\<\ The value that we calculate in the preceding step is the root of the mean of \ the squares of the residuals and is oftentimes called the root-mean-square or \ \"rms\" value of the residuals. \ \>", "Text", PageWidth->PaperWidth] }, Closed]] }, Closed]] }, Closed]], Cell[CellGroupData[{ Cell["You Try It: Improving the Model and Making Predictions", "Section", PageWidth->PaperWidth], Cell[CellGroupData[{ Cell["Improving the Model", "Subsection", PageWidth->PaperWidth], Cell[TextData[{ "In Part II, we calculated the \"rms\" value of the residual errors, a \ number that we can use for a fair comparison with the average of the measured \ radioactivity values. As we initially expected, this comparison leads us to \ conclude that our model needs improvement. We will leave that up to you, but, \ to help out, we group all of the commands that you need for the error \ analysis into one cell, the one that follows. Use trial and error to find a \ better model function by changing the value of ", StyleBox["k", FontWeight->"Bold"], " (in ", StyleBox["red", FontColor->RGBColor[1, 0, 0]], ") to reduce (possibly minimize) the sum of the squared residuals (which \ will also minimize the \"rms\" value). See if this value of ", StyleBox["k", FontWeight->"Bold"], " and this model ", StyleBox["b", FontWeight->"Bold", FontSlant->"Italic"], Cell[BoxData[ FormBox[ RowBox[{ SuperscriptBox["e", RowBox[{"-", "kx"}]], " "}], TraditionalForm]], FormatType->"TraditionalForm", FontWeight->"Bold"], "is better than the one used above.", "\n\nA c", StyleBox["omment about errors in modeling", FontSlant->"Italic"], ": Keep in mind that in mathematical modeling you are not able to completely \ eliminate errors. This is because of random errors that occur in measurements \ due to the limited precision of all measuring instruments, and because of \ systematic errors (i.e., errors that follow a pattern) due to shortcomings of \ the model and/or possible defects in the measuring tools. Systematic errors \ can often be reduced or eliminated by refining the model and repairing or \ recalibrating the measuring equipment, but random errors are unavoidable. We \ can reduce the magnitudes of random errors by using more precise instruments, \ but we cannot eliminate them. The errors may be smaller, but they are always \ present." }], "Text", PageWidth->PaperWidth, CellChangeTimes->{{3.4490786484375*^9, 3.44907877059375*^9}}], Cell[BoxData[{ RowBox[{ RowBox[{"k", "=", StyleBox["0.2", FontColor->RGBColor[1, 0, 0]]}], ";"}], "\n", RowBox[{ RowBox[{"Clear", "[", "y", "]"}], ";"}], "\n", RowBox[{ RowBox[{"y", "[", "x_", "]"}], "=", RowBox[{"Fit", "[", RowBox[{"data", ",", RowBox[{"{", RowBox[{"Exp", "[", RowBox[{ RowBox[{"-", "k"}], " ", "x"}], "]"}], "}"}], ",", "x"}], "]"}]}], "\n", RowBox[{ RowBox[{"p2", "=", RowBox[{"Plot", "[", RowBox[{ RowBox[{"y", "[", "x", "]"}], ",", RowBox[{"{", RowBox[{"x", ",", "0", ",", "10"}], "}"}], ",", RowBox[{"PlotStyle", "\[Rule]", RowBox[{"{", RowBox[{"RGBColor", "[", RowBox[{"0", ",", "0", ",", "1"}], "]"}], "}"}]}], ",", RowBox[{"AxesLabel", "\[Rule]", RowBox[{"{", RowBox[{"xlabel", ",", "ylabel"}], "}"}]}], ",", RowBox[{"DisplayFunction", "\[Rule]", "Identity"}]}], "]"}]}], ";"}], "\n", RowBox[{"Show", "[", RowBox[{"p2", ",", "p1", ",", RowBox[{"DisplayFunction", "\[Rule]", "$DisplayFunction"}]}], "]"}], "\n", RowBox[{ RowBox[{"residuals", "=", RowBox[{"Table", "[", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"data", "\[LeftDoubleBracket]", RowBox[{"i", ",", "1"}], "\[RightDoubleBracket]"}], ",", RowBox[{ RowBox[{"data", "\[LeftDoubleBracket]", RowBox[{"i", ",", "2"}], "\[RightDoubleBracket]"}], "-", RowBox[{"y", "[", RowBox[{"data", "\[LeftDoubleBracket]", RowBox[{"i", ",", "1"}], "\[RightDoubleBracket]"}], "]"}]}]}], "}"}], ",", RowBox[{"{", RowBox[{"i", ",", "1", ",", RowBox[{"Length", "[", "data", "]"}]}], "}"}]}], "]"}]}], ";"}], "\n", RowBox[{ RowBox[{"residsquaresum", "=", RowBox[{ UnderoverscriptBox["\[Sum]", RowBox[{"i", "=", "1"}], RowBox[{"Length", "[", "data", "]"}]], SuperscriptBox[ RowBox[{"residuals", "\[LeftDoubleBracket]", RowBox[{"i", ",", "2"}], "\[RightDoubleBracket]"}], "2"]}]}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"msresiduals", "=", FractionBox["residsquaresum", RowBox[{"Length", "[", "data", "]"}]]}], ";"}], "\[IndentingNewLine]", RowBox[{"rmsresiduals", "=", SqrtBox["msresiduals"]}]}], "Input", PageWidth->PaperWidth, CellChangeTimes->{3.44907863678125*^9}], Cell[BoxData[ ButtonBox[ ButtonBox[ StyleBox[ RowBox[{ StyleBox["\[MathematicaIcon]", FontSize->18, FontVariations->{"CompatibilityType"->0}, FontColor->RGBColor[0.792981, 0.777356, 0.144533]], StyleBox[" ", FontSize->14, FontSlant->"Italic"], StyleBox["About", FontSize->14, FontColor->RGBColor[0.500008, 0, 0.500008]], StyleBox[" ", FontSize->14, FontSlant->"Italic"], StyleBox["Mathematica", FontSize->14, FontSlant->"Italic", FontColor->RGBColor[0.500008, 0, 0.500008]]}], FontWeight->"Bold"], BaseStyle->"Hyperlink"], BaseStyle->"Hyperlink", ButtonData:>"h8"]], "Input", PageWidth->PaperWidth, Evaluatable->False, CellTags->"h8b"] }, Closed]], Cell[CellGroupData[{ Cell["Making Predictions", "Subsection", PageWidth->PaperWidth], Cell["\<\ Now use your improved model to determine when the radioactivity will fall \ below 500 counts per minute. (You may ignore the error message here.)\ \>", "Text", PageWidth->PaperWidth, CellChangeTimes->{{3.449234063625*^9, 3.449234077546875*^9}}], Cell[BoxData[ RowBox[{"Solve", "[", RowBox[{ RowBox[{ RowBox[{"y", "[", "x", "]"}], "\[Equal]", "500"}], ",", "x"}], "]"}]], "Input", PageWidth->PaperWidth], Cell["\<\ Your improved model should predict that the radioactivity will be below 500 \ cpm after about 15 minutes. Is that what you get?\ \>", "Text", PageWidth->PaperWidth], Cell[BoxData[ ButtonBox[ ButtonBox[ StyleBox[ RowBox[{ StyleBox["\[MathematicaIcon]", FontSize->18, FontVariations->{"CompatibilityType"->0}, FontColor->RGBColor[0.792981, 0.777356, 0.144533]], StyleBox[" ", FontSize->14, FontSlant->"Italic"], StyleBox["About", FontSize->14, FontColor->RGBColor[0.500008, 0, 0.500008]], StyleBox[" ", FontSize->14, FontSlant->"Italic"], StyleBox["Mathematica", FontSize->14, FontSlant->"Italic", FontColor->RGBColor[0.500008, 0, 0.500008]]}], FontWeight->"Bold"], BaseStyle->"Hyperlink"], BaseStyle->"Hyperlink", ButtonData:>"h9"]], "Input", PageWidth->PaperWidth, Evaluatable->False, CellTags->"h9b"] }, Closed]] }, Closed]], Cell[CellGroupData[{ Cell["Part III: Growth of Ponderosa Pines and Black Bass", "Section", PageWidth->PaperWidth], Cell[CellGroupData[{ Cell["Ponderosa Pines", "Subsection", PageWidth->PaperWidth], Cell[CellGroupData[{ Cell["Observing the Data", "Subsubsection", PageWidth->PaperWidth], Cell["\<\ In the table that follows, the girth of a pine tree (the distance around the \ tree at shoulder height) is measured in inches, and the volume of usable \ lumber obtained from the tree is measured in board feet (bf). We will \ formulate and test the following models: that usable board feet is \ proportional to (a) the square of the girth and (b) the cube of the girth. \ Which is better? Does one model provide a better explanation than the other?\ \>", "Text", PageWidth->PaperWidth], Cell[BoxData[{ RowBox[{ RowBox[{"data", "=", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"17", ",", "19"}], "}"}], ",", RowBox[{"{", RowBox[{"19", ",", "25"}], "}"}], ",", RowBox[{"{", RowBox[{"20", ",", "32"}], "}"}], ",", RowBox[{"{", RowBox[{"23", ",", "57"}], "}"}], ",", RowBox[{"{", RowBox[{"25", ",", "71"}], "}"}], ",", RowBox[{"{", RowBox[{"28", ",", "113"}], "}"}], ",", RowBox[{"{", RowBox[{"32", ",", "123"}], "}"}], ",", RowBox[{"{", RowBox[{"38", ",", "252"}], "}"}], ",", RowBox[{"{", RowBox[{"39", ",", "259"}], "}"}], ",", RowBox[{"{", RowBox[{"41", ",", "294"}], "}"}]}], "}"}]}], ";"}], "\n", RowBox[{"TableForm", "[", RowBox[{"data", ",", RowBox[{"TableDirections", "\[Rule]", RowBox[{"{", RowBox[{"Row", ",", "Column"}], "}"}]}], ",", RowBox[{"TableHeadings", "\[Rule]", RowBox[{"{", RowBox[{"None", ",", RowBox[{"{", RowBox[{"\"\\"", ",", "\"\\""}], "}"}]}], "}"}]}]}], "]"}]}], "Input", PageWidth->PaperWidth], Cell["\<\ Next, we plot the data to see if there is a recognizable pattern.\ \>", "Text", PageWidth->PaperWidth], Cell[BoxData[{ RowBox[{ RowBox[{"xlabel", "=", "\"\\""}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"ylabel", "=", "\"\\""}], ";"}], "\[IndentingNewLine]", RowBox[{"p1", "=", RowBox[{"ListPlot", "[", RowBox[{"data", ",", RowBox[{"PlotRange", "\[Rule]", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"0", ",", "45"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "300"}], "}"}]}], "}"}]}], ",", RowBox[{"PlotStyle", "\[Rule]", RowBox[{"{", RowBox[{ RowBox[{"PointSize", "[", "0.023`", "]"}], ",", RowBox[{"RGBColor", "[", RowBox[{"1", ",", "0", ",", "0"}], "]"}]}], "}"}]}], ",", RowBox[{"AxesLabel", "\[Rule]", RowBox[{"{", RowBox[{"xlabel", ",", "ylabel"}], "}"}]}]}], "]"}]}]}], "Input", PageWidth->PaperWidth] }, Closed]], Cell[CellGroupData[{ Cell["Designing a Model", "Subsubsection", PageWidth->PaperWidth], Cell[TextData[{ "We are asked to compare a quadratic and a cubic model, so now we use the ", StyleBox["Fit[ ]", FontWeight->"Bold"], " command to find the best-fit function for each model." }], "Text", PageWidth->PaperWidth], Cell[BoxData[{ RowBox[{ RowBox[{"Clear", "[", "y2", "]"}], ";"}], "\n", RowBox[{ RowBox[{"y2", "[", "x_", "]"}], "=", RowBox[{"Fit", "[", RowBox[{"data", ",", RowBox[{"{", RowBox[{"x", "^", "2"}], "}"}], ",", "x"}], "]"}]}]}], "Input", PageWidth->PaperWidth], Cell[BoxData[{ RowBox[{ RowBox[{"Clear", "[", "y3", "]"}], ";"}], "\n", RowBox[{ RowBox[{"y3", "[", "x_", "]"}], "=", RowBox[{"Fit", "[", RowBox[{"data", ",", RowBox[{"{", RowBox[{"x", "^", "3"}], "}"}], ",", "x"}], "]"}]}]}], "Input", PageWidth->PaperWidth], Cell["\<\ We plot the two models and superimpose their graphs on the graph of the data.\ \>", "Text", PageWidth->PaperWidth], Cell[BoxData[ RowBox[{"p2", "=", RowBox[{"Plot", "[", RowBox[{ RowBox[{"y2", "[", "x", "]"}], ",", RowBox[{"{", RowBox[{"x", ",", "0", ",", "45"}], "}"}], ",", RowBox[{"PlotStyle", "\[Rule]", RowBox[{"{", RowBox[{"RGBColor", "[", RowBox[{"0", ",", "0", ",", "1"}], "]"}], "}"}]}], ",", RowBox[{"AxesLabel", "\[Rule]", RowBox[{"{", RowBox[{"xlabel", ",", "ylabel"}], "}"}]}], ",", RowBox[{"PlotLabel", "\[Rule]", "\"\\""}]}], "]"}]}]], "Input", PageWidth->PaperWidth], Cell[BoxData[ RowBox[{"p3", "=", RowBox[{"Plot", "[", RowBox[{ RowBox[{"y3", "[", "x", "]"}], ",", RowBox[{"{", RowBox[{"x", ",", "0", ",", "45"}], "}"}], ",", RowBox[{"PlotStyle", "\[Rule]", RowBox[{"{", RowBox[{"RGBColor", "[", RowBox[{"0", ",", "1", ",", "0"}], "]"}], "}"}]}], ",", RowBox[{"AxesLabel", "\[Rule]", RowBox[{"{", RowBox[{"xlabel", ",", "ylabel"}], "}"}]}], ",", RowBox[{"PlotLabel", "\[Rule]", "\"\\""}]}], "]"}]}]], "Input", PageWidth->PaperWidth], Cell[BoxData[ RowBox[{"Show", "[", RowBox[{"p3", ",", "p2", ",", "p1", ",", RowBox[{"PlotLabel", "\[Rule]", "\"\\""}]}], "]"}]], "Input", PageWidth->PaperWidth], Cell["\<\ The graphs seem to show that the cubic model better fits the data. \ \>", "Text", PageWidth->PaperWidth] }, Closed]], Cell[CellGroupData[{ Cell["Assessing the Errors", "Subsubsection", PageWidth->PaperWidth], Cell[TextData[{ "Now we analyze the fit for each of the models by calculating the percent \ errors, first for the quadratic function and then for the cubic.", StyleBox["\n\nAnalysis of the Errors for the Quadratic-Fit Function", FontSize->14, FontWeight->"Bold", FontSlant->"Italic"], "\n\nLet's use the model to calculate the volume of lumber for each girth \ measurement in the original data set, and then calculate the residual errors \ and plot them." }], "Text", PageWidth->PaperWidth], Cell[BoxData[ RowBox[{"quadpredictedvalues", "=", RowBox[{"Table", "[", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"data", "[", RowBox[{"[", RowBox[{"i", ",", "1"}], "]"}], "]"}], ",", RowBox[{"y2", "[", RowBox[{"data", "[", RowBox[{"[", RowBox[{"i", ",", "1"}], "]"}], "]"}], "]"}]}], "}"}], ",", RowBox[{"{", RowBox[{"i", ",", "1", ",", RowBox[{"Length", "[", "data", "]"}]}], "}"}]}], "]"}]}]], "Input", PageWidth->PaperWidth], Cell[BoxData[ RowBox[{"quadresiduals", "=", RowBox[{"Table", "[", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"data", "[", RowBox[{"[", RowBox[{"i", ",", "1"}], "]"}], "]"}], ",", RowBox[{ RowBox[{"data", "[", RowBox[{"[", RowBox[{"i", ",", "2"}], "]"}], "]"}], "-", RowBox[{"quadpredictedvalues", "[", RowBox[{"[", RowBox[{"i", ",", "2"}], "]"}], "]"}]}]}], "}"}], ",", RowBox[{"{", RowBox[{"i", ",", "1", ",", "10"}], "}"}]}], "]"}]}]], "Input", PageWidth->PaperWidth], Cell[BoxData[ RowBox[{"ListPlot", "[", RowBox[{"quadresiduals", ",", RowBox[{"PlotStyle", "\[Rule]", RowBox[{"{", RowBox[{ RowBox[{"PointSize", "[", "0.023`", "]"}], ",", RowBox[{"RGBColor", "[", RowBox[{"0", ",", "0", ",", "1"}], "]"}]}], "}"}]}], ",", RowBox[{"AxesLabel", "\[Rule]", RowBox[{"{", RowBox[{"\"\\"", ",", "\"\\""}], "}"}]}], ",", RowBox[{"AxesOrigin", "\[Rule]", RowBox[{"{", RowBox[{"16.5`", ",", "0"}], "}"}]}]}], "]"}]], "Input", PageWidth->PaperWidth], Cell["\<\ Note that the errors aren't completely random. There are more negative errors \ than there are positive ones, and the error seems to increase as the girth \ increases. These observations suggest that the quadratic function is not \ appropriate for modeling the relation between the volume of usable lumber in \ a tree and its girth.\ \>", "Text", PageWidth->PaperWidth], Cell["\<\ It is usually more helpful to look at the error in relation to the size of \ the quantity being estimated. We calculate the relative percent errors as \ follows.\ \>", "Text", PageWidth->PaperWidth], Cell[BoxData[ RowBox[{"quadpercenterrors", "=", RowBox[{"Table", "[", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"data", "[", RowBox[{"[", RowBox[{"i", ",", "1"}], "]"}], "]"}], ",", RowBox[{ RowBox[{ RowBox[{"(", RowBox[{ RowBox[{"data", "[", RowBox[{"[", RowBox[{"i", ",", "2"}], "]"}], "]"}], "-", RowBox[{"quadpredictedvalues", "[", RowBox[{"[", RowBox[{"i", ",", "2"}], "]"}], "]"}]}], ")"}], "/", RowBox[{"data", "[", RowBox[{"[", RowBox[{"i", ",", "2"}], "]"}], "]"}]}], "*", "100"}]}], "}"}], ",", RowBox[{"{", RowBox[{"i", ",", "1", ",", "10"}], "}"}]}], "]"}]}]], "Input", PageWidth->PaperWidth], Cell["\<\ Now we plot the percent errors and save the graph for a later comparison with \ the percent errors for the cubic function.\ \>", "Text", PageWidth->PaperWidth], Cell[BoxData[ RowBox[{"p3", "=", RowBox[{"ListPlot", "[", RowBox[{"quadpercenterrors", ",", RowBox[{"PlotStyle", "\[Rule]", RowBox[{"{", RowBox[{ RowBox[{"PointSize", "[", "0.023`", "]"}], ",", RowBox[{"RGBColor", "[", RowBox[{"1", ",", "0", ",", "0"}], "]"}]}], "}"}]}], ",", RowBox[{"AxesLabel", "\[Rule]", RowBox[{"{", RowBox[{"\"\\"", ",", "\"\<% error\>\""}], "}"}]}], ",", RowBox[{"AxesOrigin", "\[Rule]", RowBox[{"{", RowBox[{"16.5`", ",", "0"}], "}"}]}]}], "]"}]}]], "Input", PageWidth->PaperWidth], Cell[TextData[{ "The percent error of largest magnitude is about ", Cell[BoxData[ FormBox[ RowBox[{ RowBox[{"-", "140"}], "%"}], TraditionalForm]]], ", and there is a trend in the errors, indicating that they are not random.\n\ \nLet's look at the errors for the cubic model.\n\n\n", StyleBox["Analysis of the Errors for the Cubic", FontSize->14, FontWeight->"Bold", FontSlant->"Italic"], StyleBox["-", FontSize->14, FontSlant->"Italic"], StyleBox["Fit Function", FontSize->14, FontWeight->"Bold", FontSlant->"Italic"], "\n\nWe do the same as we did for the quadratic function." }], "Text", PageWidth->PaperWidth], Cell[BoxData[ RowBox[{"cubicpredictedvalues", "=", RowBox[{"Table", "[", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"data", "[", RowBox[{"[", RowBox[{"i", ",", "1"}], "]"}], "]"}], ",", RowBox[{"y3", "[", RowBox[{"data", "[", RowBox[{"[", RowBox[{"i", ",", "1"}], "]"}], "]"}], "]"}]}], "}"}], ",", RowBox[{"{", RowBox[{"i", ",", "1", ",", "10"}], "}"}]}], "]"}]}]], "Input", PageWidth->PaperWidth], Cell[BoxData[ RowBox[{"cubicresiduals", "=", RowBox[{"Table", "[", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"data", "[", RowBox[{"[", RowBox[{"i", ",", "1"}], "]"}], "]"}], ",", RowBox[{ RowBox[{"data", "[", RowBox[{"[", RowBox[{"i", ",", "2"}], "]"}], "]"}], "-", RowBox[{"cubicpredictedvalues", "[", RowBox[{"[", RowBox[{"i", ",", "2"}], "]"}], "]"}]}]}], "}"}], ",", RowBox[{"{", RowBox[{"i", ",", "1", ",", "10"}], "}"}]}], "]"}]}]], "Input", PageWidth->PaperWidth], Cell[BoxData[ RowBox[{"ListPlot", "[", RowBox[{"cubicresiduals", ",", RowBox[{"PlotStyle", "\[Rule]", RowBox[{"{", RowBox[{ RowBox[{"PointSize", "[", "0.023`", "]"}], ",", RowBox[{"RGBColor", "[", RowBox[{"0", ",", "0", ",", "1"}], "]"}]}], "}"}]}], ",", RowBox[{"AxesLabel", "\[Rule]", RowBox[{"{", RowBox[{"\"\\"", ",", "\"\\""}], "}"}]}], ",", RowBox[{"AxesOrigin", "\[Rule]", RowBox[{"{", RowBox[{"16.5`", ",", "0"}], "}"}]}]}], "]"}]], "Input", PageWidth->PaperWidth], Cell["\<\ Note that the residuals exhibit a more random pattern than they did in the \ quadratic model. There are as many negative errors as positive ones, and \ there is no apparent trend in the errors.\ \>", "Text", PageWidth->PaperWidth], Cell[BoxData[ RowBox[{"cubicpercenterrors", "=", RowBox[{"Table", "[", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"data", "[", RowBox[{"[", RowBox[{"i", ",", "1"}], "]"}], "]"}], ",", RowBox[{ RowBox[{ RowBox[{"(", RowBox[{ RowBox[{"data", "[", RowBox[{"[", RowBox[{"i", ",", "2"}], "]"}], "]"}], "-", RowBox[{"cubicpredictedvalues", "[", RowBox[{"[", RowBox[{"i", ",", "2"}], "]"}], "]"}]}], ")"}], "/", RowBox[{"data", "[", RowBox[{"[", RowBox[{"i", ",", "2"}], "]"}], "]"}]}], "*", "100"}]}], "}"}], ",", RowBox[{"{", RowBox[{"i", ",", "1", ",", "10"}], "}"}]}], "]"}]}]], "Input", PageWidth->PaperWidth], Cell[BoxData[ RowBox[{"p4", "=", RowBox[{"ListPlot", "[", RowBox[{"cubicpercenterrors", ",", RowBox[{"PlotStyle", "\[Rule]", RowBox[{"{", RowBox[{ RowBox[{"PointSize", "[", "0.023`", "]"}], ",", RowBox[{"RGBColor", "[", RowBox[{"0", ",", "0", ",", "1"}], "]"}]}], "}"}]}], ",", RowBox[{"AxesLabel", "\[Rule]", RowBox[{"{", RowBox[{"\"\\"", ",", "\"\<% error\>\""}], "}"}]}], ",", RowBox[{"AxesOrigin", "\[Rule]", RowBox[{"{", RowBox[{"16.5`", ",", "0"}], "}"}]}]}], "]"}]}]], "Input", PageWidth->PaperWidth], Cell[TextData[{ "In this case, the percent error of largest magnitude is about ", Cell[BoxData[ FormBox[ RowBox[{ RowBox[{"-", "20"}], "%"}], TraditionalForm]]], ", which is much better than for the quadratic regression function.\n\n\n", StyleBox["Compare the Errors", FontSize->14, FontWeight->"Bold", FontSlant->"Italic"] }], "Text", PageWidth->PaperWidth], Cell["\<\ To confirm our earlier assessment that the cubic regression is evidently \ better, we now plot the percent errors for the two models together. The \ errors associated with the cubic are in blue, those associated with the \ squared model are in red.\ \>", "Text", PageWidth->PaperWidth, CellChangeTimes->{{3.44907898884375*^9, 3.449079064859375*^9}}], Cell[BoxData[ RowBox[{"Show", "[", RowBox[{"p4", ",", "p3"}], "]"}]], "Input", PageWidth->PaperWidth] }, Closed]], Cell[CellGroupData[{ Cell["Explaining the Model", "Subsubsection", PageWidth->PaperWidth], Cell[TextData[{ "The unit of board feet is a measure of volume. If a tree is modeled as a \ right circular cone, its volume is approximated by ", StyleBox["V", FontSlant->"Italic"], " = ", Cell[BoxData[ FormBox[ RowBox[{ FractionBox["1", "3"], SuperscriptBox["\[Pi]r", "2"]}], TraditionalForm]]], StyleBox["h", FontSlant->"Italic"], ", where ", StyleBox["V", FontSlant->"Italic"], " is the volume, ", StyleBox["h", FontSlant->"Italic"], " is the height of the tree, and ", StyleBox["r", FontSlant->"Italic"], " is its radius. The girth, ", StyleBox["g", FontSlant->"Italic"], ", is the circumference of the tree near the base so that ", StyleBox["g", FontSlant->"Italic"], " = 2\[Pi]", StyleBox["r", FontSlant->"Italic"], " or ", StyleBox["r", FontSlant->"Italic"], " = ", Cell[BoxData[ FormBox[ FractionBox["g", RowBox[{"2", "\[Pi]"}]], TraditionalForm]]], ". If we assume that as a tree grows the proportion ", Cell[BoxData[ FormBox[ RowBox[{ FractionBox["h", "r"], "=", "k"}], TraditionalForm]]], " is a constant, then we have that ", StyleBox["V = ", FontSlant->"Italic"], Cell[BoxData[ FormBox[ RowBox[{ RowBox[{ FractionBox["\[Pi]", "3"], SuperscriptBox[ RowBox[{"(", FractionBox["g", RowBox[{"2", "\[Pi]"}]], ")"}], "2"], RowBox[{"(", FractionBox["kg", RowBox[{"2", "\[Pi]"}]], ")"}]}], "=", RowBox[{ RowBox[{"(", FractionBox["k", RowBox[{"24", SuperscriptBox["\[Pi]", "2"]}]], ")"}], SuperscriptBox["g", "3"]}]}], TraditionalForm]]], ", where the last quantity in parentheses is a constant. This shows that \ cubic relation between the volume of lumber produced and the girth of the \ tree near its base is a rational model.\n" }], "Text", PageWidth->PaperWidth] }, Closed]] }, Closed]], Cell[CellGroupData[{ Cell["Black Bass", "Subsection", PageWidth->PaperWidth], Cell[CellGroupData[{ Cell["Observing the Data", "Subsubsection", PageWidth->PaperWidth], Cell[TextData[{ "In the table that follows, ", StyleBox["L", FontSlant->"Italic"], " represents the lengths of New York black bass measured in inches, and ", StyleBox["w", FontSlant->"Italic"], " represents the weight of the fish. Formulate and test a model that assumes \ the weight of the fish is proportional to the cube of its length. Can you \ provide a rational explanation of the model?" }], "Text", PageWidth->PaperWidth], Cell[BoxData[{ RowBox[{ RowBox[{"data", "=", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"12.5", ",", "17"}], "}"}], ",", RowBox[{"{", RowBox[{"12.63", ",", "16"}], "}"}], ",", RowBox[{"{", RowBox[{"14.13", ",", "17"}], "}"}], ",", RowBox[{"{", RowBox[{"14.5", ",", "23"}], "}"}], ",", RowBox[{"{", RowBox[{"14.5", ",", "26"}], "}"}], ",", RowBox[{"{", RowBox[{"14.5", ",", "27"}], "}"}], ",", RowBox[{"{", RowBox[{"17.25", ",", "41"}], "}"}], ",", RowBox[{"{", RowBox[{"17.75", ",", "49"}], "}"}]}], "}"}]}], ";"}], "\n", RowBox[{"TableForm", "[", RowBox[{"data", ",", RowBox[{"TableDirections", "\[Rule]", RowBox[{"{", RowBox[{"Row", ",", "Column"}], "}"}]}], ",", RowBox[{"TableHeadings", "\[Rule]", RowBox[{"{", RowBox[{ RowBox[{"{", "}"}], ",", RowBox[{"{", RowBox[{"\"\\"", ",", "\"\\""}], "}"}]}], "}"}]}]}], "]"}]}], "Input", PageWidth->PaperWidth], Cell["\<\ Next, we plot the data to see if there is a recognizable pattern.\ \>", "Text", PageWidth->PaperWidth], Cell[BoxData[{ RowBox[{ RowBox[{"xlabel", "=", "\"\\""}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"ylabel", "=", "\"\\""}], ";"}], "\[IndentingNewLine]", RowBox[{"p1", "=", RowBox[{"ListPlot", "[", RowBox[{"data", ",", RowBox[{"PlotRange", "\[Rule]", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"0", ",", "20"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "50"}], "}"}]}], "}"}]}], ",", RowBox[{"PlotStyle", "\[Rule]", RowBox[{"{", RowBox[{ RowBox[{"PointSize", "[", "0.02`", "]"}], ",", RowBox[{"RGBColor", "[", RowBox[{"1", ",", "0", ",", "0"}], "]"}]}], "}"}]}], ",", RowBox[{"AxesLabel", "\[Rule]", RowBox[{"{", RowBox[{"xlabel", ",", "ylabel"}], "}"}]}]}], "]"}]}]}], "Input", PageWidth->PaperWidth] }, Closed]], Cell[CellGroupData[{ Cell["Designing a Model", "Subsubsection", PageWidth->PaperWidth], Cell[TextData[{ "We are asked to construct a cubic model, so now we find the best-fit \ function using the", StyleBox[" Fit[ ] ", FontWeight->"Bold"], "command." }], "Text", PageWidth->PaperWidth], Cell[BoxData[{ RowBox[{ RowBox[{"Clear", "[", "y", "]"}], ";"}], "\n", RowBox[{ RowBox[{"y", "[", "x_", "]"}], "=", RowBox[{"Fit", "[", RowBox[{"data", ",", RowBox[{"{", RowBox[{"x", "^", "3"}], "}"}], ",", "x"}], "]"}]}]}], "Input", PageWidth->PaperWidth], Cell["\<\ Next, we plot the model function and superimpose its graph on the graph of \ the data.\ \>", "Text", PageWidth->PaperWidth], Cell[BoxData[ RowBox[{"p2", "=", RowBox[{"Plot", "[", RowBox[{ RowBox[{"y", "[", "x", "]"}], ",", RowBox[{"{", RowBox[{"x", ",", "0", ",", "20"}], "}"}], ",", RowBox[{"PlotStyle", "\[Rule]", RowBox[{"{", RowBox[{"RGBColor", "[", RowBox[{"0", ",", "0", ",", "1"}], "]"}], "}"}]}], ",", RowBox[{"AxesLabel", "\[Rule]", RowBox[{"{", RowBox[{"xlabel", ",", "ylabel"}], "}"}]}]}], "]"}]}]], "Input", PageWidth->PaperWidth], Cell[BoxData[ RowBox[{"Show", "[", RowBox[{"p2", ",", "p1"}], "]"}]], "Input", PageWidth->PaperWidth], Cell["\<\ The graphs show that the cubic model fits the data fairly well. \ \>", "Text", PageWidth->PaperWidth, CellChangeTimes->{{3.449079097859375*^9, 3.44907909928125*^9}}] }, Closed]], Cell[CellGroupData[{ Cell["Assessing the Errors", "Subsubsection", PageWidth->PaperWidth], Cell["\<\ Now we analyze the fit by calculating the percent errors. First, we use the \ model to calculate the weight of the fish for each length measurement in the \ original data set, and then we calculate the residuals and plot them.\ \>", "Text", PageWidth->PaperWidth], Cell[BoxData[ RowBox[{"predictedvalues", "=", RowBox[{"Table", "[", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"data", "[", RowBox[{"[", RowBox[{"i", ",", "1"}], "]"}], "]"}], ",", RowBox[{"y", "[", RowBox[{"data", "[", RowBox[{"[", RowBox[{"i", ",", "1"}], "]"}], "]"}], "]"}]}], "}"}], ",", RowBox[{"{", RowBox[{"i", ",", "1", ",", RowBox[{"Length", "[", "data", "]"}]}], "}"}]}], "]"}]}]], "Input", PageWidth->PaperWidth], Cell[BoxData[ RowBox[{"residuals", "=", RowBox[{"Table", "[", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"data", "[", RowBox[{"[", RowBox[{"i", ",", "1"}], "]"}], "]"}], ",", RowBox[{ RowBox[{"data", "[", RowBox[{"[", RowBox[{"i", ",", "2"}], "]"}], "]"}], "-", RowBox[{"predictedvalues", "[", RowBox[{"[", RowBox[{"i", ",", "2"}], "]"}], "]"}]}]}], "}"}], ",", RowBox[{"{", RowBox[{"i", ",", "1", ",", RowBox[{"Length", "[", "data", "]"}]}], "}"}]}], "]"}]}]], "Input", PageWidth->PaperWidth], Cell[BoxData[ RowBox[{"ListPlot", "[", RowBox[{"residuals", ",", RowBox[{"PlotStyle", "\[Rule]", RowBox[{"{", RowBox[{ RowBox[{"PointSize", "[", "0.02`", "]"}], ",", RowBox[{"RGBColor", "[", RowBox[{"0", ",", "0", ",", "1"}], "]"}]}], "}"}]}], ",", RowBox[{"AxesLabel", "\[Rule]", RowBox[{"{", RowBox[{"\"\\"", ",", "\"\\""}], "}"}]}], ",", RowBox[{"AxesOrigin", "\[Rule]", RowBox[{"{", RowBox[{"12.5`", ",", "0"}], "}"}]}]}], "]"}]], "Input", PageWidth->PaperWidth], Cell["\<\ Note that there are nearly equal numbers of positive and negative errors, and \ there is no apparent trend in the errors. They appear to be random. As before, it is more meaningful to look at the error in relation to the size \ of the quantity being estimated, so we calculate the relative percent errors \ and plot them.\ \>", "Text", PageWidth->PaperWidth], Cell[BoxData[ RowBox[{"percenterrors", "=", RowBox[{"Table", "[", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"data", "[", RowBox[{"[", RowBox[{"i", ",", "1"}], "]"}], "]"}], ",", RowBox[{ RowBox[{ RowBox[{"(", RowBox[{ RowBox[{"data", "[", RowBox[{"[", RowBox[{"i", ",", "2"}], "]"}], "]"}], "-", RowBox[{"predictedvalues", "[", RowBox[{"[", RowBox[{"i", ",", "2"}], "]"}], "]"}]}], ")"}], "/", RowBox[{"data", "[", RowBox[{"[", RowBox[{"i", ",", "2"}], "]"}], "]"}]}], "*", "100"}]}], "}"}], ",", RowBox[{"{", RowBox[{"i", ",", "1", ",", RowBox[{"Length", "[", "data", "]"}]}], "}"}]}], "]"}]}]], "Input", PageWidth->PaperWidth], Cell[BoxData[ RowBox[{"p3", "=", RowBox[{"ListPlot", "[", RowBox[{"percenterrors", ",", RowBox[{"PlotStyle", "\[Rule]", RowBox[{"{", RowBox[{ RowBox[{"PointSize", "[", "0.02`", "]"}], ",", RowBox[{"RGBColor", "[", RowBox[{"1", ",", "0", ",", "0"}], "]"}]}], "}"}]}], ",", RowBox[{"AxesLabel", "\[Rule]", RowBox[{"{", RowBox[{"\"\\"", ",", "\"\<% error\>\""}], "}"}]}], ",", RowBox[{"AxesOrigin", "\[Rule]", RowBox[{"{", RowBox[{"12.5`", ",", "0"}], "}"}]}]}], "]"}]}]], "Input", PageWidth->PaperWidth] }, Closed]], Cell[CellGroupData[{ Cell["Improving the Model", "Subsubsection", PageWidth->PaperWidth], Cell[TextData[{ "The largest percent error about ", Cell[BoxData[ FormBox[ RowBox[{ RowBox[{"-", "36"}], "%"}], TraditionalForm]]], ", but this data point seems to be an outlier. Let's see what happens if we \ remove this point from the data set." }], "Text", PageWidth->PaperWidth], Cell[BoxData[{ RowBox[{ RowBox[{"data", "=", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"12.5`", ",", "17"}], "}"}], ",", RowBox[{"{", RowBox[{"12.63`", ",", "16"}], "}"}], ",", RowBox[{"{", RowBox[{"14.13`", ",", "17"}], "}"}], ",", RowBox[{"{", RowBox[{"14.5`", ",", "23"}], "}"}], ",", RowBox[{"{", RowBox[{"14.5`", ",", "26"}], "}"}], ",", RowBox[{"{", RowBox[{"14.5`", ",", "27"}], "}"}], ",", RowBox[{"{", RowBox[{"17.25`", ",", "41"}], "}"}], ",", RowBox[{"{", RowBox[{"17.75`", ",", "49"}], "}"}]}], "}"}]}], ";"}], "\[IndentingNewLine]", RowBox[{"data", "=", RowBox[{"Delete", "[", RowBox[{"data", ",", "3"}], "]"}]}], "\[IndentingNewLine]", RowBox[{"p1", "=", RowBox[{"ListPlot", "[", RowBox[{"data", ",", RowBox[{"PlotRange", "\[Rule]", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"0", ",", "20"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "50"}], "}"}]}], "}"}]}], ",", RowBox[{"PlotStyle", "\[Rule]", RowBox[{"{", RowBox[{ RowBox[{"PointSize", "[", "0.02`", "]"}], ",", RowBox[{"RGBColor", "[", RowBox[{"1", ",", "0", ",", "0"}], "]"}]}], "}"}]}], ",", RowBox[{"AxesLabel", "\[Rule]", RowBox[{"{", RowBox[{"xlabel", ",", "ylabel"}], "}"}]}]}], "]"}]}], "\[IndentingNewLine]", RowBox[{ RowBox[{"Clear", "[", "y", "]"}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"y", "[", "x_", "]"}], "=", RowBox[{"Fit", "[", RowBox[{"data", ",", RowBox[{"{", SuperscriptBox["x", "3"], "}"}], ",", "x"}], "]"}]}], "\[IndentingNewLine]", RowBox[{"p2", "=", RowBox[{"Plot", "[", RowBox[{ RowBox[{"y", "[", "x", "]"}], ",", RowBox[{"{", RowBox[{"x", ",", "0", ",", "20"}], "}"}], ",", RowBox[{"PlotStyle", "\[Rule]", RowBox[{"{", RowBox[{"RGBColor", "[", RowBox[{"0", ",", "0", ",", "1"}], "]"}], "}"}]}], ",", RowBox[{"AxesLabel", "\[Rule]", RowBox[{"{", RowBox[{"xlabel", ",", "ylabel"}], "}"}]}]}], "]"}]}], "\[IndentingNewLine]", RowBox[{"Show", "[", RowBox[{"p2", ",", "p1"}], "]"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"predictedvalues", "=", RowBox[{"Table", "[", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"data", "\[LeftDoubleBracket]", RowBox[{"i", ",", "1"}], "\[RightDoubleBracket]"}], ",", RowBox[{"y", "[", RowBox[{"data", "\[LeftDoubleBracket]", RowBox[{"i", ",", "1"}], "\[RightDoubleBracket]"}], "]"}]}], "}"}], ",", RowBox[{"{", RowBox[{"i", ",", "1", ",", RowBox[{"Length", "[", "data", "]"}]}], "}"}]}], "]"}]}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"residuals", "=", RowBox[{"Table", "[", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"data", "\[LeftDoubleBracket]", RowBox[{"i", ",", "1"}], "\[RightDoubleBracket]"}], ",", RowBox[{ RowBox[{"data", "\[LeftDoubleBracket]", RowBox[{"i", ",", "2"}], "\[RightDoubleBracket]"}], "-", RowBox[{"predictedvalues", "\[LeftDoubleBracket]", RowBox[{"i", ",", "2"}], "\[RightDoubleBracket]"}]}]}], "}"}], ",", RowBox[{"{", RowBox[{"i", ",", "1", ",", RowBox[{"Length", "[", "data", "]"}]}], "}"}]}], "]"}]}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"percenterrors", "=", RowBox[{"Table", "[", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"data", "\[LeftDoubleBracket]", RowBox[{"i", ",", "1"}], "\[RightDoubleBracket]"}], ",", RowBox[{ RowBox[{"(", RowBox[{ RowBox[{"(", RowBox[{ RowBox[{"data", "\[LeftDoubleBracket]", RowBox[{"i", ",", "2"}], "\[RightDoubleBracket]"}], "-", RowBox[{"predictedvalues", "\[LeftDoubleBracket]", RowBox[{"i", ",", "2"}], "\[RightDoubleBracket]"}]}], ")"}], " ", "100"}], ")"}], "/", RowBox[{"data", "\[LeftDoubleBracket]", RowBox[{"i", ",", "2"}], "\[RightDoubleBracket]"}]}]}], "}"}], ",", RowBox[{"{", RowBox[{"i", ",", "1", ",", RowBox[{"Length", "[", "data", "]"}]}], "}"}]}], "]"}]}], ";"}], "\[IndentingNewLine]", RowBox[{"TableForm", "[", RowBox[{"percenterrors", ",", RowBox[{"TableDirections", "\[Rule]", RowBox[{"{", RowBox[{"Row", ",", "Column"}], "}"}]}], ",", RowBox[{"TableHeadings", "\[Rule]", RowBox[{"{", RowBox[{"None", ",", RowBox[{"{", RowBox[{"\"\\"", ",", "\"\<% error\>\""}], "}"}]}], "}"}]}]}], "]"}], "\[IndentingNewLine]", RowBox[{"p3", "=", RowBox[{"ListPlot", "[", RowBox[{"percenterrors", ",", RowBox[{"PlotStyle", "\[Rule]", RowBox[{"{", RowBox[{ RowBox[{"PointSize", "[", "0.02`", "]"}], ",", RowBox[{"RGBColor", "[", RowBox[{"1", ",", "0", ",", "0"}], "]"}]}], "}"}]}], ",", RowBox[{"AxesOrigin", "\[Rule]", RowBox[{"{", RowBox[{"12.5`", ",", "0"}], "}"}]}], ",", RowBox[{"AxesLabel", "\[Rule]", RowBox[{"{", RowBox[{"\"\\"", ",", "\"\<% error\>\""}], "}"}]}]}], "]"}]}]}], "Input", PageWidth->PaperWidth, CellChangeTimes->{{3.449234294078125*^9, 3.449234354828125*^9}}], Cell[TextData[{ "After deleting the one data point, we find that the new model gives a \ largest percent error of about ", Cell[BoxData[ FormBox[ RowBox[{ RowBox[{"-", "11"}], "%"}], TraditionalForm]]], ", which is considerably better." }], "Text", PageWidth->PaperWidth] }, Closed]], Cell[CellGroupData[{ Cell["Explaining the Model", "Subsubsection", PageWidth->PaperWidth], Cell[TextData[{ "The weight of a fish is proportional to its volume. If we think of a fish \ to be shaped roughly like an ellipsoid, then its volume would be approximated \ by ", StyleBox["V=", FontSlant->"Italic"], Cell[BoxData[ FormBox[ RowBox[{ FractionBox["4", "3"], StyleBox[ RowBox[{"\[Pi]", StyleBox["lwd", FontSlant->"Italic"]}]]}], TraditionalForm]]], " where ", StyleBox["L, w, ", FontSlant->"Italic"], "and", StyleBox[" d ", FontSlant->"Italic"], "are its length, width, and depth, respectively. If, as the fish grows, we \ assume that its proportions remain the same then ", StyleBox["w=", FontSlant->"Italic"], Cell[BoxData[ FormBox[ RowBox[{ SubscriptBox["k", "w"], "L"}], TraditionalForm]]], " and ", StyleBox["d=", FontSlant->"Italic"], Cell[BoxData[ FormBox[ RowBox[{ SubscriptBox["k", "d"], "L"}], TraditionalForm]]], ", where ", Cell[BoxData[ FormBox[ SubscriptBox["k", "w"], TraditionalForm]]], " and ", Cell[BoxData[ FormBox[ SubscriptBox["k", "d"], TraditionalForm]]], " are constants. Therefore, ", StyleBox["V=", FontSlant->"Italic"], Cell[BoxData[ FormBox[ RowBox[{ RowBox[{ FractionBox["4", "3"], RowBox[{ StyleBox[ RowBox[{"\[Pi]", StyleBox["L", FontSlant->"Italic"]}]], StyleBox["(", FontSlant->"Italic"], StyleBox[ RowBox[{ SubscriptBox["k", "w"], "L"}], FontSlant->"Italic"], StyleBox[")", FontSlant->"Italic"]}], RowBox[{ StyleBox["(", FontSlant->"Italic"], RowBox[{ SubscriptBox["k", "d"], "L"}], ")"}]}], "=", RowBox[{ RowBox[{"(", FractionBox[ RowBox[{"4", SubscriptBox["k", "w"], SubscriptBox["k", "d"], "\[Pi]"}], "3"], ")"}], SuperscriptBox["L", "3"]}]}], TraditionalForm]]], " where the last quantity in parentheses is a constant. Therefore, the \ weight is proportional to the volume, which is proportional to the length \ cubed, and our model has a rational basis. " }], "Text", PageWidth->PaperWidth] }, Closed]] }, Closed]] }, Closed]], Cell[CellGroupData[{ Cell["You Try It: Modeling Takes Practice", "Section", PageWidth->PaperWidth], Cell[CellGroupData[{ Cell["Data Sets", "Subsection", PageWidth->PaperWidth], Cell["Drug Levels ", "Text", PageWidth->PaperWidth, FontSlant->"Italic"], Cell[BoxData[ RowBox[{"drugdata", "=", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"0", ",", "853"}], "}"}], ",", RowBox[{"{", RowBox[{"1", ",", "587"}], "}"}], ",", RowBox[{"{", RowBox[{"2", ",", "390"}], "}"}], ",", RowBox[{"{", RowBox[{"3", ",", "274"}], "}"}], ",", RowBox[{"{", RowBox[{"4", ",", "189"}], "}"}], ",", RowBox[{"{", RowBox[{"5", ",", "130"}], "}"}], ",", RowBox[{"{", RowBox[{"6", ",", "97"}], "}"}], ",", RowBox[{"{", RowBox[{"7", ",", "67"}], "}"}], ",", RowBox[{"{", RowBox[{"8", ",", "50"}], "}"}], ",", RowBox[{"{", RowBox[{"9", ",", "40"}], "}"}], ",", RowBox[{"{", RowBox[{"10", ",", "31"}], "}"}]}], "}"}]}]], "Input", PageWidth->PaperWidth], Cell["Cell Count ", "Text", PageWidth->PaperWidth, FontSlant->"Italic"], Cell[BoxData[ RowBox[{"celldata", "=", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"0", ",", "597"}], "}"}], ",", RowBox[{"{", RowBox[{"2", ",", "893"}], "}"}], ",", RowBox[{"{", RowBox[{"4", ",", "1339"}], "}"}], ",", RowBox[{"{", RowBox[{"6", ",", "1995"}], "}"}], ",", RowBox[{"{", RowBox[{"8", ",", "2976"}], "}"}], ",", RowBox[{"{", RowBox[{"10", ",", "4433"}], "}"}], ",", RowBox[{"{", RowBox[{"12", ",", "6612"}], "}"}], ",", RowBox[{"{", RowBox[{"14", ",", "9865"}], "}"}], ",", RowBox[{"{", RowBox[{"16", ",", "14719"}], "}"}], ",", RowBox[{"{", RowBox[{"18", ",", "21956"}], "}"}], ",", RowBox[{"{", RowBox[{"20", ",", "32763"}], "}"}]}], "}"}]}]], "Input", PageWidth->PaperWidth], Cell["Vacuum Pump ", "Text", PageWidth->PaperWidth, FontSlant->"Italic"], Cell[BoxData[ RowBox[{"vacuumdata", "=", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"0", ",", "100000"}], "}"}], ",", RowBox[{"{", RowBox[{"1", ",", "36788"}], "}"}], ",", RowBox[{"{", RowBox[{"2", ",", "13537"}], "}"}], ",", RowBox[{"{", RowBox[{"3", ",", "4986"}], "}"}], ",", RowBox[{"{", RowBox[{"4", ",", "1837"}], "}"}], ",", RowBox[{"{", RowBox[{"5", ",", "671"}], "}"}]}], "}"}]}]], "Input", PageWidth->PaperWidth], Cell[TextData[StyleBox["Doctoral Degrees ", FontSlant->"Italic"]], "Text", PageWidth->PaperWidth], Cell[BoxData[ RowBox[{"doctoraldata", "=", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"6", ",", "520"}], "}"}], ",", RowBox[{"{", RowBox[{"10", ",", "460"}], "}"}], ",", RowBox[{"{", RowBox[{"14", ",", "680"}], "}"}], ",", RowBox[{"{", RowBox[{"18", ",", "630"}], "}"}], ",", RowBox[{"{", RowBox[{"20", ",", "730"}], "}"}], ",", RowBox[{"{", RowBox[{"21", ",", "810"}], "}"}], ",", RowBox[{"{", RowBox[{"22", ",", "830"}], "}"}]}], "}"}]}]], "Input", PageWidth->PaperWidth] }, Closed]], Cell[CellGroupData[{ Cell["Instructions", "Subsection", PageWidth->PaperWidth], Cell[TextData[{ "Mathematical modeling and a computer algebra system like ", StyleBox["Mathematica", FontSlant->"Italic"], " help us describe real-world phenomena, understand the mechanisms behind \ the behavior, and make predictions. The procedure for modeling generally \ includes the following steps:\n\n\t1. Plot and observe the data, looking for \ relationships and patterns.\n\t2. Formulate a function to model the data.\n\t\ 3. Assess your model by analyzing the residual errors and/or relative errors.\ \n\t4. Improve your model, if possible.\n\t5. Use your model to gain a better \ understanding of the phenomenon you are modeling.\n\t6. Use your model to \ make predictions.\n\nWith some practice, you too can become an effective \ mathematical modeler. There are plenty of modeling exercises that you can do \ yourself. Select a problem and obtain some data (possibly by designing your \ own experiment) and use the modeling procedures outlined in the preceding \ Parts of this module as a template for mathematical modeling. To help you get \ started, we include the data sets for four modeling examples." }], "Text", PageWidth->PaperWidth] }, Closed]] }, Closed]], Cell[CellGroupData[{ Cell["Part IV: Heart Rates of Mammals", "Section", PageWidth->PaperWidth], Cell[CellGroupData[{ Cell["Observing the Data", "Subsubsection", PageWidth->PaperWidth], Cell[TextData[{ "The following data relate the weight in grams (g) of some mammals to their \ heart rate in beats per minute. Plot the data. Is there a trend? If so, find \ a function that captures the trend of the data. Hint: try the form ", StyleBox["y=", FontSlant->"Italic"], Cell[BoxData[ FormBox[ SuperscriptBox[ StyleBox["x", FontSlant->"Italic"], RowBox[{ RowBox[{"-", "1"}], "/", StyleBox["n", FontSlant->"Italic"]}]], TraditionalForm]]], " for ", StyleBox["n", FontSlant->"Italic"], " an integer." }], "Text", PageWidth->PaperWidth], Cell[BoxData[{ RowBox[{ RowBox[{"data", "=", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"4", ",", "660"}], "}"}], ",", RowBox[{"{", RowBox[{"25", ",", "670"}], "}"}], ",", RowBox[{"{", RowBox[{"200", ",", "420"}], "}"}], ",", RowBox[{"{", RowBox[{"300", ",", "300"}], "}"}], ",", RowBox[{"{", RowBox[{"2000", ",", "205"}], "}"}], ",", RowBox[{"{", RowBox[{"5000", ",", "120"}], "}"}], ",", RowBox[{"{", RowBox[{"30000", ",", "85"}], "}"}], ",", RowBox[{"{", RowBox[{"50000", ",", "70"}], "}"}], ",", RowBox[{"{", RowBox[{"70000", ",", "72"}], "}"}], ",", RowBox[{"{", RowBox[{"450000", ",", "38"}], "}"}], ",", RowBox[{"{", RowBox[{"500000", ",", "40"}], "}"}], ",", RowBox[{"{", RowBox[{"3000000", ",", "48"}], "}"}]}], "}"}]}], ";"}], "\n", RowBox[{"TableForm", "[", RowBox[{"data", ",", RowBox[{"TableDirections", "\[Rule]", RowBox[{"{", RowBox[{"Row", ",", "Column"}], "}"}]}], ",", RowBox[{"TableHeadings", "\[Rule]", RowBox[{"{", RowBox[{"None", ",", RowBox[{"{", RowBox[{"\"\\"", ",", "\"\\""}], "}"}]}], "}"}]}]}], "]"}]}], "Input", PageWidth->PaperWidth], Cell["\<\ Next, we plot the data to see if there is a recognizable pattern.\ \>", "Text", PageWidth->PaperWidth], Cell[BoxData[{ RowBox[{ RowBox[{"xlabel", "=", "\"\\""}], ";"}], "\n", RowBox[{ RowBox[{"ylabel", "=", "\"\\""}], ";"}], "\n", RowBox[{"p1", "=", RowBox[{"ListPlot", "[", RowBox[{"data", ",", RowBox[{"PlotRange", "\[Rule]", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"0", ",", "70000"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "700"}], "}"}]}], "}"}]}], ",", RowBox[{"PlotStyle", "\[Rule]", RowBox[{"{", RowBox[{ RowBox[{"PointSize", "[", "0.02`", "]"}], ",", RowBox[{"RGBColor", "[", RowBox[{"1", ",", "0", ",", "0"}], "]"}]}], "}"}]}], ",", RowBox[{"AxesLabel", "\[Rule]", RowBox[{"{", RowBox[{"xlabel", ",", "ylabel"}], "}"}]}], ",", RowBox[{"Ticks", "\[Rule]", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"10000", ",", "30000", ",", "50000", ",", "70000"}], "}"}], ",", "Automatic"}], "}"}]}]}], "]"}]}]}], "Input", PageWidth->PaperWidth], Cell["\<\ Note that we did not plot the data points for the horse, the ox, and the \ elephant because that makes the scale too large to see if there is a pattern \ for the smaller mammals; however, these data points are included in the \ calculations that follow.\ \>", "Text", PageWidth->PaperWidth] }, Closed]], Cell[CellGroupData[{ Cell["Designing a Model", "Subsubsection", PageWidth->PaperWidth], Cell[TextData[{ "The data suggest that there is a relationship. As suggested in the hint \ above, we now build a group of functions of the form ", StyleBox["y=", FontSlant->"Italic"], Cell[BoxData[ FormBox[ SuperscriptBox[ StyleBox["x", FontSlant->"Italic"], RowBox[{ RowBox[{"-", "1"}], "/", StyleBox["n", FontSlant->"Italic"]}]], TraditionalForm]]], " where ", StyleBox["n", FontSlant->"Italic"], " is an integer. For integer values of n (1, 2, 3, 4, 5), we use the ", StyleBox["Fit[ ]", FontWeight->"Bold"], " function to find the function of the form ", Cell[BoxData[ FormBox[ SuperscriptBox[ StyleBox["x", FontSlant->"Italic"], RowBox[{ RowBox[{"-", "1"}], "/", StyleBox["n", FontSlant->"Italic"]}]], TraditionalForm]]], " that best fits the data. (The next command does not display its results. \ We will look at the fit functions in the cells that follow it.)" }], "Text", PageWidth->PaperWidth], Cell[BoxData[{ RowBox[{ RowBox[{"Clear", "[", "y", "]"}], ";"}], "\n", RowBox[{"Do", "[", RowBox[{ RowBox[{ RowBox[{"y", "[", RowBox[{"x_", ",", "n"}], "]"}], "=", RowBox[{"Fit", "[", RowBox[{"data", ",", RowBox[{"{", RowBox[{"x", "^", RowBox[{"(", RowBox[{ RowBox[{"-", "1"}], "/", "n"}], ")"}]}], "}"}], ",", "x"}], "]"}]}], ",", RowBox[{"{", RowBox[{"n", ",", "1", ",", "5"}], "}"}]}], "]"}]}], "Input", PageWidth->PaperWidth], Cell[BoxData[ ButtonBox[ ButtonBox[ StyleBox[ RowBox[{ StyleBox["\[MathematicaIcon]", FontSize->18, FontVariations->{"CompatibilityType"->0}, FontColor->RGBColor[0.792981, 0.777356, 0.144533]], StyleBox[" ", FontSize->14, FontSlant->"Italic"], StyleBox["About", FontSize->14, FontColor->RGBColor[0.500008, 0, 0.500008]], StyleBox[" ", FontSize->14, FontSlant->"Italic"], StyleBox["Mathematica", FontSize->14, FontSlant->"Italic", FontColor->RGBColor[0.500008, 0, 0.500008]]}], FontWeight->"Bold"], BaseStyle->"Hyperlink"], BaseStyle->"Hyperlink", ButtonData:>"h10"]], "Input", PageWidth->PaperWidth, Evaluatable->False, CellTags->"h10b"], Cell["\<\ Now we look at each function by typing the symbol name representing each one \ in turn, and then we graph them.\ \>", "Text", PageWidth->PaperWidth], Cell[BoxData[ RowBox[{"y", "[", RowBox[{"x", ",", "1"}], "]"}]], "Input", PageWidth->PaperWidth], Cell[BoxData[ RowBox[{"y", "[", RowBox[{"x", ",", "2"}], "]"}]], "Input", PageWidth->PaperWidth], Cell[BoxData[ RowBox[{"y", "[", RowBox[{"x", ",", "3"}], "]"}]], "Input", PageWidth->PaperWidth], Cell[BoxData[ RowBox[{"y", "[", RowBox[{"x", ",", "4"}], "]"}]], "Input", PageWidth->PaperWidth], Cell[BoxData[ RowBox[{"y", "[", RowBox[{"x", ",", "5"}], "]"}]], "Input", PageWidth->PaperWidth], Cell[BoxData[ ButtonBox[ ButtonBox[ StyleBox[ RowBox[{ StyleBox["\[MathematicaIcon]", FontSize->18, FontVariations->{"CompatibilityType"->0}, FontColor->RGBColor[0.792981, 0.777356, 0.144533]], StyleBox[" ", FontSize->14, FontSlant->"Italic"], StyleBox["About", FontSize->14, FontColor->RGBColor[0.500008, 0, 0.500008]], StyleBox[" ", FontSize->14, FontSlant->"Italic"], StyleBox["Mathematica", FontSize->14, FontSlant->"Italic", FontColor->RGBColor[0.500008, 0, 0.500008]]}], FontWeight->"Bold"], BaseStyle->"Hyperlink"], BaseStyle->"Hyperlink", ButtonData:>"h11"]], "Input", PageWidth->PaperWidth, Evaluatable->False, CellTags->"h11b"], Cell[BoxData[ RowBox[{"p2", "=", RowBox[{"Plot", "[", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"y", "[", RowBox[{"x", ",", "1"}], "]"}], ",", RowBox[{"y", "[", RowBox[{"x", ",", "2"}], "]"}], ",", RowBox[{"y", "[", RowBox[{"x", ",", "3"}], "]"}], ",", RowBox[{"y", "[", RowBox[{"x", ",", "4"}], "]"}], ",", RowBox[{"y", "[", RowBox[{"x", ",", "5"}], "]"}]}], "}"}], ",", RowBox[{"{", RowBox[{"x", ",", "0", ",", "70000"}], "}"}], ",", RowBox[{"PlotRange", "\[Rule]", RowBox[{"{", RowBox[{ RowBox[{"-", "100"}], ",", "700"}], "}"}]}], ",", RowBox[{"PlotStyle", "\[Rule]", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"RGBColor", "[", RowBox[{"0", ",", "0", ",", "1"}], "]"}], "}"}], ",", RowBox[{"{", RowBox[{"RGBColor", "[", RowBox[{"1", ",", "0", ",", "1"}], "]"}], "}"}], ",", RowBox[{"{", RowBox[{"RGBColor", "[", RowBox[{"0", ",", "0", ",", "1"}], "]"}], "}"}], ",", RowBox[{"{", RowBox[{"RGBColor", "[", RowBox[{"1", ",", "0", ",", "1"}], "]"}], "}"}], ",", RowBox[{"{", RowBox[{"RGBColor", "[", RowBox[{"0", ",", "0", ",", "1"}], "]"}], "}"}], ",", RowBox[{"{", RowBox[{"RGBColor", "[", RowBox[{"1", ",", "0", ",", "1"}], "]"}], "}"}]}], "}"}]}], ",", RowBox[{"AxesLabel", "\[Rule]", RowBox[{"{", RowBox[{"xlabel", ",", "ylabel"}], "}"}]}], ",", RowBox[{"Ticks", "\[Rule]", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"10000", ",", "30000", ",", "50000", ",", "70000"}], "}"}], ",", "Automatic"}], "}"}]}]}], "]"}]}]], "Input", PageWidth->PaperWidth], Cell[BoxData[ RowBox[{"Show", "[", RowBox[{"p1", ",", "p2"}], "]"}]], "Input", PageWidth->PaperWidth] }, Closed]], Cell[CellGroupData[{ Cell["Assessing the Errors", "Subsubsection", PageWidth->PaperWidth], Cell[TextData[{ "It appears that ", StyleBox["y[x_, 4]", FontWeight->"Bold"], " provides the best fit. Now we will analyze the errors. First, we calculate \ the heart rate values that our selected model predicts for each mammal, and \ then we calculate the residual errors and plot them." }], "Text", PageWidth->PaperWidth], Cell[BoxData[ RowBox[{"predictedvalues", "=", RowBox[{"Table", "[", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"data", "[", RowBox[{"[", RowBox[{"i", ",", "1"}], "]"}], "]"}], ",", RowBox[{"y", "[", RowBox[{ RowBox[{"data", "[", RowBox[{"[", RowBox[{"i", ",", "1"}], "]"}], "]"}], ",", "4"}], "]"}]}], "}"}], ",", RowBox[{"{", RowBox[{"i", ",", "1", ",", RowBox[{"Length", "[", "data", "]"}]}], "}"}]}], "]"}]}]], "Input", PageWidth->PaperWidth], Cell[BoxData[ RowBox[{"residuals", "=", RowBox[{"Table", "[", RowBox[{ RowBox[{"{", RowBox[{"i", ",", RowBox[{ RowBox[{"data", "[", RowBox[{"[", RowBox[{"i", ",", "2"}], "]"}], "]"}], "-", RowBox[{"predictedvalues", "[", RowBox[{"[", RowBox[{"i", ",", "2"}], "]"}], "]"}]}]}], "}"}], ",", RowBox[{"{", RowBox[{"i", ",", "1", ",", RowBox[{"Length", "[", "data", "]"}]}], "}"}]}], "]"}]}]], "Input", PageWidth->PaperWidth], Cell[BoxData[ RowBox[{"ListPlot", "[", RowBox[{"residuals", ",", RowBox[{"PlotStyle", "\[Rule]", RowBox[{"{", RowBox[{ RowBox[{"PointSize", "[", "0.023`", "]"}], ",", RowBox[{"RGBColor", "[", RowBox[{"0", ",", "0", ",", "1"}], "]"}]}], "}"}]}], ",", RowBox[{"PlotRange", "\[Rule]", "All"}], ",", RowBox[{"AxesOrigin", "\[Rule]", RowBox[{"{", RowBox[{"1", ",", "0"}], "}"}]}], ",", RowBox[{"AxesLabel", "\[Rule]", RowBox[{"{", RowBox[{"\"\\"", ",", "\"\\""}], "}"}]}]}], "]"}]], "Input", PageWidth->PaperWidth], Cell["\<\ As before, it is helpful to look at the error in relation to the size of the \ quantity being estimated. We calculate the relative percent errors.\ \>", "Text", PageWidth->PaperWidth], Cell[BoxData[ RowBox[{"percenterrors", "=", RowBox[{"Table", "[", RowBox[{ RowBox[{"{", RowBox[{"i", ",", RowBox[{ RowBox[{ RowBox[{"(", RowBox[{ RowBox[{"data", "[", RowBox[{"[", RowBox[{"i", ",", "2"}], "]"}], "]"}], "-", RowBox[{"predictedvalues", "[", RowBox[{"[", RowBox[{"i", ",", "2"}], "]"}], "]"}]}], ")"}], "/", RowBox[{"data", "[", RowBox[{"[", RowBox[{"i", ",", "2"}], "]"}], "]"}]}], "*", "100"}]}], "}"}], ",", RowBox[{"{", RowBox[{"i", ",", "1", ",", RowBox[{"Length", "[", "data", "]"}]}], "}"}]}], "]"}]}]], "Input", PageWidth->PaperWidth], Cell[BoxData[ RowBox[{"ListPlot", "[", RowBox[{"percenterrors", ",", RowBox[{"PlotStyle", "\[Rule]", RowBox[{"{", RowBox[{ RowBox[{"PointSize", "[", "0.023`", "]"}], ",", RowBox[{"RGBColor", "[", RowBox[{"1", ",", "0", ",", "0"}], "]"}]}], "}"}]}], ",", RowBox[{"PlotRange", "\[Rule]", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"0", ",", "12"}], "}"}], ",", "All"}], "}"}]}], ",", RowBox[{"AxesLabel", "\[Rule]", RowBox[{"{", RowBox[{"\"\\"", ",", "\"\<%error\>\""}], "}"}]}]}], "]"}]], "Input", PageWidth->PaperWidth], Cell["\<\ The errors appear to be somewhat random, but there is possibly a trend in the \ errors, with two outliers. Can you see the trend and the outliers? The \ largest relative percentage errors are for the largest and the smallest \ animals (i.e., the bat and the elephant) with magnitudes of 23% and 42%, \ respectively. The model appears to capture a trend in the data, which could \ be useful in understanding the relationship between mammal size and heart \ rate; however, it probably would not be useful as a predictive tool since the \ magnitudes of the individual errors are so large. \ \>", "Text", PageWidth->PaperWidth] }, Closed]] }, Closed]], Cell[CellGroupData[{ Cell["You Try It: A Rational Explanation for Heart Rates", "Section", PageWidth->PaperWidth], Cell["\<\ Try to provide a rational explanation for the heart rate model that we found \ in Part IV.\ \>", "Text", PageWidth->PaperWidth] }, Closed]], Cell[CellGroupData[{ Cell[TextData[{ StyleBox["\[MathematicaIcon]", FontWeight->"Bold", FontVariations->{"CompatibilityType"->0}, FontColor->RGBColor[0.792981, 0.777356, 0.144533]], StyleBox[" ", FontWeight->"Bold", FontSlant->"Italic"], StyleBox["About", FontWeight->"Bold", FontColor->RGBColor[0.500008, 0, 0.500008]], StyleBox[" ", FontWeight->"Bold", FontSlant->"Italic"], StyleBox["Mathematica", FontWeight->"Bold", FontSlant->"Italic", FontColor->RGBColor[0.500008, 0, 0.500008]] }], "Section", PageWidth->PaperWidth, CellDingbat->None], Cell[TextData[{ "While ", StyleBox["TableForm[ ]", FontWeight->"Bold"], " presents the data in a more readable form, it is important to know that \ data sets in this form cannot be used in calculations. That is why we saved \ the data set as \"data\" in the first command, and then used ", StyleBox["TableForm[ ]", FontWeight->"Bold"], " to review my entries for accuracy (and possibly include in a formal \ report). To learn more about ", StyleBox["TableForm[ ]", FontWeight->"Bold"], " and lists in ", StyleBox["Mathematica", FontSlant->"Italic"], ",", " pull down the Help menu, select the Help Browser, and type ", StyleBox["TableForm", FontWeight->"Bold"], " or ", StyleBox["List", FontWeight->"Bold"], ". ", ButtonBox["Go Back.", BaseStyle->"Hyperlink", ButtonData:>"h1b"] }], "Text", PageWidth->PaperWidth, CellTags->"h1"], Cell[TextData[{ "The ", StyleBox["Fit[ ]", FontWeight->"Bold"], " command is very useful for mathematical modeling. It allows you to find \ regression functions of a variety of different forms. Here we use it to find \ the best-fit function of the form ", StyleBox["y", FontSlant->"Italic"], "=", StyleBox["ax,", FontSlant->"Italic"], " where ", StyleBox["a", FontSlant->"Italic"], " is a constant. You can learn more about the ", StyleBox["Fit[ ]", FontWeight->"Bold"], " function by going to the Help Browser and typing ", StyleBox["Fit", FontWeight->"Bold"], ". ", ButtonBox["Go Back.", BaseStyle->"Hyperlink", ButtonData:>"h2b"] }], "Text", PageWidth->PaperWidth, CellTags->"h2"], Cell[TextData[{ "Whenever we define a new function, like ", StyleBox["y[x_]", FontWeight->"Bold"], " in the preceding command, we usually clear all previous definitions of ", StyleBox["y", FontWeight->"Bold"], " with the ", StyleBox["Clear[ ]", FontWeight->"Bold"], " command. Sometimes you want ", StyleBox["Mathematica", FontSlant->"Italic"], " to remember previous definitions of a function, but many times you do not. \ Managing symbol definitions in ", StyleBox["Mathematica", FontSlant->"Italic"], " is very important, and mismanagement in this regard can lead to some very \ misleading and confusing results. You can learn more about defining symbols \ in ", StyleBox["Mathematica", FontSlant->"Italic"], " by referring to the \"Overview of ", StyleBox["Mathematica", FontSlant->"Italic"], ": Assignment Commands,\" included in this supplement, and you can go to the \ Help Browser and type ", StyleBox["Clear", FontWeight->"Bold"], ". ", ButtonBox["Go Back.", BaseStyle->"Hyperlink", ButtonData:>"h3b"] }], "Text", PageWidth->PaperWidth, CellTags->"h3"], Cell[TextData[{ "The ", StyleBox["Table[ ]", FontWeight->"Bold"], " command is used to create a list when a formula can be used to generate \ each of the elements in the list. In the preceding command, the elements of \ the list are ", StyleBox["{x, y[x]}", FontWeight->"Bold"], ". The formula for the first element in each ordered pair is simply ", StyleBox["x", FontWeight->"Bold"], ", and the formula for each second element is ", StyleBox["y[x_]=0.874732x", FontWeight->"Bold"], ". The second entry in the ", StyleBox["Table[ ]", FontWeight->"Bold"], " command (i.e., ", StyleBox["{x, 0, Length[data]}", FontWeight->"Bold"], ") specifies the set of values for ", StyleBox["x", FontWeight->"Bold"], ". In the example above, ", StyleBox["x ", FontWeight->"Bold"], "goes from ", StyleBox["0", FontWeight->"Bold"], " to ", StyleBox["Length[data]", FontWeight->"Bold"], " in increments of 1. To learn more about the ", StyleBox["Table[ ] ", FontWeight->"Bold"], "command, go to the Help Browser and type ", StyleBox["Table", FontWeight->"Bold"], ". ", ButtonBox["Go Back.", BaseStyle->"Hyperlink", ButtonData:>"h4b"] }], "Text", PageWidth->PaperWidth, CellTags->"h4"], Cell[TextData[{ "In the preceding command, we use the double square brackets, e.g., ", StyleBox["[[ i, 2 ]]", FontWeight->"Bold"], ", to extract elements or parts from the list called data. In this example, \ the first entry inside the double square brackets is ", StyleBox["i", FontWeight->"Bold"], ", which specifies which ordered pair we want from the list, and the second \ entry is ", StyleBox["2", FontWeight->"Bold"], ", which specifies which of the two elements to extract from the ", Cell[BoxData[ FormBox[ SuperscriptBox["i", "th"], TraditionalForm]]], " ordered pair. The first element of a list is designated by the number 1, \ not 0, which is why we let the index ", StyleBox["i", FontWeight->"Bold"], " vary from ", StyleBox["1", FontWeight->"Bold"], " to ", StyleBox["Length[data]", FontWeight->"Bold"], " and calculated ", StyleBox["x", FontWeight->"Bold"], " using the formula ", Cell[BoxData[ FormBox[ StyleBox[ RowBox[{ StyleBox["i", FontSlant->"Plain"], "-", "1"}], FontWeight->"Bold"], TraditionalForm]]], ". To learn more about the use of double square brackets, go to the Help \ Browser and type ", StyleBox["Part", FontWeight->"Bold"], ". ", ButtonBox["Go Back.", BaseStyle->"Hyperlink", ButtonData:>"h5b"] }], "Text", PageWidth->PaperWidth, CellTags->"h5"], Cell[TextData[{ "The semicolon after a ", StyleBox["Mathematica", FontSlant->"Italic"], " command suppresses the output. In the preceding command cell, we grouped \ the data list command and the ", StyleBox["TableForm[ ]", FontWeight->"Bold"], " command together in one cell with a semicolon after the definition of the \ data list and no semicolon after ", StyleBox["TableForm[ ]", FontWeight->"Bold"], ". This way the data table is displayed for easy reading and the data list \ is suppressed. If you remove the semicolon, both forms of the data are \ displayed. ", ButtonBox["Go Back.", BaseStyle->"Hyperlink", ButtonData:>"h6b"] }], "Text", PageWidth->PaperWidth, CellTags->"h6"], Cell[TextData[{ "You can include comments in a ", StyleBox["Mathematica", FontSlant->"Italic"], " command cell by enclosing the comment inside ", StyleBox["(* *)", FontWeight->"Bold"], " as in the preceding command. This can be useful for documenting your work, \ which is good programming practice. When ", StyleBox["Mathematica", FontSlant->"Italic"], " executes a command, it ignores everything enclosed by the ", StyleBox["(* *)", FontWeight->"Bold"], " markers. ", ButtonBox["Go Back.", BaseStyle->"Hyperlink", ButtonData:>"h7b"] }], "Text", PageWidth->PaperWidth, CellTags->"h7"], Cell[TextData[{ "Among other things, ", StyleBox["Mathematica", FontSlant->"Italic"], " is a programming language. When we group a series of commands together in \ a single cell, like the ones in the preceding cell, we are essentially \ writing a ", StyleBox["Mathematica", FontSlant->"Italic"], " program. You can give this group of commands a symbol name and use it like \ any other ", StyleBox["Mathematica", FontSlant->"Italic"], " command. You do this with the ", StyleBox["Block[ ]", FontWeight->"Bold"], " command or the ", StyleBox["Module[ ]", FontWeight->"Bold"], " command. To learn more about programming in ", StyleBox["Mathematica", FontSlant->"Italic"], ", see \"Overview of ", StyleBox["Mathematica", FontSlant->"Italic"], ": Making Your Own Commands,\" included in this supplement. ", ButtonBox["Go Back.", BaseStyle->"Hyperlink", ButtonData:>"h8b"] }], "Text", PageWidth->PaperWidth, CellTags->"h8"], Cell[TextData[{ "The error message that displays when you execute the ", StyleBox["Solve[ ]", FontWeight->"Bold"], " command is to warn you that whenever ", StyleBox["Mathematica", FontSlant->"Italic"], " uses inverse functions to solve an equation there may be some solutions \ that are missed. A good example of this is the equation ", Cell[BoxData[ FormBox[ RowBox[{ RowBox[{"sin", " ", "x"}], "=", "1"}], TraditionalForm]]], ". ", StyleBox["Mathematica", FontSlant->"Italic"], " will use the inverse sine function to solve this equation, giving ", StyleBox["x", FontSlant->"Italic"], " = ", Cell[BoxData[ FormBox[ FractionBox["\[Pi]", "2"], TraditionalForm]]], " (with the same warning message). We all know, however, that the equation \ actually has infinitely many solutions. They are", Cell[BoxData[ FormBox[ RowBox[{" ", RowBox[{"x", " ", "=", " ", RowBox[{"(", RowBox[{ RowBox[{"4", "n"}], "+", "1"}], ")"}]}]}], TraditionalForm]]], Cell[BoxData[ FormBox[ FractionBox["\[Pi]", "2"], TraditionalForm]]], ", where n can be any integer. You might try using ", StyleBox["Mathematica", FontSlant->"Italic"], " to solve ", Cell[BoxData[ FormBox[ RowBox[{ RowBox[{"sin", " ", "x"}], "=", "1"}], TraditionalForm]]], ". ", ButtonBox["Go Back.", BaseStyle->"Hyperlink", ButtonData:>"h9b"] }], "Text", PageWidth->PaperWidth, CellTags->"h9"], Cell[TextData[{ "The ", StyleBox["Do[ ]", FontWeight->"Bold"], " command is useful for performing an operation for a list of values that \ are incremented by a constant amount. In the example above, the operation is \ to build the functions ", StyleBox["y[x_, n]", FontWeight->"Bold"], " as ", StyleBox["n", FontWeight->"Bold"], " varies from 1 to 5 in increments of 1 (the default increment when none is \ specified). To learn more about the ", StyleBox["Do[ ]", FontWeight->"Bold"], " command, and the related ", StyleBox["For[ ]", FontWeight->"Bold"], " and ", StyleBox["While[ ]", FontWeight->"Bold"], " commands, go to the Help Browser and type ", StyleBox["Do", FontWeight->"Bold"], " and/or ", StyleBox["For", FontWeight->"Bold"], " and/or ", StyleBox["While", FontWeight->"Bold"], ". ", ButtonBox["Go Back.", BaseStyle->"Hyperlink", ButtonData:>"h10b"] }], "Text", PageWidth->PaperWidth, CellTags->"h10"], Cell[TextData[{ "To define the functions ", StyleBox["y[x_, n]", FontWeight->"Bold"], " above, we used double indices on the symbol ", StyleBox["y", FontWeight->"Bold"], ". This way we can use one symbol, i.e., ", StyleBox["y", FontWeight->"Bold"], ", to represent a group of related functions. ", ButtonBox["Go Back.", BaseStyle->"Hyperlink", ButtonData:>"h11b"] }], "Text", PageWidth->PaperWidth, CellTags->"h11"] }, Closed]] }, Open ]] }, AutoGeneratedPackage->None, ScreenStyleEnvironment->"Presentation", WindowSize->{896, 668}, WindowMargins->{{0, Automatic}, {Automatic, 0}}, PrintingCopies->1, PrintingPageRange->{Automatic, Automatic}, FrontEndVersion->"7.0 for Microsoft Windows (32-bit) (February 18, 2009)", StyleDefinitions->FrontEnd`FileName[{"Creative"}, "NaturalColor.nb", CharacterEncoding -> "WindowsANSI"] ] (* End of Notebook Content *) (* Internal cache information *) (*CellTagsOutline CellTagsIndex->{ "h1b"->{ Cell[24615, 801, 760, 28, 65, "Input", Evaluatable->False, CellTags->"h1b"]}, "h2b"->{ Cell[26570, 874, 760, 28, 65, "Input", Evaluatable->False, CellTags->"h2b"]}, "h3b"->{ Cell[27592, 914, 760, 28, 65, "Input", Evaluatable->False, CellTags->"h3b"]}, "h4b"->{ Cell[30013, 1001, 834, 31, 65, "Input", Evaluatable->False, CellTags->"h4b"]}, "h5b"->{ Cell[31585, 1059, 760, 28, 65, "Input", Evaluatable->False, CellTags->"h5b"]}, "h6b"->{ Cell[36790, 1230, 760, 28, 65, "Input", Evaluatable->False, CellTags->"h6b"]}, "h7b"->{ Cell[41090, 1375, 760, 28, 65, "Input", Evaluatable->False, CellTags->"h7b"]}, "h8b"->{ Cell[51680, 1676, 760, 28, 65, "Input", Evaluatable->False, CellTags->"h8b"]}, "h9b"->{ Cell[53155, 1733, 760, 28, 65, "Input", Evaluatable->False, CellTags->"h9b"]}, "h10b"->{ Cell[96629, 3202, 762, 28, 65, "Input", Evaluatable->False, CellTags->"h10b"]}, "h11b"->{ Cell[98076, 3263, 762, 28, 65, "Input", Evaluatable->False, CellTags->"h11b"]}, "h1"->{ Cell[105956, 3526, 862, 29, 472, "Text", CellTags->"h1"]}, "h2"->{ Cell[106821, 3557, 715, 27, 310, "Text", CellTags->"h2"]}, "h3"->{ Cell[107539, 3586, 1101, 35, 633, "Text", CellTags->"h3"]}, "h4"->{ Cell[108643, 3623, 1223, 45, 581, "Text", CellTags->"h4"]}, "h5"->{ Cell[109869, 3670, 1354, 47, 610, "Text", CellTags->"h5"]}, "h6"->{ Cell[111226, 3719, 703, 20, 436, "Text", CellTags->"h6"]}, "h7"->{ Cell[111932, 3741, 612, 20, 341, "Text", CellTags->"h7"]}, "h8"->{ Cell[112547, 3763, 953, 31, 504, "Text", CellTags->"h8"]}, "h9"->{ Cell[113503, 3796, 1433, 49, 579, "Text", CellTags->"h9"]}, "h10"->{ Cell[114939, 3847, 956, 37, 443, "Text", CellTags->"h10"]}, "h11"->{ Cell[115898, 3886, 435, 16, 181, "Text", CellTags->"h11"]} } *) (*CellTagsIndex CellTagsIndex->{ {"h1b", 116856, 3921}, {"h2b", 116952, 3925}, {"h3b", 117048, 3929}, {"h4b", 117144, 3933}, {"h5b", 117241, 3937}, {"h6b", 117338, 3941}, {"h7b", 117435, 3945}, {"h8b", 117532, 3949}, {"h9b", 117629, 3953}, {"h10b", 117727, 3957}, {"h11b", 117826, 3961}, {"h1", 117923, 3965}, {"h2", 117996, 3968}, {"h3", 118069, 3971}, {"h4", 118143, 3974}, {"h5", 118217, 3977}, {"h6", 118291, 3980}, {"h7", 118364, 3983}, {"h8", 118437, 3986}, {"h9", 118510, 3989}, {"h10", 118585, 3992}, {"h11", 118660, 3995} } *) (*NotebookFileOutline Notebook[{ Cell[CellGroupData[{ Cell[567, 22, 225, 4, 471, "Title"], Cell[795, 28, 179, 6, 19, "Input", CellOpen->False, InitializationCell->True], Cell[CellGroupData[{ Cell[999, 38, 55, 1, 130, "Section"], Cell[1057, 41, 235, 5, 207, "Text"], Cell[1295, 48, 633, 11, 528, "Text"], Cell[CellGroupData[{ Cell[1953, 63, 97, 2, 63, "Subsection"], Cell[2053, 67, 3385, 129, 735, "Text"] }, Closed]] }, Closed]], Cell[CellGroupData[{ Cell[5487, 202, 78, 1, 136, "Section"], Cell[CellGroupData[{ Cell[5590, 207, 64, 1, 63, "Subsection"], Cell[5657, 210, 537, 10, 527, "Text"], Cell[6197, 222, 941, 30, 236, "Input"], Cell[7141, 254, 428, 12, 178, "Input"], Cell[7572, 268, 99, 1, 79, "Text"], Cell[7674, 271, 1099, 32, 381, "Input"] }, Closed]], Cell[CellGroupData[{ Cell[8810, 308, 63, 1, 63, "Subsection"], Cell[8876, 311, 234, 6, 145, "Text"], Cell[9113, 319, 319, 10, 120, "Input"], Cell[9435, 331, 161, 4, 143, "Text"], Cell[9599, 337, 799, 24, 236, "Input"], Cell[10401, 363, 106, 3, 61, "Input"], Cell[10510, 368, 115, 3, 79, "Text"] }, Closed]], Cell[CellGroupData[{ Cell[10662, 376, 66, 1, 63, "Subsection"], Cell[10731, 379, 228, 5, 175, "Text"], Cell[10962, 386, 299, 9, 91, "Input"], Cell[11264, 397, 633, 19, 178, "Input"], Cell[11900, 418, 467, 13, 236, "Input"], Cell[12370, 433, 524, 9, 399, "Text"], Cell[12897, 444, 867, 26, 207, "Input"], Cell[13767, 472, 621, 18, 236, "Input"], Cell[14391, 492, 161, 2, 79, "Text"] }, Closed]], Cell[CellGroupData[{ Cell[14589, 499, 65, 1, 63, "Subsection"], Cell[14657, 502, 1349, 21, 1135, "Text"], Cell[16009, 525, 659, 21, 149, "Input"], Cell[16671, 548, 360, 10, 207, "Input"], Cell[17034, 560, 850, 14, 783, "Text"], Cell[17887, 576, 691, 22, 178, "Input"], Cell[18581, 600, 331, 10, 149, "Input"], Cell[18915, 612, 87, 1, 79, "Text"], Cell[19005, 615, 1155, 34, 381, "Input"], Cell[20163, 651, 314, 6, 271, "Text"], Cell[20480, 659, 283, 9, 91, "Input"], Cell[20766, 670, 799, 24, 236, "Input"], Cell[21568, 696, 106, 3, 61, "Input"] }, Closed]] }, Closed]], Cell[CellGroupData[{ Cell[21723, 705, 82, 1, 136, "Section"], Cell[CellGroupData[{ Cell[21830, 710, 61, 1, 63, "Subsection"], Cell[21894, 713, 297, 6, 239, "Text"] }, Closed]] }, Closed]], Cell[CellGroupData[{ Cell[22240, 725, 99, 1, 189, "Section"], Cell[CellGroupData[{ Cell[22364, 730, 63, 1, 63, "Subsection"], Cell[CellGroupData[{ Cell[22452, 735, 67, 1, 47, "Subsubsection"], Cell[22522, 738, 641, 10, 559, "Text"], Cell[23166, 750, 815, 26, 207, "Input"], Cell[23984, 778, 215, 7, 145, "Text"], Cell[24202, 787, 410, 12, 207, "Input"], Cell[24615, 801, 760, 28, 65, "Input", Evaluatable->False, CellTags->"h1b"], Cell[25378, 831, 199, 7, 113, "Text"], Cell[25580, 840, 645, 18, 236, "Input"] }, Closed]], Cell[CellGroupData[{ Cell[26262, 863, 66, 1, 47, "Subsubsection"], Cell[26331, 866, 236, 6, 145, "Text"], Cell[26570, 874, 760, 28, 65, "Input", Evaluatable->False, CellTags->"h2b"], Cell[27333, 904, 256, 8, 91, "Input"], Cell[27592, 914, 760, 28, 65, "Input", Evaluatable->False, CellTags->"h3b"], Cell[28355, 944, 283, 8, 209, "Text"], Cell[28641, 954, 485, 14, 149, "Input"], Cell[29129, 970, 106, 3, 61, "Input"] }, Closed]], Cell[CellGroupData[{ Cell[29272, 978, 69, 1, 47, "Subsubsection"], Cell[29344, 981, 336, 6, 271, "Text"], Cell[29683, 989, 327, 10, 120, "Input"], Cell[30013, 1001, 834, 31, 65, "Input", Evaluatable->False, CellTags->"h4b"], Cell[30850, 1034, 185, 4, 143, "Text"], Cell[31038, 1040, 544, 17, 178, "Input"], Cell[31585, 1059, 760, 28, 65, "Input", Evaluatable->False, CellTags->"h5b"], Cell[32348, 1089, 460, 13, 207, "Input"], Cell[32811, 1104, 675, 11, 495, "Text"], Cell[33489, 1117, 714, 22, 236, "Input"], Cell[34206, 1141, 614, 18, 236, "Input"], Cell[34823, 1161, 265, 8, 79, "Text"] }, Closed]] }, Closed]], Cell[CellGroupData[{ Cell[35137, 1175, 59, 1, 63, "Subsection"], Cell[CellGroupData[{ Cell[35221, 1180, 67, 1, 47, "Subsubsection"], Cell[35291, 1183, 256, 5, 207, "Text"], Cell[35550, 1190, 1237, 38, 381, "Input"], Cell[36790, 1230, 760, 28, 65, "Input", Evaluatable->False, CellTags->"h6b"], Cell[37553, 1260, 77, 1, 47, "Text"], Cell[37633, 1263, 744, 20, 265, "Input"] }, Closed]], Cell[CellGroupData[{ Cell[38414, 1288, 66, 1, 47, "Subsubsection"], Cell[38483, 1291, 865, 26, 374, "Text"], Cell[39351, 1319, 796, 21, 149, "Input"], Cell[40150, 1342, 234, 7, 145, "Text"], Cell[40387, 1351, 591, 17, 178, "Input"], Cell[40981, 1370, 106, 3, 61, "Input"], Cell[41090, 1375, 760, 28, 65, "Input", Evaluatable->False, CellTags->"h7b"] }, Closed]], Cell[CellGroupData[{ Cell[41887, 1408, 69, 1, 47, "Subsubsection"], Cell[41959, 1411, 284, 7, 175, "Text"], Cell[42246, 1420, 634, 20, 178, "Input"], Cell[42883, 1442, 235, 5, 175, "Text"], Cell[43121, 1449, 504, 14, 149, "Input"], Cell[43628, 1465, 1974, 31, 1521, "Text"], Cell[45605, 1498, 360, 11, 120, "Input"], Cell[45968, 1511, 93, 1, 79, "Text"], Cell[46064, 1514, 156, 4, 91, "Input"], Cell[46223, 1520, 458, 10, 337, "Text"], Cell[46684, 1532, 125, 3, 61, "Input"], Cell[46812, 1537, 240, 6, 239, "Text"] }, Closed]] }, Closed]] }, Closed]], Cell[CellGroupData[{ Cell[47113, 1550, 97, 1, 189, "Section"], Cell[CellGroupData[{ Cell[47235, 1555, 65, 1, 63, "Subsection"], Cell[47303, 1558, 1993, 44, 1364, "Text"], Cell[49299, 1604, 2378, 70, 701, "Input"], Cell[51680, 1676, 760, 28, 65, "Input", Evaluatable->False, CellTags->"h8b"] }, Closed]], Cell[CellGroupData[{ Cell[52477, 1709, 64, 1, 63, "Subsection"], Cell[52544, 1712, 256, 5, 175, "Text"], Cell[52803, 1719, 171, 6, 61, "Input"], Cell[52977, 1727, 175, 4, 143, "Text"], Cell[53155, 1733, 760, 28, 65, "Input", Evaluatable->False, CellTags->"h9b"] }, Closed]] }, Closed]], Cell[CellGroupData[{ Cell[53964, 1767, 93, 1, 189, "Section"], Cell[CellGroupData[{ Cell[54082, 1772, 61, 1, 63, "Subsection"], Cell[CellGroupData[{ Cell[54168, 1777, 67, 1, 47, "Subsubsection"], Cell[54238, 1780, 496, 8, 431, "Text"], Cell[54737, 1790, 1156, 36, 352, "Input"], Cell[55896, 1828, 113, 3, 79, "Text"], Cell[56012, 1833, 870, 25, 294, "Input"] }, Closed]], Cell[CellGroupData[{ Cell[56919, 1863, 66, 1, 47, "Subsubsection"], Cell[56988, 1866, 230, 6, 145, "Text"], Cell[57221, 1874, 284, 9, 91, "Input"], Cell[57508, 1885, 284, 9, 91, "Input"], Cell[57795, 1896, 125, 3, 111, "Text"], Cell[57923, 1901, 561, 16, 178, "Input"], Cell[58487, 1919, 557, 16, 178, "Input"], Cell[59047, 1937, 190, 5, 91, "Input"], Cell[59240, 1944, 115, 3, 79, "Text"] }, Closed]], Cell[CellGroupData[{ Cell[59392, 1952, 69, 1, 47, "Subsubsection"], Cell[59464, 1955, 500, 11, 377, "Text"], Cell[59967, 1968, 519, 16, 149, "Input"], Cell[60489, 1986, 578, 18, 178, "Input"], Cell[61070, 2006, 575, 16, 265, "Input"], Cell[61648, 2024, 380, 7, 335, "Text"], Cell[62031, 2033, 209, 5, 175, "Text"], Cell[62243, 2040, 787, 24, 207, "Input"], Cell[63033, 2066, 170, 4, 143, "Text"], Cell[63206, 2072, 606, 16, 236, "Input"], Cell[63815, 2090, 646, 21, 420, "Text"], Cell[64464, 2113, 481, 15, 120, "Input"], Cell[64948, 2130, 580, 18, 178, "Input"], Cell[65531, 2150, 576, 16, 265, "Input"], Cell[66110, 2168, 241, 5, 207, "Text"], Cell[66354, 2175, 789, 24, 207, "Input"], Cell[67146, 2201, 606, 16, 265, "Input"], Cell[67755, 2219, 378, 12, 228, "Text"], Cell[68136, 2233, 361, 7, 239, "Text"], Cell[68500, 2242, 106, 3, 61, "Input"] }, Closed]], Cell[CellGroupData[{ Cell[68643, 2250, 69, 1, 47, "Subsubsection"], Cell[68715, 2253, 1855, 69, 639, "Text"] }, Closed]] }, Closed]], Cell[CellGroupData[{ Cell[70619, 2328, 56, 1, 63, "Subsection"], Cell[CellGroupData[{ Cell[70700, 2333, 67, 1, 47, "Subsubsection"], Cell[70770, 2336, 439, 11, 305, "Text"], Cell[71212, 2349, 1046, 33, 294, "Input"], Cell[72261, 2384, 113, 3, 79, "Text"], Cell[72377, 2389, 854, 24, 265, "Input"] }, Closed]], Cell[CellGroupData[{ Cell[73268, 2418, 66, 1, 47, "Subsubsection"], Cell[73337, 2421, 202, 7, 113, "Text"], Cell[73542, 2430, 282, 9, 91, "Input"], Cell[73827, 2441, 134, 4, 111, "Text"], Cell[73964, 2447, 485, 14, 149, "Input"], Cell[74452, 2463, 106, 3, 61, "Input"], Cell[74561, 2468, 177, 4, 79, "Text"] }, Closed]], Cell[CellGroupData[{ Cell[74775, 2477, 69, 1, 47, "Subsubsection"], Cell[74847, 2480, 274, 5, 207, "Text"], Cell[75124, 2487, 514, 16, 149, "Input"], Cell[75641, 2505, 609, 19, 178, "Input"], Cell[76253, 2526, 562, 15, 236, "Input"], Cell[76818, 2543, 370, 8, 367, "Text"], Cell[77191, 2553, 818, 25, 207, "Input"], Cell[78012, 2580, 596, 16, 236, "Input"] }, Closed]], Cell[CellGroupData[{ Cell[78645, 2601, 68, 1, 47, "Subsubsection"], Cell[78716, 2604, 295, 9, 175, "Text"], Cell[79014, 2615, 5421, 155, 1430, "Input"], Cell[84438, 2772, 284, 9, 143, "Text"] }, Closed]], Cell[CellGroupData[{ Cell[84759, 2786, 69, 1, 47, "Subsubsection"], Cell[84831, 2789, 2125, 80, 614, "Text"] }, Closed]] }, Closed]] }, Closed]], Cell[CellGroupData[{ Cell[87017, 2876, 78, 1, 136, "Section"], Cell[CellGroupData[{ Cell[87120, 2881, 55, 1, 63, "Subsection"], Cell[87178, 2884, 74, 2, 48, "Text"], Cell[87255, 2888, 796, 26, 149, "Input"], Cell[88054, 2916, 73, 2, 48, "Text"], Cell[88130, 2920, 818, 26, 207, "Input"], Cell[88951, 2948, 74, 2, 48, "Text"], Cell[89028, 2952, 496, 16, 149, "Input"], Cell[89527, 2970, 99, 2, 48, "Text"], Cell[89629, 2974, 558, 18, 149, "Input"] }, Closed]], Cell[CellGroupData[{ Cell[90224, 2997, 58, 1, 63, "Subsection"], Cell[90285, 3000, 1158, 18, 1200, "Text"] }, Closed]] }, Closed]], Cell[CellGroupData[{ Cell[91492, 3024, 74, 1, 136, "Section"], Cell[CellGroupData[{ Cell[91591, 3029, 67, 1, 47, "Subsubsection"], Cell[91661, 3032, 589, 20, 243, "Text"], Cell[92253, 3054, 1300, 40, 381, "Input"], Cell[93556, 3096, 113, 3, 79, "Text"], Cell[93672, 3101, 1031, 30, 381, "Input"], Cell[94706, 3133, 301, 6, 271, "Text"] }, Closed]], Cell[CellGroupData[{ Cell[95044, 3144, 66, 1, 47, "Subsubsection"], Cell[95113, 3147, 991, 33, 375, "Text"], Cell[96107, 3182, 519, 18, 149, "Input"], Cell[96629, 3202, 762, 28, 65, "Input", Evaluatable->False, CellTags->"h10b"], Cell[97394, 3232, 159, 4, 143, "Text"], Cell[97556, 3238, 101, 3, 61, "Input"], Cell[97660, 3243, 101, 3, 61, "Input"], Cell[97764, 3248, 101, 3, 61, "Input"], Cell[97868, 3253, 101, 3, 61, "Input"], Cell[97972, 3258, 101, 3, 61, "Input"], Cell[98076, 3263, 762, 28, 65, "Input", Evaluatable->False, CellTags->"h11b"], Cell[98841, 3293, 1819, 52, 497, "Input"], Cell[100663, 3347, 106, 3, 61, "Input"] }, Closed]], Cell[CellGroupData[{ Cell[100806, 3355, 69, 1, 47, "Subsubsection"], Cell[100878, 3358, 329, 8, 241, "Text"], Cell[101210, 3368, 550, 18, 149, "Input"], Cell[101763, 3388, 517, 16, 178, "Input"], Cell[102283, 3406, 615, 17, 294, "Input"], Cell[102901, 3425, 194, 4, 143, "Text"], Cell[103098, 3431, 726, 22, 236, "Input"], Cell[103827, 3455, 617, 18, 236, "Input"], Cell[104447, 3475, 634, 11, 591, "Text"] }, Closed]] }, Closed]], Cell[CellGroupData[{ Cell[105130, 3492, 93, 1, 189, "Section"], Cell[105226, 3495, 138, 4, 111, "Text"] }, Closed]], Cell[CellGroupData[{ Cell[105401, 3504, 552, 20, 83, "Section"], Cell[105956, 3526, 862, 29, 472, "Text", CellTags->"h1"], Cell[106821, 3557, 715, 27, 310, "Text", CellTags->"h2"], Cell[107539, 3586, 1101, 35, 633, "Text", CellTags->"h3"], Cell[108643, 3623, 1223, 45, 581, "Text", CellTags->"h4"], Cell[109869, 3670, 1354, 47, 610, "Text", CellTags->"h5"], Cell[111226, 3719, 703, 20, 436, "Text", CellTags->"h6"], Cell[111932, 3741, 612, 20, 341, "Text", CellTags->"h7"], Cell[112547, 3763, 953, 31, 504, "Text", CellTags->"h8"], Cell[113503, 3796, 1433, 49, 579, "Text", CellTags->"h9"], Cell[114939, 3847, 956, 37, 443, "Text", CellTags->"h10"], Cell[115898, 3886, 435, 16, 181, "Text", CellTags->"h11"] }, Closed]] }, Open ]] } ] *) (* End of internal cache information *)