(* CALCULUS 265 Honors Fall Semester 2000 8:00 to 8:50 MTTF Carver 0002 Instructor: Hentzel Office: 432 Carver Office Hours: 9:00-10:00 MTTF E-mail hentzel@iastate.edu phone 294-8141 Website http://www.public.iastate.edu/~mathclasses/honors.265 Tuesday, September 5: Section 12.9 p899:15,17,19 p900:31 page 900 problem 31. Find the Least Squares Regression Line for the points (0,6) (4,3) (5,0), (8,-4), (10,-5) *) a = {{0,1},{4,1},{5,1},{8, 1},{10, 1}}; c = {6, 3, 0, -4, -5}; Solve[ (Transpose[a].a).{m,b} == Transpose[a].c] (* 945 175 Out[1]= {{b -> ---, m -> -(---)}} 148 148 The line of regression is y = -175/148 x + 195/148; *) a1 = ListPlot[{{0,6},{4,3},{5,0}, {8,-4}, {10,-5}}]; a2 = Plot[-175/148 x + 945/148,{x,0,10}]; a3 = Show[a1,a2,PlotLabel->"Line of Regression"]; Page 899 problem 15. Cost[{x_,y_}] := 3*Sqrt[x^2 + 2^2] + 2*Sqrt[(y-x)^2+1] + (10-y); 3 Sqrt[2] + 2 Sqrt[3] 1 Out[7]= {{y -> ---------------------, x -> -------}} 6 Sqrt[2] Out[8]= {{y -> 1.28446, x -> 0.707107}} In[9]:= Cost[{x/.Out[7],y/.Out[7]}] Out[10]= {10 + 4 Sqrt[2] + Sqrt[3]} In[11]:= N[%] Out[11]= {17.3889}