# Possible Problems for Exams

Chapter ONE

1. Construct the floating point system where the numbers

may be exactly representable.
2. Consider the floating point system with digits with base and lower and upper values of exponents being and . Subnormals are allowed.
• How many numbers are there between the number and number (not counting and .
• What is the number closest to ?
• What is the smallest INTEGER which is not representable in this floating point system?
• How would your answer change if and were to be and ?

3. Let and be two adjacent positive Normalized Single Precision floating point numbers.
• What is the minimal possible distance between and ?
• What is the maximum possible distance between and ?
• How many Double Precision Numbers are there between and (for double numbers ).

4. IEEE Single Precision has , , , , and subnormals are allowed. What is the maximum integer value of for which the number

can be exactly re presentable in Single Precision?
5. IEEE Single Precision has , , , , and subnormals are allowed.

In class we have shown that if is a real number, and is its floating point representation, then the maximum possible relative error in representing this number is given by

 (1)

where is machine precision,

How the equation (1) changes for the subnormals?

1. First, consider . How is going to be represented in IEEE SP?
2. What is the floating point number that follows number on the computer number line?
3. What is the maximum possible absolute error in representing numbers between and ?
4. Consider number such that

What is the maximum possible relative error in representing the number ?
5. extra credit Generalize the result of the previous question to any number between . You can guess the correct result by contemplating equation (1).
6. In single precision, what is the floating point number that follows “32”? In other words, what is the smallest positive floating point number such that

Please write the result the way it is stored in the computer, i.e. in binary floating point form.

7. Consider a floating-point arithmetic with base , precision and exponent range . In other words, each number in this system can be represented as

Here is integer, and all are either 0 or .
1. Show that addition is not necessarily associative. I.e., give an example of 3 numbers and such that is not equal to
2. write down two adjacent normalized numbers and such that is maximal.
3. In this floating point system, what is the range of possible relative errors in representing a given number by a machine number?
8. (a) Find the largest open interval around so that all real numbers from the interval are rounded to . That is, find the smallest value of and the largest vlue of with so that any number from the interval is rounded to the floating point number . Assume double precision is used (53 binary digits).

(b)

Redo the part (a) for the , that is, find the interval that rounds to the floating point number

9. IEEE SP has , , , .

Calculate , and for this system. Assume rounding by chopping.

How many floating point numbers are there between any successive powers of ? For example, how many floating point numbers are there between 2 and 4?

10. Consider the floating point system with

(a) What is the distance from number to the next largest floating point number in this floating point system?

(b) What is the distance from number to the next smallest floating point number in this floating point system?

(c) What distance is larger, (a) or (b)? Why? What is the relation between these distances and machine precision ?

11. Consider IEEE SP, which has , , , . What is the closest floating point number to the number

in IEEE SP?

12. Consider IEEE SP, which has , , , . What is the absolute error in representing the number

in IEEE SP?
13. Consider IEEE SP, which has , , , . What is the closest floating point number to the number

in IEEE SP?

14. What is the spacing of the floating point numbers between and , i.e. ?
15. Define machine epsilon and explain its significance
16. What would be the output in MATLAB for the ratio ?
17. Consider

a) Approximate using third degree Taylor polynomial expanded about . Use this expansion to show that

b) Explain why MATLAB would compute the limit of to be 0.

18. What is the largest value of such that

in IEEE SP system? Here is a floating point representation of the number .
19. We have studied in class that the maximum possible relative error for normalized numbers is equal to

< What is the range of possible errors for the subnormal floating point numbers?

20. Consider

function. The following values were obtained in MATLAB:

Please explain in details the values in the right column of this table.

21. For which positive integers can the number be represented exactly, with no rounding error in IEEE SP floating point system?

22. Consider IEEE SP that has binary numbers , with digits, and lower and upper values of the exponents of , . As we discussed in class, the number is not representable in IEEE SP. What is the Floating Point Number that precedes ? In other words, find the largest Floating Point Number that is less then .

Hint: your answer should contain 24 binary digits of the mantissa and the value of the exponent.

23. (a)Which of the following operations of two positive floating point numbers can produce overflow?

— subtraction

— multiplication

— division

If you answered “yes” to any of the questions, please give one example of two Single Precision numbers that produce overflow by given operation.

(b) Which of the following operations of two positive floating point numbers can produce underflow?

— subtraction

— multiplication

— division

If you answered “yes” to any of the questions, please give one example of two Single Precision numbers that produce underflow by given operation.

24. What is the number that follows the number “zero”, . In other words, find the smallest possible positive number that is representable in this system. Write the result in both binary and decimal format.

25. Consider the following expression:

assuming

(a) for what values of it is difficult to calculate this expresion accurately in floating point arithmetic?

(b)Give a rearrangement of the terms such that, for the range of in part a, the computation is more accurate in floating point system

26. Consider IEEE SP that has binary numbers , with digits, and lower and upper values of the exponents of , . What is the Floating Point Number that is before ? In other words, what is the largest Floating Point Number that is less then .

27. Consider the IEEE floating point system, where the binary numbers , with digits, and lower and upper values of the exponents of , are used. Also, assume that the “rounding to nearest” rule is used, and if there is a tie, a smallest number is chosen.

— For what numbers will the computer claim that inequality is true?

— For what real numbers will a computer claim that ?

— Suppose it is claimed that the solution of is exactly representable in this system. Why it is not possible? What is the distance between two floating point numbers that is right above and right below solution of in this system?

28. Consider the following toy floating point system: base , with digits, with lower exponent of and upper exponent .

Consider the following claim: If the two positive binary floating point numbers and in this toy floating point systems are such that

then their difference, is exactly representable number in the floating point system.

Is this claim true or false? If it is true, explain why, if it is false, find counter example.

29. Consider the following function:

The value of this function for any is equal to one. However, when we calculate on the computer for small value of , result is not equal to . Here is a computer generated graph of for small value of .

Please explain why this graph looks the way it does.

In particular, answer the following questions:

1. Why is zero for ?
2. Why is zero for ? Why the value of zero on the left is twice longer than the value of zero on the right?
3. Why after zero, jumps to the value of at ?
4. Why does oscillate around for ?
5. Why does oscillation diminish, as become larger
6. Why oscillations are twice as frequent for positive than for negative ?
7. Explain why does the second jump appear at .

30. Assume a normalized floating point system with base , three digits of accuracy and the lowest possible exponent of .
1. What is the smallest possible positive floating point number that is representable in this system (also called “UFL” for underflow level)?
2. If and , what is the result of computing ?
3. If the subnormal numbers were to be allowed, what would be the result of ?

31. IEEE SP has , , , . In single precision floating point system write down the floating point number that follows the number . (In other words, find minimal value of , that is exactly representable in this floating point system.

32. IEEE SP has , , , . What is the smallest possible positive integer that is not a single precision number?

33. In a floating point system with precision decimal digits, , let and .
1. How many significant digits does the difference contain?
2. If the floating point system is normalizes, wwhat is hte minimum exponent range for which and are exactly representable?
3. Is the fifference exctly representable, ragardless of exponent range, if gradual underflow is allowed? Why?

34. Suppose one calculates using computer arithmetic the following number:

We have shown in class that one can estimate the machine precision by the number , so that

Determine whether the following examples may be used to determine machine precision:

and

Explain your reasoning by using the system with two digits of precision.

You may find it helpful to use calculator to gain intuition for this problem.

35. Consider a floating-point number system with base , precision and exponent range I.e., in this system any number can be written as

(a) Write down two adjacent normalized numbers and such that is minimal.

(b) In this floating-point system, what is the maximal possible error of representing by a machine number? What is the possible relative error in representing by a machine number?

(c) In this floating-point system, how many numbers are there between number and number .

36. Assume a decimal (base 10) floating point system having machine precision and an exponent range of . What is the result of each of the following floating point arithmetic operations?

Chapter TWO

37. Suppose you are solving by iterations, and you have obtained and . Now use linear interpolation to find such that . What is the resulting method of solving that you have obtained?

38. For the secant, Newton, and bisection methods: Looking at iterative error when solving , which of these methods converges to an error of the fastest?
39. True or False:
If Newton's method converges to a solution for a particular choice of , then it will converge to for any starting point between and .
To get credit for this problem, you will need to give comprehensive explanation of your answer.

40. For compyting the midpoint of an interval , which of the following two equations is prefereable in floating point system? Why? When? Devise the example when the midpoint given be the equation lies outside of the interval.
1. ,
2. .

41. Solve with three digits accuracy an equation

Note that you have to find two roots. What version of quadratic formulas are you going to use to find these roots?

42. The “divide and average” method for computing a square root of a given number can be formulated as follows:

Show that this method converges to , i.e. that

and calculate the rate of convergence.

43. Show that if

for nonzero , then the Newton method, converging to the root can be implemented without performing any divisions. new

44. Newton method for solving a scalar nonlinear equation requires computation of the derivative of at each iteration. Suppose that we instead replace the true derivative with a constant value , that is we use the iteration scheme

(a) Under what condition on value of will this scheme be locally convergent?

(b) What is the convergence rate of this scheme?

(c) Is there any value of to give a quadratic convergence?

45. In class we have shown that Newton method

 (2)

has quadratic rate of convergence for simple root (i.e. when and ). In the homework you have shown that convergence rate is linear for the double root.

Proove, that Newton method has linear rate of convergence for triple root, i.e. when .

Extra Credit Proove it for roots of multiplicity , i.e. when

46. Suppose you came to the Ice Age, and computer in your Time Machine is broken. Suppose to come back to 2016 to complete the numerical computing exam, you need to calculate “two to the power one third”, i.e.

. You can only use , , and . Set up the nonlinear equation that has as the solution.
1. Describe how to use the bisection method to make this calculation. What is your initial bracket? How many iteration steps do you need to perform to get the solution with accuracy?
2. Describe how to use the Newton method for this calculation. How many steps do you need to do to get the root with accuracy?
47. Consider the following iteraton methods
Assume that all iterations start from .
1. 4 points Verify that each of these fixed-point iterations converge to , i.e.

and
2. rank the methods in order based on their apparent speed of convergence (i.e. find the fastest method to converge, the second fastest, the third and the last to converge).

48. In class we have shown that fixed point iterations

converge if

Under what condition fixed point iterations converge if

To gain an intuition on this problem, consider the fixed point iterations

For this problem the fixed point is . Start with . Then

It seems to converge to the fixed point , yet . Why is that?

49. Consider the function

The graph of the function is given by

As you see from the graph, this function has three roots, given by , and .

The following two functions are defined as

 (3)

Consider the following fixed point iterations:
 (4) (5)

1. Show that fixed point iterations (4) with converges to the root .
2. Show that fixed point iterations (5) with converges to the root .
3. Show that iterations with neither nor converge to the root , regardless of the starting point.
4. Propose a fixed point iteration scheme that will converge to the root .

50. We have studied Secant method

• Show that it can be equivalently rewritten as

• List two advantages and two disadvantages of Secant method relative to Newton method.
51. Suppose you are solving by iterations, and you have obtained and . Now use linear interpolation to interpolate a straight line through these two points, and choose so that . What is the resulting method of solving that you have derived?
52. Express the Newton iteration method for solving the following system of nonlinear equations:

and carry out one iteration starting from the starting point .

53. Express the Newton iteration method for solving the following system of nonlinear equations:

and carry out one iteration starting from the starting point .

54. Carry out one iteration of Newton's method applied to the system

 0

with starting value
55. The following values for the solution of were computed using Matlab. What method was used (bisection, Newton or secant)? Make sure you explain in details why it is the method you claim:

X=50.25125628140704

X=25.378140640072242

X=12.944094811287638

X=6.7320923307183715

X=3.636103634563207

X=2.1079101939699143

X=1.3816957571715662

X=1.0826201384421688

X=1.0058580941730362

X=1.0000339198559194

X=1.0000000011504786

X=1.0000000000000000

X=1.0000000000000000

Chapter THREE

56. Show that for arbitrary square matrices and the following is true

57. Show that for arbitrary square matrices and the following is true

where denotes the transposition
58. Prove or give counterexample: if is a singular matrix, then

59. Consider the following systems of equations:

or

1. Sketch the two curves and explain where approximately the solutions are located
2. Set up and explain the Newton method to find the solutions. Calculate the Jacobian and the RHS of the Newton method.
3. What would be the good starting point for your calculations?
4. Write down in all details the system of equations to make the first iteration. Do not solve the resulting equations.

60. Suppose that you use Newton method

 (6)

to find the solution of the equation

for which

What would be the convergence rate for the Newton method for such a case? HINT: convergence of the Newton method is not necessarily quadratic.

61. (a) Let be an arbitrary square matrix, and let be an arbitrary scalar.

Prove or disprove the following statements:

(i)

(ii)

(b)

Let be an diagonal matrix with all its diagonal entries equal to .

(i) What is the value of ?

(ii) What is the value of ?

62. Consider the linear system

1. Solve this system by any method you like using exact arithmetic.
2. Solve this system by computing an inverse of using two decimal digit machine arithmetic.
Hint If

then

Also

3. Now solve (9) by using LU factorization using two decimal digit machine arithmetic.
4. Compare and explain the difference between results obtained in items 1, 2 and 3. What conclusion can you make about LU factorization and computing solution of (9) by using inverse of a matrix?

63. In this problem

(a) Find a vector such that .

(b) Find a vector such that

64. Consider the problem with and

Suppose that the error in computed solution is small, but nonzero. Here is an exact solution, and is a computed solution. For what values of , if any, the residual will be large?

HINT For what values of , if any, the matrix will be ill-conditioned?

HINT If

then

65. The Kronecker delta (named after Leopold Kronecker) is a function of two variables, usually two integers, is defined as

 (7)

Consider the matrix defined as

In other words, is a diagonal matrix with diagonal entries being equal to

1. What is the one norm of this matix?
2. What is the two norm of this matrix?
3. What is the norm of this matrix?
4. What is the Condition Number of this matrix?

66. For the matrix

find the -factorization (show both and matrices explicitly).

67. Consider the system

 (8)

where

and

or

and

(a) Find explicitly factorization of .

(b) Use this decomposition to solve (9).

68. Consider the matrix

Calculate the inverse of this matrix by representing the matrix as a product of two elementary Gauss elimination matrices.

69. In this problem is a small positive number. Sketch the two lines in the plane, and describe how they change, including the point of intersection, as approaches zero. Also, calculate the condition number for the matrix, and describe how it changes, when approaches zero.

70. Prove that the one norm is the maximum absolute column sum; use matrices.
71. Consider
 (9)

a) Find the LU factorization of the given matrix

b) Calculate the norms , , and for this matrix

c) Calculate the condition number for the matrix A.

72. Consider

• Find all vectors satisfying and .
• Find a vector satisfying
• Find a vector satisfying
73. The norm of a vector is defined as a modulus of a maximum component of a vector. As we learned in class, matrix norms are defined through the vector norms as

Use this definition of the matrix norm through the vector norm to proove that the norm of a matrix is a maximum absolute row sum.

Complete the proof for matrices.

b Extra credit 10% Prove this statement for general matrices.

74. Consider the system
 (10)

where is small. The system has two approximate solutions and Find the norms of the respective residuals. Which one is smaller? Find the condition number of the matrix. Explain, why you should not use residuals in this case to determine the quality of a solution.

Hint: Find an exact solution to (11).

Hint

75. Calculate an inverse of the following matrix:
 (11)

Calculate the inverse of this matrix, .
76. Let a matrix be factored as follows:
 (12)

where the blank spaces stand for zeros. Use the LU factorization to solve the system

77. Consider the matrix

1. What is the determinant of ?
2. In floating point arithmetic, for what range of will the computed value of the determinant be nonzero
3. What is the factorization of ?
4. In floating point arithmetic, for what value of will the computed value of be singular?
78. In a computer with no build in function for floating point divisions, one might instead use multiplication by the reciprocal of the divisor. Apply Newton's method to produce an iterative scheme to approximate the reciprocal of a number , to solve the equation

given y. Considering intended application your scheme should not contain any divisions.

79. Consider the following system of equations:

1. Sketch the two curves and explain where approximately the solutions are located
2. Set up and explain the Newton method to find the solutions. Calculate the Jacobian and the RHS of the Newton method.
3. What would be the good starting point for your calculations?
4. Write down in all details the system of equations to make the first iteration. Do not solve the resulting equations.

80. Let a matrix be factored as follows:

Using this factorization, solve for the following equation:

Chapter FOUR

81. The Kronecker delta (named after Leopold Kronecker) is a function of two variables, usually two integers, is defined as

 (13)

Consider the matrix defined as

In other words, is a diagonal matrix with diagonal entries being equal to

1. Find eigenvalues of .
2. Find eigenvectors of .
3. To which eigenvector would a power iteractions converge? Explain, how to set up such power iterations.
4. To which eigenvector would an inverse power iteraction converge? Explain, how to set up such power iterations.
5. What algorithm would you use to find second largest eigenvector and corresponding eigenvalue? Please explain in details.

82. Let the matrix have eigenvalues , and eigenvectors . Let the matrix have eigenvalues and same eigenvectors . What are eigenvectors and eigenvalues of the matrix given by

83.  (14)

a) Calculate the Eigenvalues and Eigenvectors for the given matrix

b) What Eigenvalue would the inverse power method converge to? Why?

c) What Eigenvalue would the power method converge to? Why?

d) Define . For this matrix, what Eigenvalue would the power method converge to? Why?

84. Consider the matrix

1. Find Eigenvalues and Eigenvectors of this matrix
2. Find LU decomposition of this matrix
3. To what eigenvalue and eigenvector the power iteration will converge?
4. To what eigenvalue and eigenvector the inverse power iteration will converge?

85. Suppose that is a symmetric matrix with eigenvalues

a) To which of these eigenvalues will the power method converge? Why

b) To which of these eigenvalues will the inverse power iteration converge? Why?

c) To what eigenvalue the power iteration method applied to the matrix

will converge? Why?

86. Consider

(a) Find eigenvalues and eigenvectors of .

(b) Find eigenvalues and eigenvectors of

Note that you do not have to calculate explicitly.

Chapter FIVE

87. Given

on the interval , use the points , and .

a) Find the piecewise linear interpolation function

b) find the quadratic interpolation function

88. Consider
for
for .

Solve for so that the given function is a natural cubic spline from .

89. Use the theorems we studied in class to calculate the maximum error in interpolating the function by a polynomial of degree four using five equally spaced points on the interval .
90. Suppose you want to interpolate the function by a polynomial of degree by using equally spaced points on the interval . How many points should you use so that the difference between the sine function and your interpolation is less that ?

91. For a set of given data points , define the function

1. Show that

2. Show that the 'th Lagrange basis function can be expressed as

92. In general, is it possible to interpolate data points by a piecewise quadratic polynomial, with knots at a given data points, such that the interpolant is
• once continuously differentiable?
• twice continiously differentiable
93. What is the maximum number of points that can be interpolated by a piecewise quadratic polynomial that is twice continuously differentiable?

94. Consider the following data

1. Interpolate this data by a quadratic polynomial by using monomial interpolation
2. Interpolate this data by using Lagrange interpolation
3. Show that Lagrange interpolation reduces to monomial interpolation
95. The Gamma function has the following known values:

Use quadratic interpolation to determine the value approximate value of such that . HINT: Instead of using the data you may find it easier to use the data

96. Suppose that some measurements had produced the following data:

(i)

Write down second degree polynomial passing through all three points by using Lagrange interpolation

(ii)

Write down second degree polynomial passing through all three points by using Newton interpolation

(iii)

Show that the two polynomials obtained in (i) and (ii) are equivalent

97. Use appropriate Lagrange interpolating polynomial of to interpolate the following data:

What is the degree of interpolating polynomial? There is a catch in this question.

98. Consider the following data:

1. Interpolate this data by a quadratic polynomial by using monomial interpolation
2. Interpolate this data by using Lagrange interpolation
3. Show that Lagrange interpolation reduces to monomial interpolation
4. Interpolate this data by piece wise linear interpolation

99. Determine the parabola (interpolating polynomial of degree two) that interpolates the values of for

100. Find the clamped cubic spline , which goes through the points

with the value of the first derivative being equal to and at the beginning and the end of the domain, i.e.

101. Find the clamped cubic spline , which goes through the points

with the value of the first derivative being equal to and at the beginning and the end of the domain, i.e.

Consider the following function

Is a cubic spline for ? Make sure you justify your answer

102. Consider the logarithmic function evaluated at the points 1,2 and 3:

Write down the entries of the matrix and right hand side of the linear system that determines the coefficients for the cubic not-a-knot spline (variation: natural) interpolating these three points.

HINT: not-a-knot spline requires that the third derivative is continuous at the first and last points. Do not solve this system.

103. Suppose you were to define a piece-wise quadratic spline that interpolates given values

Write down in general form quadratic polynomials that interpolate these points, such that the resulting piece wise quadratic polynomial has continuous first derivative. How many additional conditions are required to make a square system for the coefficients of this quadratic spline?

104. This problem considers the function
 (15)

1. Is a cubic spline for ?
2. If it is a spline, it is natural, clamped, or neither?

105. This problem considers the function
 (16)

1. For what values of and , if any, is a cubil spline for ? These values are to be used for the rest of this problem.
2. What were the data points that give rise to this cubic spline?
3. for what values of and is a natural cubic spline?
4. for what values of and is a clamped cubic spine?
106. Suppose you are given 4 point:

• Is it possible to interpolate these points by piece-wise cubic polynomial with continuous first,second and third derivatives?
• Is it possible to interpolate these points by piece-wise cubic polynomial with continuous first,second, third and fourth derivatives?

107. a

Suppose that you would like to obtain a quadratic spline that interpolates the function between the nodes 0, and .

1. Write down the form of the spline interpolation function. How many coefficients need to be determined?
2. Write down the conditions that the spline must satisfy, and the corresponding equations for the coefficients. Do not solve the resulting equations.
3. Are there enough conditions? If not, what extra condition(s) would you recommend to make a best possible fit of ?

b Given a function on a discrete set of data points. Explain the difference between interpolation and approximation. What Is the difference between an interpolating polynomial of degree and an approximating polynomial of the same degree ?

108. Is it possible to interpolate three points

by a second order piece wise continious quadratic polynomial with continious first and second derivatives?

Is it possible to interpolate four points

by a second order piece wise continious quadratic polynomial with continious first and second derivatives?

109. Suppose that you would like to obtain a quadratic spline that interpolates the function between the nodes .

1. Write down the form of the spline interpolation function. How many coefficients need to be determined?
2. Write down the conditions that the spline must satisfy, and the corresponding equations for the coefficients. Do not solve the resulting equations.
3. Are there enough conditions? If not, what extra condition(s) would you recommend?

110. Suppose that you are given 4 experimental points: .

Is it possible to interpolate these 4 data points by piecewise quadratic polynomial with knots at these given data points, such that interpolant is

1. Once continuously differentialble?
2. Twice continuously differentialble?
3. Three times continuously differentialble?

In each case, if the answer is “yes” explain why, and outline the procedure to find the interpolating function (you may use short form of the equations, do not solve the resulting equations); if the answer is “no”, explain why.

111. In class we have studied cubic splines, i.e. interpolation by a piece wise cubic polynomial with continious first and second derivative. It is possible to also introduce quadratic spline, i.e. piece wise quadratic polynomial with continious first derivative. Such qudratic spline is the focus of this problem.q

Consider the same data:

Interpolate this data by piece wise quadratic polynomial with continious first and second derivative at a middle point.

Extra Credit, 30 percent Suppose that one additional point is added to the above data, so that there are four points.

Is it possible to interpolate this data by piece wise quadratic interpolation with continious first and second derivatives at the interior points? Is it possible to do it in general?

Chapter SIX

112. In class we have studied quadrature rules of the form

It appears that sometimes it is advantageous to derive quadratures which also use the derivatives of the function, in addition to value of the function at selected points. Find the weights for the quadrature

Chose the weights to maximize the precision of the quadrature. What is the order of the resulting quadrature?

Derive the error term of this quadrature.

113. In class we have studied quadrature rules of the form

It appears that sometimes it is advantageous to derive quadratures which also use the derivatives of the function, in addition to value of the function at selected points. Find the weights for the quadrature

Chose the weights to maximize the precision of the quadrature. What is the order of the resulting quadrature?

HINT Solution of this problem will be much easier if you guess the relationship between , , and .

Derive the error term of this quadrature.

114. Consider the qudrature rule of the form

Choose and to maximize the accuracy of the resulting quadrature. Calculate the truncation error of the resulting quadrature.

Is it more accurate or less accurate than Midpoint quadrature?

115. Given the points :

a) Evaluate the integral of the function using the midpoint rule

b) Evaluate the integral using Simpson's rule

c) Evaluate the integral using the trapezoid rule

116. (a) Consider the integration rule of the form

Choose and to maximise the precision of this quadrature rule 16 points

(b) Calculate truncation error of this quadrature.

117. This problem concerns using numerical methods to calculate the integral

Note that the exact value is

We are going to compare different ways to calculate this integral by using the value of the function on only three points, , and .

1. Using the composite trapezoidal rule, and 2 subintervals, find an approximate value for the integral. What is the error?
2. Using the Simpson rule on an interval find the approximate value of this integral. What is the error?
3. out of two methods used above, which one gives more accurate answer, and why? Make sure you justify your answer.
4. Extra Credit 10 percent Do the errors you obtained with Simpson and composite trapezoid above agree with the predictions given by the theorems we studied in class?

118. Let us denote

As you know, we can calculate the value of this integral analytically:

Calculate the value of this integral numerically by using

1. Modpoint method
2. Trapezoid method
3. Simpson method

Compare the result of your calculations with the exact value. Which of these four methods give the most accurate result? Is this consistent with your expectations?

119. (a) Consider the integration rule of the form

Choose and to maximise the precision of this quadrature rule 16 points

(b) Calculate truncation error of this quadrature.

120. Find 3-point Gaussian rule for if the standard 3-point Gaussian rule is given by

(b) The trapezoid rule has the error estimate

where If interval is divided into equal panels, show that the error of the composite trapezoid rule is bounded by

(c) Use the result in part (b) to determine the number of panels sufficient to approximate within to by using the composite trapezoid rule.

121. (a) (10 points) In the three point quadrature rule

choose , , , , and to maximize the precision of the quadrature rule. (The result will be three-point Gauss quadrature.)

(b) (5 points)What is the degree of the resulting scheme? Demonstrate this by showing the scheme correctly integrates a polynomial of that degree, and that it does not integrate correctly the polynomial of the degree of one order higher.

122. Find in

to maximize the precision of the quadrature. Find the error term of this quadrature.
123. In class we have studied the two point Gauss quadrature

Calculate the error term for this quadrature.

Hint Derivation is similar to calculation of the trapezoid error term we did in class. You will need to express via and its derivatives.

124. In class we have studied two point Gauss quadrature. In this problem you are to derive one point Gauss quadrature.

Consider the qudrature rule of the form

Choose and to maximize the order (accuracy) of the resulting quadrature. What is the truncation order of this quadrature?

125. Suppose that you have a tabular data, that is to say that the function is given only on the equidistant points , such that , . Propose a way to numerically evaluate

Chapter SEVEN

126. Find an approximation of that utilizes , , and .
127. You are producing a final project for your Master's Degree and need to solve Initial Value Problem numerically. You prefer to have accurate numerical solution. Out of Forward Euler, Backward Euler, Trapezoidal, Heun (RK2), and Runge-Kutta (RK4) method, which method would you choose and why?

128. Consider RK2 (Heun's) method:

Show that this method is second order accurate, i.e. it finds exact solution to the initial value problem

This can be done, for example, by showing that if at step the numerical solution is

then at step the numerical solution is equal to

which agrees with exact analytically solution

129. Derive an finite difference approximation to that uses , and . Calculate the truncation error term of the resulting finite difference approximation.

130. Find approximation of the first derivative that uses , and . What is the error term of your approximation?

131. For the equation consider the following numerical method

(a) Is this method explicit or implicit? Is it one-step or muti-step?
(b) Perform one step of the method for the equation
(c) Find the order of the method.

132. Consider the following -step method for solving

 (17)

1. What is the ”number of steps” for this method? Is this method explicit or implicit?
2. Determine and , for which the method has the highest possible accuracy.
3. Determine the order of the method of the highest possible accuracy in (18).
4. Determine the order of the method of the highest possible accuracy in (18).

SOLUTION Method of undetermined coefficients, is satisfied automatically, gives , gives . Solving equations we get second order accurate

133. Determine whether the method

with is stable for the equation with .

134. Suppose you want to solve numerically for using 100 time steps (so, ). The method to be tried are (i) the Euler method (ii) the backward Euler method (iii) the trapezoidal method (iv) the RK2 (Heun) method (v) the RK4 method.

(a) Which method do you expect to finish the calculation the fastests? Why?

(b) Which would be the second fastest method? Why?

(c) Which would be the most accurate method? Why?

(d) If stability is a concern, which method would be the best? Why?

135. This is general question. It is sufficient to give an answer with out proof.

Consider the following initial value problem

The following algorithm is proposed for its numerical solution:

1. Define the term stability for a numerical algorithm in the context of initial value problems for ODE's.
2. Determine if the above algorithm is stable, and if it is, what restrictions if any is implied on the size of step size for stability.
3. List one advantage and one disadvantage of the above algorithm over the Euler method.

136. Consider the following initial value problem:

Using the Euler method with calculate and 10 pt.

Is the proposed method numerically stable for the propsoed time step? 2 pt

Extra credit - 2 pt compare the result with the exact analytical solution.

137. computer the solution of

for using 100 time steps (i.e. with ). The methods to be tried are
1. The 2nd order Taylor method
2. RK4
3. Trapezoid method
.

1. Which one would you expect to complete the calculation the fastest? Why?
2. Which one would you expect to complete the calculation last Why?
3. Which one you expect to be more accurate? Why?
4. If stability is a concern, which meshod should be used? Why?

138. Suppose you want to solve numerically for using 100 time steps (so, ). The method to be tried are (i) the Euler method (ii) the backward Euler method (iii) the trapezoidal method (iv) the RK2 (Heun) method (v) the RK4 method.

(a) Which method do you expect to finish the calculation the fastests? Why?

(b) Which would be the second fastest method? Why?

(c) Which would be the most accurate method? Why?

(d) If stability is a concern, which method would be the best? Why?

139. IsHeun's method

stable for the equation with ?

140. Consider RK2 (Heun's) method:

Show that this method is second order accurate, i.e. it finds exact solution to the initial value problem

This can be done, for example, by showing that if at step the numerical solution is

then at step the numerical solution is equal to

which agrees with exact analytically solution

141. Consider the following initial value problem:

Using Taylor second order scheme, calculate with (i.e. calculate one time step).

( 4 points) Compare the result with the exact analytical solution.

142. State whether the following methods are (i) explicit or implicit (ii) single step or multi-step (iii) selfstarting or not. Cross out wrong statements and underline correct ones:

(i)explicit/implicit (ii)single step/multi-step (iii)selfstarting/not selfstarting.

(i)explicit/implicit (ii)single step/multi-step (iii)selfstarting/not selfstarting.

(i)explicit/implicit (ii)single step/multi-step (iii)selfstarting/not selfstarting.

143. The Bernoulli equation is

1. If the Forward Euler method is used to solve this equation, what is the resulting finite difference equation (i.e. equation expressing through )?
2. If the trapezoid method is used to solve this equation, what is the resulting finite difference equation?
3. If the RK2 method is used, what is the resulting finite difference equation?
4. If the RK4 method is used, what is the resulting finite difference equation?
144. Consider the fourth order RK method:

 (18) (19) (20) (21) (22) (23)

Apply this RK4 method for solving the equation

with initial condition

and show that the RK4 method is indeed at least fourth order accurate. This can be done, for example, by showing that if at step the numerical solution is

then at step the numerical solution is equal to

which agrees with exact analytically solution

145. Consider the fourth order RK method:

 (24) (25) (26) (27) (28) (29)

Apply this RK4 method for solving the equation

and show that this method is indeed fourth order accurate. This can be done, for example, by computing an amplification factor and comparing it to the analytic value .

Chapter EIGHT

146. Set up the linear least squares problem for fitting the model
to the four data points , , , .

147. Set up and solve the linear least squares system

for the fitting the model function

to the three data points

148. (a) Suppose you would like to fit the data points

by the fitting function

Find and by setting up a linear (overdetermined) least square problem and solving it.

(b) Also calculate the residual.

149. Suppose you measure as a function of and you get the following:

 0 2 1 1 2 -2 3 -1

Suppose you would like to fit this data by

Find and by setting up a linear (overdetermined) least square problem and solving it. Also calculate the residal.

150. Consider the data

Apporximate this data by a constant, i.e. find such that

is a good fit for this data.

1. Use least square method. As we have shown in class the least square method minimizes the square of the second norm of a residual, i.e. , where
2. Now minimize the fourth power of the fourth norm of a residual.
3. Compare the results and explain the difference.

151. Suppose that an experiment produced the following data:

You are to fit this data by using the linear fit

a Calculate the value of which minimized the square of the second norm of the residual

b Calculate and . Sketch , , and . Verify that . Is it so on your graph?

c Extra-credit, 5 points Obtain equation for that minimizes instead of traditional . Do not solve the resulting equation. What are the advantages and disadvantages of using instead of ?

152. Suppose that an experiment produced the following data:

You are to fit this data by using the linear fit

a Calculate the value of which minimized the square of the second norm of the residual

b Calculate and . Sketch , , and . Verify that . Is it so on your graph?

c Extra-credit, 5 points Obtain equation for that minimizes instead of traditional . Do not solve the resulting equation. What are the advantages and disadvantages of using instead of ?

153. Let A be the identity matrix,

Let the vector

Find the least squares solution of

and calculate the residual and its 2-norm.

154. Let A be the identity matrix

 (30)

Furthermore, let

Find the least squares solution of

and calculate the residual and its 2-norm.