Chapter 5 homework5.4 [ ]1n22 2 2 2 2 21 2 n ii 1nyyy ,y ,...,y y 7.8 9.0 10.2 11 11.7 503.77y=� �� �� ��= = = + + + + =�� �� �� �Y YM12ni222i 1n n212 22 n2i2 i2i 1 i 1n21 xn x1 1 1 1 x 5 0x x x 0 160x x1 x== =� �� �� ��� �� � � �� ��= = =� �� � � �� �� � � �� �� �� �� �� �X XLL M M1n ni1 i i11 21 n1 2i 1 i 1n n12 22 n2i2 i i2 ii 1 i 1nyx y yx x x y 49.7x x x 39.2x y x yy= == =� �� � � �� �� �� � � �� � � �� ��= = = =� � � �� � � �� �-� � � �� � � �� �� �� � � �� �X YLL MHere is my code and the corresponding output. There are other ways to do this problem!> X<-c(8,4,0,-4,-8)> Y<-c(7.8, 9, 10.2, 11, 11.7) > sum(Y)[1] 49.7> sum(Y^2)[1] 503.77> X%*%Y #also sum(X*Y) using elementwise multiplication and summing the result [,1][1,] -39.2> sum(X)[1] 0> length(X)[1] 5> sum(X^2)[1] 1605.12 ( )( )( )n n2i i1i 1 i 12 2nn n2ii ii 1i 1 i 1X X160 0 1/ 5 01 10 5 0 1/1605 160 0X nn X X-= === =� �-� �-� �� � � ��= = =� �� � � �-* -� � � �� �-�-� �� �X X5.23a) 1) 1n ni ii 1 i 11n n n2i i i ii 1 i 1 i 1n X Y1/ 5 0 49.7 49.7 / 5( )0 1/160 39.2 39.2 /160X X X Y9.940.245-= =-= = =� � � �� �� � � �� �� � � �� �= = = =� � � �� �� � � �- -� �� � � �� � � �� � �� � � �� �=� �-� �b X X X Y1From the answer keyExtra problem with the copier maintenance data: You can check most of your answers with your past work for Chapters 1-4 or additional calculations as shown in class for Chapter 5.
View Full Document