{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

rec01 - y 1 = x 7 − 7 x 6 21 x 5 − 35 x 4 35 x 3 − 21...

This preview shows page 1. Sign up to view the full content.

Recitation Problems – Week 1 440:127 – Fall 2011 – S. J. Orfanidis Please do the following problems from your textbook during your recitation session, including any addi- tional problems given to you by your TA. 1. Practice Exercises 2.3 Practice Exercises 2.4 2. Consider the vectors a = [1 2 4 5] and b = [5 4 2 1] . Perform the following element-wise opera- tions and then try to understand them by re-doing them by hand: a + 10, a*10, a + b, a.*b, a./b, a + 1./b, 1./a + b, a.^2, a + b.^2, a.^2./a, a.^2./b, (a.^2)./b, a.^(2./b), a./b.^2, (a./b).^2 What are your conclusions about the precedence of the operations + * / ^ ? 3. Numerical roundoff errors can be observed when one has differences of large numbers that are almost equal to each other, causing severe subtractive cancellations. Using the function linspace , define a vector of 241 equally-spaced values of x in the interval 0 . 988 x 1 . 012. Using a vectorized calculation compute the corresponding 241 values of the following two polynomial expressions:
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: y 1 = x 7 − 7 x 6 + 21 x 5 − 35 x 4 + 35 x 3 − 21 x 2 + 7 x − 1 y 2 = (x − 1 ) 7 The two expressions are mathematically equivalent because the Frst is the binomial expansion of the second, but behave very differently numerically for the above case where x is almost equal to one, and the values of the expressions should be (and are) almost zero. Plot y 1 versus x . Then, using the same vertical scales as the previous graph, plot y 2 versus x . ±or both plots, use the function axis to simultaneously set the x-axis limit to be the interval 0 . 988 ≤ x ≤ 1 . 012 and the y-axis limit, the interval min (y 1 ) ≤ y ≤ max (y 1 ) . ±inally, plot both y 1 and y 2 together on the same graph using different line colors. [Do you recognize this problem from somewhere?] 4. End-of-chapter problems: 2.3 2.6 2.8 2.10 2.12 2.17 1...
View Full Document

{[ snackBarMessage ]}

Ask a homework question - tutors are online