Docsity

Homework 2 - Introduction to Numerical Methods | MATH 471, Assignments of Number Theory

Toggle sidebar
bg1
Math 471 - Introduction to Numerical Methods - Winter 2007
Homework 2
Assigned: Friday, January 19, 2007.
Due: Friday, January 26, 2007.
•Include a cover page and a problem sheet.
•Always clearly label all plots (title, x-label, y-label, and legend).
•Use the subplot command from MATLAB when comparing 2 or more plots to
make comparisons easier and to save paper.
•Include all of your script.
•Place a comment at the top of each function or script that you submit which
includes the name of the function or script, your name, the date, MATH 471,
and the section.
PROBLEMS:
1. Use three-digit rounding arithmetic to compute the following sums (sum in the
given order):
(a)
6
X
k=1
1
3k(b)
6
X
k=1
1
37−k
2. Consider the function f(x) = cos(πx/2).
a) Expand f(x) in a Taylor series about the point x0= 0.
b) Find an expression for the remainder.
c) Estimate the number of terms that would be required to guarantee accuracy
for f(x) within 10−5for all xin the interval [-1, 1].
d) Plot f(x) and its 1st, 3rd, 5th and 7th degree Taylor polynomials over [-2, 2].
(Use the Matlab command subplot to generate a number of plots on the same
page).
3. Let Abe the 2 ×2 matrix A=a b
c d .Use Gauss elimination to obtain A−1
by solving the two systems Ax1=e1and Ax2=e2, where e1and e2are the
columns of the 2 ×2 identity matrix. Note that you can perform both at the
same time by considering the augmented system [A|I]. Show that A−1exists if
and only if det(A)6= 0.
1
pf2

Partial preview of the text

Download Homework 2 - Introduction to Numerical Methods | MATH 471 and more Assignments Number Theory in PDF only on Docsity!

Math 471 - Introduction to Numerical Methods - Winter 2007 Homework 2 Assigned: Friday, January 19, 2007. Due: Friday, January 26, 2007.

  • Include a cover page and a problem sheet.
  • Always clearly label all plots (title, x-label, y-label, and legend).
  • Use the subplot command from MATLAB when comparing 2 or more plots to make comparisons easier and to save paper.
  • Include all of your script.
  • Place a comment at the top of each function or script that you submit which includes the name of the function or script, your name, the date, MATH 471, and the section.

PROBLEMS:

  1. Use three-digit rounding arithmetic to compute the following sums (sum in the given order):

(a)

∑^6

k=

3 k^

(b)

∑^6

k=

37 −k

  1. Consider the function f (x) = cos(πx/2).

a) Expand f (x) in a Taylor series about the point x 0 = 0.

b) Find an expression for the remainder.

c) Estimate the number of terms that would be required to guarantee accuracy for f (x) within 10−^5 for all x in the interval [-1, 1].

d) Plot f (x) and its 1st, 3rd, 5th and 7th degree Taylor polynomials over [-2, 2]. (Use the Matlab command subplot to generate a number of plots on the same page).

  1. Let A be the 2 × 2 matrix A =

( a b c d

)

. Use Gauss elimination to obtain A−^1 by solving the two systems Ax 1 = e 1 and Ax 2 = e 2 , where e 1 and e 2 are the columns of the 2 × 2 identity matrix. Note that you can perform both at the same time by considering the augmented system [A|I]. Show that A−^1 exists if and only if det(A) 6 = 0.

  1. Let E 1 =

 

−m 2 , 1 1 0 −m 3 , 1 0 1

  , E 2 =

 

0 −m 3 , 2 1

  , P 1 =

 

 .

(a) Show that

E 1 − 1 =

  

m 2 , 1 1 0 m 3 , 1 0 1

  .

(b) Show that

E 1 − 1 E 2 − 1 =

 

m 2 , 1 1 0 m 3 , 1 m 3 , 2 1

 .

(c) Show that P 1 − 1 =P 1.

  1. Find the LU factorization of A and use it to solve Ax = b.

A =

  

   , b =

  

  .

  1. Consider the problem Ax = b where A is a tridiagonal matrix. What is the operation count for the forward elimination and the back substitution steps of Gauss elimination in this case? Count add/sub and mult/div operations separately, then give the overall order of the total operations needed. (Use O(np) notation).