Chapter 11, Problem 6. (*** solve in class ***)
Apply Cholesky decomposition to the symmetric matrix
In addition to solving for the Cholesky decomposition, employ it to solve for the a’s.
Chapter 11, Solution 6.
Thus, the Cholesky decomposition is
The solution can then be generated by first using forward substitution to modify the right-hand-side vector,
which can be solved for
Then, we can use back substitution to determine the final solution,
which can be solved for
Chapter 17, Problem 5.
Use least-squares regression to fit a straight line to
x / 6 / 7 / 11 / 15 / 17 / 21 / 23 / 29 / 29 / 37 / 39y / 29 / 21 / 29 / 14 / 21 / 15 / 7 / 7 / 13 / 0 / 3
Along with the slope and the intercept, compute the standard error of the estimate and the
correlation coefficient. Plot the data and the regression line. If someone made an
additional measurement of(x = 10, y = 10), would you suspect, based on a visual
assessment and the standard error, that the measurement was valid or faulty? Justify your
conclusion.
Chapter 17, Solution 5.
y = a0 + a1x
The results can be summarized as
At x = 10, the best fit equation gives 23.2543. The line and data can be plotted along with the point (10, 10).
The value of 10 is nearly 3 times the standard error away from the line,
23.2543 – 3(4.476306) = 9.824516
Thus, we can tentatively conclude that the value is probably erroneous. It should be noted that the field of statistics provides related but more rigorous methods to assess whether such points are “outliers.”
Chapter 17, Problem 8 (*** solve in class ***)
Fit the following data with (a) a saturation-growth-rate model, (b) a power equation, and (c) a parabola. In each case, plot the data and the equation.
x / 0.75 / 2 / 3 / 4 / 6 / 8 / 8.5y / 1.2 / 1.95 / 2 / 2.4 / 2.4 / 2.7 / 2.6
Chapter 17, Solution 8
(excel file contains the computational details).
Saturation Growth:
(a) We regress 1/y versus 1/x to give
Therefore, 3 = 1/a0 = 1/0.3415 = 2.9279 and 3 = a1*3 = 0.3693 *2.9279 = 1.0813, and the saturation-growth-rate model is
The model and the data can be plotted as
(b) Power Equation:
We regress log10(y) versus log10(x) to give
Therefore, 2 = 100.1533 = 1.4233 and 2 = 0.3114, and the power model is
The model and the data can be plotted as
(c) Polynomial regression can be applied to develop a best-fit parabola
Equations to be solved:
The model and the data can be plotted as
Chapter 18, Problem 6.(*** solve in class ***)
Repeat Probs. 18.1 through 18.3 using the Lagrange polynomial.
Chapter 18, Solution 6.
18.1
Estimatethecommonlogarithmof10 (log 10) usinglinearinterpolation.
x0 = 8f(x0) = 0.90309
x1 = 9f(x1) = 0.95424
x2 = 11f(x2) = 1.04139
x3 = 12f(x3) = 1.07918
18.1 (a): Interpolatebetween log8=0.9031 and log12=1.0792
x0 = 8f(x0) = 0.9031
x1 = 12f(x1) = 1.0792
18.1 (b): Interpolate between log 9 = 0.95424 and log 11 = 1.04139.
x0 = 9f(x0) = 0.95424
x1 = 11f(x1) = 1.04139
18.2:
Fit a second-order Lagrange polynomial to estimate log 10 using the data from Prob. 18.1 at
x = 8, 9, and 11.
x0 = 8f(x0) = 0.90309
x1 = 9f(x1) = 0.95424
x2 = 11f(x2) = 1.04139
18.3:
Fit a third-order Lagrange polynomial to estimate log 10 using the data from Prob. 18.1
x0 = 8f(x0) = 0.90309
x1 = 9f(x1) = 0.95424
x2 = 11f(x2) = 1.04139
x3 = 12f(x3) = 1.07918
Chapter 18, Problem 8.
Employ inverse interpolation using a cubic interpolating polynomial and bisection to determine the value of x that corresponds to f(x) = 0.23 for the following tabulated data:
x / 2 / 3 / 4 / 5 / 6 / 7f(x) / 0.5 / 0.3333 / 0.25 / 0.2 / 0.1667 / 0.1429
Chapter 18, Solution 8.
The following points are used to generate a cubic interpolating polynomial
x0 = 3f(x0) = 0.3333
x1 = 4f(x1) = 0.25
x2 = 5f(x2) = 0.2
x3 = 6f(x3) = 0.1667
The polynomial can be generated in a number of ways including Newton’s Divided Difference Interpolating Polynomials.
i / xl / f(xl) / First / Second / Third0 / 3 / 0.3333 / -0.0833 / 0.01665 / -0.0027
1 / 4 / 0.25 / -0.05 / 0.00835
2 / 5 / 0.2 / -0.0333
3 / 6 / 0.1667
The result is:
f3(x) = 0.3333 + (x-3)(-0.0833) + (x-3)(x-4)(0.01665) + (x-3)(x-4)(x-5)(-0.0027)
If we simplify the above expression, we get:
The roots problem can then be developed by setting this polynomial equal to the desired value of 0.23
Bisection can then be used to determine the root. Using initial guesses of xl = 4 and xu = 5, the first five iterations are
i / xl / xu / xr / f(xl) / f(xr) / f(xl)f(xr) / a1 / 4.00000 / 5.00000 / 4.50000 / 0.02000 / -0.00811 / -0.00016 / 11.11%
2 / 4.00000 / 4.50000 / 4.25000 / 0.02000 / 0.00504 / 0.00010 / 5.88%
3 / 4.25000 / 4.50000 / 4.37500 / 0.00504 / -0.00174 / -0.00001 / 2.86%
4 / 4.25000 / 4.37500 / 4.31250 / 0.00504 / 0.00160 / 0.00001 / 1.45%
5 / 4.31250 / 4.37500 / 4.34375 / 0.00160 / -0.00009 / 0.00000 / 0.72%
If the iterations are continued, the final result is x = 4.34213.
Chapter 21, Problem 4.
Integrate the following function analytically and using the trapezoidal rule,
with n = 1, 2, 3, and 4:
Use the analytical solution to compute true percent relative errors to evaluate the accuracy of the trapezoidal approximations.
Chapter 21, Solution 4.
Analytical solution:
Trapezoidal rule for n :
For (n=1): I = t= (9-8.33333)/8.33333 = 8 %
For (n=2): I = (2-1)/4 [ 9+9+ 2*(1.5 + 2/1.5)2 ] = 8.513889
t= (8.5138-8.3333)/8.3333 = 2.16%
The results are summarized below:
n / Integral / t1 / 9 / 8%
2 / 8.513889 / 2.167%
3 / 8.415185 / 0.982%
4 / 8.379725 / 0.557%
Let’s apply Richardson’s Extrapolation to these results and see what kind of improvement we get for the error:
n / I with O(h2) / I with O(h4) / I with O(h6) / t1 / 9 / 8.3517 / 8.3338 / 0.006 %
2 / 8.513889 / 8.3349
3 / 8.415185
4 / 8.379725
Chapter 13, Problem 9.
Employ the following methods to find the maximum of the function
(a)Golden-section search (, , ).
(c)Newton’s method (, ).
Chapter 13, Solution 9.
(a) First, the golden ratiocan be used to create the interior points,
The function can be evaluated at the interior points
Because f(x1) > f(x2), the maximum is in the interval defined by x2, x1 and xu where x1 is the optimum. The error at this point can be computed as
The process can be repeated and all the iterations summarized as
i / xl / f(xl) / x2 / f(x2) / x1 / f(x1) / xu / f(xu) / d / xopt / a1 / -2 / -22 / -0.8541 / -0.851 / -0.1459 / 0.565 / 1 / -16.000 / 1.8541 / -0.1459 / 785.41%
2 / -0.8541 / -0.851 / -0.1459 / 0.565 / 0.2918 / -2.197 / 1 / -16.000 / 1.1459 / -0.1459 / 485.41%
3 / -0.8541 / -0.851 / -0.4164 / 0.809 / -0.1459 / 0.565 / 0.2918 / -2.197 / 0.7082 / -0.4164 / 105.11%
4 / -0.8541 / -0.851 / -0.5836 / 0.475 / -0.4164 / 0.809 / -0.1459 / 0.565 / 0.4377 / -0.4164 / 64.96%
5 / -0.5836 / 0.475 / -0.4164 / 0.809 / -0.3131 / 0.833 / -0.1459 / 0.565 / 0.2705 / -0.3131 / 53.40%
6 / -0.4164 / 0.809 / -0.3131 / 0.833 / -0.2492 / 0.776 / -0.1459 / 0.565 / 0.1672 / -0.3131 / 33.00%
7 / -0.4164 / 0.809 / -0.3525 / 0.841 / -0.3131 / 0.833 / -0.2492 / 0.776 / 0.1033 / -0.3525 / 18.11%
8 / -0.4164 / 0.809 / -0.3769 / 0.835 / -0.3525 / 0.841 / -0.3131 / 0.833 / 0.0639 / -0.3525 / 11.19%
9 / -0.3769 / 0.835 / -0.3525 / 0.841 / -0.3375 / 0.840 / -0.3131 / 0.833 / 0.0395 / -0.3525 / 6.92%
10 / -0.3769 / 0.835 / -0.3619 / 0.839 / -0.3525 / 0.841 / -0.3375 / 0.840 / 0.0244 / -0.3525 / 4.28%
11 / -0.3619 / 0.839 / -0.3525 / 0.841 / -0.3468 / 0.841 / -0.3375 / 0.840 / 0.0151 / -0.3468 / 2.69%
12 / -0.3525 / 0.841 / -0.3468 / 0.841 / -0.3432 / 0.841 / -0.3375 / 0.840 / 0.0093 / -0.3468 / 1.66%
13 / -0.3525 / 0.841 / -0.3490 / 0.841 / -0.3468 / 0.841 / -0.3432 / 0.841 / 0.0058 / -0.3468 / 1.03%
14 / -0.3490 / 0.841 / -0.3468 / 0.841 / -0.3454 / 0.841 / -0.3432 / 0.841 / 0.0036 / -0.3468 / 0.63%
(c) The first and second derivatives of the function can be evaluated as
which can be substituted into Eq. (13.8) to give
which has a function value of 0.787094. The second iteration gives –0.34656, which has a function value of 0.840791. At this point, an approximate error can be computed as a = 128.571%. The process can be repeated, with the results tabulated below:
i / x / f(x) / f'(x) / f"(x) / a0 / -1 / -2 / 9 / -16
1 / -0.4375 / 0.787094 / 1.186523 / -13.0469 / 128.571%
2 / -0.34656 / 0.840791 / -0.00921 / -13.2825 / 26.242%
3 / -0.34725 / 0.840794 / -8.8E-07 / -13.28 / 0.200%
Thus, within three iterations, the result is converging on the true value of
f(x) = 0.840794 at x = –0.34725.