You are on page 1of 23

Simisola O.

Oludare
MCS 471
Homework 1
Fall, 2016
Section 0.1
Problem 3
1
𝑃𝑃(𝑥𝑥) = 𝑥𝑥 6 − 4𝑥𝑥 4 + 2𝑥𝑥 2 + 1 𝑎𝑎𝑎𝑎 𝑥𝑥 =
2
Solution
To solve this problem, I will nest the polynomial by x2 which is the lowest multiplication
operation.
𝑃𝑃(𝑥𝑥) = 1 + 𝑥𝑥 2 (𝑥𝑥 4 − 4𝑥𝑥 2 + 2)
𝑃𝑃(𝑥𝑥) = 1 + 𝑥𝑥 2 (𝑥𝑥 2 �(𝑥𝑥 2 − 4) + 2�)
1 1 2 12 1 2
𝑃𝑃 � � = 1 + ( � � � �� � − 4� + 2�
2 2 2 2
1
𝑃𝑃 � � = 1.265625
2
C1
Use the nest function to solve the polynomial below at x = 1.00001. Find the error by comparing
(𝑥𝑥 51 −1)
with the equivalent expression 𝑄𝑄(𝑥𝑥) = (𝑥𝑥−1)

𝑃𝑃(𝑥𝑥) = 1 + 𝑥𝑥 + ⋯ + 𝑥𝑥 50
Solution
P (1.00001) = 51.1277
Q (1.00001) = 51.0128
|𝑃𝑃(𝑥𝑥)−𝑄𝑄(𝑥𝑥)| |51.1277−51.0128|
The relative error of the computation is 𝑄𝑄(𝑥𝑥)
= 51.0128
= 0.2%

1
Section 0.3
Problem 3
For which positive integers k can the number 5 + 2-k be represented exactly in double precision
floating point arithmetic?
Solution
For no rounding error, the integer will need to be at least less than 51 and greater than (or equal
to) 1 because the total number of integers cannot be greater than 52.

Problem 10
Decide whether 1+x > 1 in double precision floating point arithmetic, with Rounding to Nearest.
(a) x = 2-53 (b) x = 2-53 + 2-60.
Solution
(a) Yes. By rounding to the nearest, the floating point representation of 1+2-53 is equal to
1.000000000000000000000000000000000000000000000000001 × 2-52. This is greater
than 1.
(b) Yes. By rounding to the nearest, the floating point representation of 1+2-53+2-53 is equal to
1.000000000000000000000000000000000000000000000000001 × 2-52. This is greater
than 1.

2
Section 0.4
Problem 1
Identify for which values for x there is subtraction of nearly equal numbers, and find an alternate
form that avoids the problem.
Solution
1−sec(𝑥𝑥)
(a) The equation 𝑦𝑦 = 𝑡𝑡𝑡𝑡𝑡𝑡2 𝑥𝑥
has near equal subtractions at x = 0, 2πn where n are the
1 sec(𝑥𝑥)
integers. At these values, the equations 𝑡𝑡𝑡𝑡𝑡𝑡2 𝑥𝑥 and 𝑡𝑡𝑡𝑡𝑡𝑡2 𝑥𝑥 are both approaching the same
value. The rounding error due to subtraction of near equal numbers can be avoided by
−1
rewriting the subtraction as𝑦𝑦 = (1+sec(𝑥𝑥)).
1−(1−𝑥𝑥)3
(b) The equation has near equal subtractions at x = 0. At these values, the equations
𝑥𝑥
1 (1−𝑥𝑥)3
𝑥𝑥
and are both approaching infinity. The rounding error due to subtraction of near
𝑥𝑥
equal numbers can be avoided by rewriting the subtraction as 𝑦𝑦 = 𝑥𝑥 2 − 3𝑥𝑥 + 3.
1 1
(c) The equation 1+𝑥𝑥 − 1−𝑥𝑥 has near equal subtractions at x = 0. At these values, the
1 1
equations 1+𝑥𝑥 and 1−𝑥𝑥 are both approaching one. The rounding error due to subtraction of
−2𝑥𝑥
near equal numbers can be avoided by rewriting the subtraction as 𝑦𝑦 = 1−𝑥𝑥.

Problem 4
Prove that if b is negative and 4|ac| << b2 then the second root of a quadratic equation is best
2𝑐𝑐
calculated as 𝑥𝑥2 = 2
.
(−𝑏𝑏+√𝑏𝑏 −4𝑎𝑎𝑎𝑎

Solution
2𝑐𝑐 −𝑏𝑏−√𝑏𝑏2 −4𝑎𝑎𝑎𝑎
Show that = .
(−𝑏𝑏+√𝑏𝑏2 −4𝑎𝑎𝑎𝑎 2𝑎𝑎

2𝑐𝑐 −𝑏𝑏 − √𝑏𝑏 2 − 4𝑎𝑎𝑎𝑎


=
(−𝑏𝑏 + √𝑏𝑏 2 − 4𝑎𝑎𝑎𝑎 2𝑎𝑎
�−𝑏𝑏 + �𝑏𝑏 2 − 4𝑎𝑎𝑎𝑎� �−𝑏𝑏 + �𝑏𝑏 2 − 4𝑎𝑎𝑎𝑎� = 2𝑎𝑎 ∗ 2𝑐𝑐
4𝑎𝑎𝑎𝑎 = 4𝑎𝑎𝑎𝑎

3
Computer Problem 1
for i = 1:14
x(i) = 10^(-i);
y1(i) = (1-sec(x(i)))/(tan(x(i)).*tan(x(i)));
y2(i) = (-1)/(1+sec(x(i)));
y3(i) = (1-(1-x(i))^3)/x(i);
y4(i) = (x(i)^2) - 3*x(i) + (3);
end

sol1 = [x',y1',y2'];
sol2 = [x',y3',y4'];
(a)
x Original Revised
0.100000000000000 -0.498747913711435 -0.498747913711429
0.0100000000000000 -0.499987499790956 -0.499987499791664
0.00100000000000000 -0.499999875014289 -0.499999874999979
0.000100000000000000 -0.499999993627931 -0.499999998750000
1.00000000000000e-05 -0.500000041336852 -0.499999999987500
1.00000000000000e-06 -0.500044450290837 -0.499999999999875
1.00000000000000e-07 -0.510702591327569 -0.499999999999999
1.00000000000000e-08 0 -0.500000000000000
1.00000000000000e-09 0 -0.500000000000000
1.00000000000000e-10 0 -0.500000000000000
1.00000000000000e-11 0 -0.500000000000000
1.00000000000000e-12 0 -0.500000000000000
1.00000000000000e-13 0 -0.500000000000000
1.00000000000000e-14 0 -0.500000000000000

(b)
x Original Revised
0.100000000000000 2.71000000000000 2.71000000000000
0.0100000000000000 2.97010000000000 2.97010000000000
0.00100000000000000 2.99700100000000 2.99700100000000
0.000100000000000000 2.99970001000016 2.99970001000000
1.00000000000000e-05 2.99997000008379 2.99997000010000
1.00000000000000e-06 2.99999700004161 2.99999700000100
1.00000000000000e-07 2.99999969866072 2.99999970000001
1.00000000000000e-08 2.99999998176759 2.99999997000000
1.00000000000000e-09 2.99999991515421 2.99999999700000
1.00000000000000e-10 3.00000024822111 2.99999999970000
1.00000000000000e-11 3.00000024822111 2.99999999997000
1.00000000000000e-12 2.99993363483964 2.99999999999700
1.00000000000000e-13 3.00093283556180 2.99999999999970
1.00000000000000e-14 2.99760216648792 2.99999999999997

4
Computer Problem 3
a = 12345678987654321;
b = 123;

y = a + sqrt((a^2)+(b^2))

y = 2.4691e+16

5
Section 1.1
Problem 6
Using the bisection method starting with interval [2,-1] to find roots for 1/x, does the method
converge to a real number? Is it the root?
Solution

1/x
200

150

100

50

0
y

-50

-100

-150

-200
-2 -1.5 -1 -0.5 0 0.5 1
x

The function does not converge in that interval because f(-2)*f(1) is not less than 0.
Computer problem 2
Use the bisection to find the roots.

Solutions
%Program 1.1 Bisection Method
%Computes approximate solution of f(x)=0
%Input: inline function f; a,b such that f(a)*f(b)<0,
% and tolerance tol
%Output: Approximate solution xc
function xc = bisect(f,a,b,tol)
if sign(f(a))*sign(f(b)) >= 0
error('f(a)f(b)<0 not satisfied!') %ceases execution
end

6
fa=f(a);
fb=f(b);
k = 0;
while (b-a)/2>tol
c=(a+b)/2;
fc=f(c);
if fc == 0 %c is a solution, done
break
end
if sign(fc)*sign(fa)<0 %a and c make the new interval
b=c;fb=fc;
else %c and b make the new interval
a=c;fa=fc;
end
end
xc=(a+b)/2; %new midpoint is best estimate

Source: Numerical Analysis by Timothy Sauer


(http://wps.aw.com/aw_sauer_numerical_2/)
(a) x5 + x = 1

f=@(x) x^5 + x -1; bisect(f,0.6,0.9,0.5^-8)


y = 0.7500

(b) sin x = 6x + 5
f=@(x) sin(x)-(6*x)-5; bisect(f,-50,2,0.5^-8)
y = 24
(c) ln x + x2 = 3
f=@(x) log(x) + x^2 - 3; bisect(f,1.25,1.75,0.5^-8)
y = 1.500

7
Section 1.2
Problem 6

For which of the following is r = √5 not a fixed point.


Solution
These problems were all solved by substitution.
(a) Not a fixed point.
(b) A fixed point.
(c) Not a fixed point.
(d) A fixed point.

8
Section 1.4
Problem 8
Prove that Newton’s Method applied to 𝑓𝑓(𝑥𝑥) = 𝑎𝑎𝑎𝑎 + 𝑏𝑏 converges in one step.
Solution
By definition, Newton’s Method converges when the guessing error is equal to zero.
𝑓𝑓(𝑥𝑥 )
The guessing error, ei, is 𝑒𝑒𝑖𝑖 = |𝑥𝑥𝑖𝑖 − 𝑟𝑟|, where r is the root and 𝑥𝑥𝑖𝑖+1 = 𝑥𝑥𝑖𝑖+1 − 𝑓𝑓′(𝑥𝑥𝑖𝑖 ) for i = 0,1...n.
𝑖𝑖

𝑓𝑓(𝑥𝑥 )
For 𝑓𝑓(𝑥𝑥) = 𝑎𝑎𝑎𝑎 + 𝑏𝑏, 𝑓𝑓′(𝑥𝑥) = 𝑎𝑎 so 𝑓𝑓′(𝑥𝑥𝑖𝑖 ) is a constant which means that the 𝑥𝑥𝑖𝑖+1 does not change
𝑖𝑖

after the first step.

Computer Problem 2
Use Newton’s Method to approximate the root to eight correct decimal places.
Solution
To solve this problem, I will write a function which uses the equation, derivative and initial
guess as the inputs. The function will stop once the error is not greater than zero.
function root = newton_v2(equation, derivative, initial_guess)

root = initial_guess - (equation (initial_guess)/derivative(initial_guess));

err = root - initial_guess;

while err > 0


root = root - (equation (root)/derivative(root));
end

end

Sample run
equation = @(x) (x^5) + x -1;
derivative = @(x) 5*x^4 + 1;
r = newton_v2(equation,derivative,0.75);

(a) y = 0.7549
(b) y = 0.9710
(c) y = 1.5921.

9
Section 1.5
Computer problem 1
Use the secant method to find the single solution of the equation in Exercise 1.
Solution
I will use publicly available software
(https://www.mathworks.com/matlabcentral/fileexchange/36737-secant-
method/content/secant.m) which uses the function, the initial values and maximum error to
determine the root of the function.
Modified code to include initial condition for variable flag.
%% It will take function and initial value as the input of function.
% You would require to run it in command window as
% secant (@(x)(x^2 + x -9),2,3.5,0.001)
% where x^2 + x -9 is function, [2,3] initial values and 0.001 is maximum
% error tolerable.

function y = secant2(f,a,b,maxerr)

c = (a*f(b) - b*f(a))/(f(b) - f(a));


disp(' Xn-1 f(Xn-1) Xn f(Xn) Xn+1 f(Xn+1)');
disp([a f(a) b f(b) c f(c)]);
while abs(f(c)) > maxerr
a = b;
b = c;
c = (a*f(b) - b*f(a))/(f(b) - f(a));
disp([a f(a) b f(b) c f(c)]);
fla = 0;
fla = fla + 1;

if(fla == 100)
break;
end
end

display(['Root is x = ' num2str(c)]);


y = c;

(a) 1.7693
(b) 1.6728
(c) 1.1300

10
Simisola O. Oludare
MCS 471
Homework 2
Fall 2016
Section 2.2
Problem 2
Find the LU factorization of the given matrices. Check by matrix multiplication.
3 1 2
a) A = 6 3 4
3 1 5

4 2 0
b) A = 4 4 2
2 2 3

Solution

For both matrices, I will list the steps and present the final L and U matrices.
a)
1. Subtract 2 x Row 1 from Row 2
2. Subtract 1 x Row 1 from Row 3

1 0 0 3 1 2
L=2 1 0 U=0 1 0
1 0 1 0 0 3

Using Matlab, L*U = A.


b)
1. Subtract 1 x Row 1 from Row 2
2. Subtract 0.5 x Row 1 from Row 3
3. Subtract 0.5 x Row 2 from Row 3

1 0 0 4 2 0
L= 1 1 0 U=0 2 2
0.5 0.5 1 0 0 2
Problem 4
Solve the system by finding the LU factorization and then carrying out the two-step back
substitution.
Solution
For both problems:
Solve L*c = b for c
Solve U*x = c for x
1 0 0 3 1 2 0
a) L = 2 1 0 U=0 1 0 b=1
1 0 1 0 0 1 3
L*c = b
1 0 0 𝑐𝑐1 0
2 1 0 * 𝑐𝑐2 = 1
1 0 1 𝑐𝑐3 3
𝑐𝑐1 = 0
2𝑐𝑐1 + 𝑐𝑐2 = 1
𝑐𝑐2 = 1
𝑐𝑐1 + 𝑐𝑐3 = 1
𝑐𝑐3 = 3
U*x = c
3 1 2 𝑥𝑥1 0
0 1 0 𝑥𝑥2
* = 1
0 0 1 𝑥𝑥3 3
𝑥𝑥3 = 1
𝑥𝑥2 = 1
3𝑥𝑥1 + 𝑥𝑥2 + 2𝑥𝑥3 = 0
𝑥𝑥1 = - 1
1 0 0 4 2 0 2
a) L = 1 1 0 U=0 2 2 b=4
0.5 0.5 1 0 0 2 6
L*c = b
1 0 0 𝑐𝑐1 2
1 1 0* 𝑐𝑐2 = 4
0.5 0.5 1 𝑐𝑐3 6
𝑐𝑐1 = 2
𝑐𝑐1 + 𝑐𝑐2 = 4
𝑐𝑐2 = 2
0.5𝑐𝑐1 + 0.5𝑐𝑐2 + 𝑐𝑐3 = 6
𝑐𝑐3 = 4
U*x = c
4 2 0 𝑥𝑥1 2
0 2 2 𝑥𝑥2
* = 2
0 0 2 𝑥𝑥3 4
𝑥𝑥3 = 2
𝑥𝑥2 = −1
4𝑥𝑥1 + 2𝑥𝑥2 = 0
𝑥𝑥1 = 1
Computer Problems 1 and 2
Perform LU factorization and perform two-step back substitution.
Solution
Both problems were solved in one function. The LU factorization was done first iteratively. After
this, two-step back substitution was performed iteratively.
function x = gauss_lu(a,b)

[r,c] =size(a);
l = [1,0,0;0,1,0;0,0,1];
for j= 1:c-1
if abs(a(j,j))<eps;error('zero pivot encountered');end
for i = j + 1 :c
l(i,j) = a(i,j)/a(j,j);
for k = j+1:c
a(i,k) = a(i,k)- l(i,j)*a(j,k);
end
a(i,j) = a(i,j) - l(i,j)*a(j,j) ;
end
end

for i = 1:c-1
d(i) = b(i)/l(i,i);
for j = i+1: c
b(j) = b(j) - l(j,i)*d(i);
d(j) = b(j)/l(j,j);
end

end

% Back substitution step


for i = c:-1:1
for j = i+1: c
d(i) = d(i) - a(i,j)*x(j);
end
x(i) = d(i)/a(i,i);
end
Section 2.4
Problem 4a
Solve the system by finding the PA = LU factorization and carrying the two-step back
substitution
Solution
A*x = B
P*A*x = P*b
L*U*x = P*b
Put c = U*x
Solve L*c = P*b
4 2 0
A=4 2 2
2 2 3
R2 – R1
1 0 0 4 2 0
P1 = 0 1 0 A=0 0 2
0 0 1 2 2 3
R3 – (R1/2)
1 0 0 4 2 0
P1 = 0 1 0 A= 0 0 2
0 0 1 0 1 3
Exchange rows 2 and 3
1 0 0 4 2 0
P1 = 0 0 1 A= 0 1 3
0 1 0 0 0 2

L*c = P*b
1 0 0 𝑐𝑐1 1 0 0 2 2
0.5 1 0 * 𝑐𝑐2 = 0 0 1 *4=6
1 0 1 𝑐𝑐3 0 1 0 6 4
1 0 0 𝑐𝑐1 2
0.5 1 0 * 𝑐𝑐2 = 6
1 0 1 𝑐𝑐3 4
𝑐𝑐1 = 2
0.5𝑐𝑐1 + 𝑐𝑐2 = 6
𝑐𝑐2 = 5
𝑐𝑐1 + 𝑐𝑐3 = 4
𝑐𝑐3 = 2
U*x = c
4 2 0 𝑥𝑥1 2
0 1 3 * 𝑥𝑥2 =5
0 0 2 𝑥𝑥3 2

𝑥𝑥3 = 1
𝑥𝑥2 + 3𝑥𝑥2 = 5
𝑥𝑥2 = −1
4𝑥𝑥1 + 2𝑥𝑥2 = 2
𝑥𝑥1 = 1
Section 2.5
Computer Problem 2
Solve the sparse system within three correct decimal places. Report the number of steps needed
and the backward error.
Solution
To solve this problem, I will create the sparse matrix. Then use the jacobi.m function provided in
Numerical Analysis by Timothy Sauer to solve for x. Given that this function converges to a
solution which is accurate within six decimal places in 50 steps, I will use a 100 steps.
Additionally, I will modify the function so that it produces the backward error of each step.
Create the sparse matrix
function [a,b] = sparsesetup(n)
e = ones(n,1);
n2=n/2;
a = spdiags([e 2*e e],-1:1,n,n); % Entries of a
% c=spdiags([e/2],0,n,n);c=fliplr(c);a=a+c;
% a(n2+1,n2) = -1; a(n2,n2+1) = -1; % Fix up 2 entries
b=zeros(n,1); % Entries of r.h.s. b
b(1)=1;b(n)=-1;b(2:n-1)=0;b(n2:n2+1)=0;

[a, b] = sparsesetup(100);

Solve for x
function [x,e_cac] = jacobi(a,b,k)
n=length(b); % find n
d=diag(a); % extract diagonal of a
r=a-diag(d); % r is the remainder
x=zeros(n,1); % initialize vector x
e_cac = [];
for j=1:k % loop for Jacobi iteration

e = x;
x=(b-r*x)./d;
e = x - e;
e_cac = [e_cac,e];
end

[x,e] = jacobi(a,b,100000);

Error is attached in excel document


Computer Problem 3 and 4
Solve the sparse matrix below using the Gauss-Siedel and SOR iteration (w = 1.1)
Solution
To solve this problem, I will modify the function jacobi.m to carry out the Gauss-Siedel and
SOR iterations. These iterations will be carried out over six iterations.
%
% Inputs: full or sparse matrix a, r.h.s. b,
% number of GS iterations k
% Output: solution x
function x = gs(a,b,k)
n=length(b); % find n
d=diag(a); % extract diagonal of a

l = tril(a,-1);
u = triu(a,1);
x=zeros(n,1); % initialize vector x
for j=1:k % loop for Jacobi iteration
x=((b -(u*x))./d);
x = x./(ones(n,1)+(l*(1./d)));
end % End of Jacobi iteration loop

% Inputs: full or sparse matrix a, r.h.s. b,


% number of SOR iterations k
% Output: solution x
function x = sor(a,b,w,k)
n=length(b); % find n
d=diag(diag(a)); % extract diagonal of a

l = tril(a,-1);
u = triu(a,1);
x=zeros(n,1); % initialize vector x
for j=1:k % loop for Jacobi iteration
x = inv(w*l + d)*(((1-w)*d*x)-(w*u*x));
x = x + inv(w*l + d)*b
end % End of Jacobi iteration loop

a = sparsesetup_untouched(6);
b = [2.5;1.5;1;1;1.5;2.5];
x1 = gs(a,b,6);
x2 = sor(a,b,1.1,6);
y = [x1,x2];
GS SOR
X1 1 0.908052684041637
X2 1.00000000000000 0.908474422994430
X3 1.00000000000000 0.909495471633911
X4 1.00000000000000 0.909906335297540
X5 1 0.909916390791141
X6 1 0.909409945783310

I believe that the error in the SOR implementation is due to my use of inv.m. I will work to
remedy this error.
Section 5.1

Computer problem 2

Make a table and plot of the error of the three-point centered difference formula f’(1) where
f(x) = (1+x)-1.

Solution

To solve the problem, I will write a script which employs the three point centered formula at x=1
exp = 1:12;
for i = 1:length(exp)
h(i) = 10^-exp(i);
y_derivative(i) = ((1/(1+1+h(i))) - (1/(1+1-h(i))))/(2*h(i)) ;
error(i) = abs(-0.25 - y_derivative(i));
end

plot(h,error)
xlabel('h')
ylabel('error')
figure
plot(h,y_derivative)
xlabel('h')
ylabel('derivative')

h f’(1) Error
0.100000000000000 -0.250626566416040 0.000626566416040086
0.0100000000000000 -0.250006250156248 6.25015624833303e-06
0.00100000000000000 -0.250000062499978 6.24999776377422e-08
0.000100000000000000 -0.250000000625583 6.25583140845265e-10
1.00000000000000e-05 -0.250000000009965 9.96447369061571e-12
1.00000000000000e-06 -0.249999999979433 2.05666594865761e-11
1.00000000000000e-07 -0.249999999868411 1.31588961949092e-10
1.00000000000000e-08 -0.249999998480632 1.51936774273054e-09
1.00000000000000e-09 -0.250000020685093 2.06850927497726e-08
1.00000000000000e-10 -0.250000020685093 2.06850927497726e-08
1.00000000000000e-11 -0.250000020685093 2.06850927497726e-08
1.00000000000000e-12 -0.250022225145585 2.22251455852529e-05
Section 5.2

Computer problem 2

Apply the composite Simpon’s rule to the integrals in section 5.2 computer problem 1. Use m=
16 and m = 32, and report errors.

Solution

To solve this problem, I will write a function which takes the function, range, and m as inputs.
The outputs of the function will be the integral and the error.
function [integral, error] = csr(f,a,b, m)

h= (b-a)/(2*m);
y_0 = f(a);
y_end = f(b);

vec1 = [a:h:b-h];
for i = 1:length(vec1)
y_cac1(i) = f(vec1(i));
end

vec2 = [a:(h*2):b-(h*2)];
for j = 1:length(vec2)
y_cac2(j) = f(vec2(j));
end

integral = h/3*(sum([y_0,y_end,4*y_cac1(2:end),2*y_cac2(2:end)]));
syms x
exact = int(f(x),a,b);
error = double(exact) - integral;

end

To run:
f = @(x) x*exp(x);
a = 0; b = 1; m =32;
[i,e] = csr(f,a,b,m)

4 𝑥𝑥𝑥𝑥𝑥𝑥
1. ∫0 √𝑥𝑥 2 +9
a. M=16, exact = 2, integral = 3.2658, error -1.2658
b. M=32, exact = 2, integral = 3.2998, error = -1.2998
1 𝑥𝑥 3 𝑑𝑑𝑑𝑑
2. ∫0 𝑥𝑥 2 +1
a. M=16, exact = 0.1534, integral = 0.2455, error = -0.0921
b. M=32, exact = 0.1534, integral = 0.2506, error = -0.0971
1
3. ∫0 𝑥𝑥𝑒𝑒 𝑥𝑥 𝑑𝑑𝑑𝑑
a. M = 16, exact = 1, integral = 1.6110, error = -0.6110
b. M = 32, exact = 1, integral = 1.6386, error = -0.6386
3
4. ∫1 𝑥𝑥 2 ln 𝑥𝑥 𝑑𝑑𝑑𝑑
a. M = 16, exact = 6.9986, integral = 11.2598, error = -4.2612
b. M = 32, exact = 6.9986, integral = 11.4602, error = -4.4616
5.
a. M = 16, 5.8696, 9.7615, -3.8919
b. M = 32, 5.8696, 9.7774, -3.9078
6.
a. M=16, 2.5356, 4.1202, -1.5845
b. M = 32, 2.5356, 4.1731, -1.6375
7.
a. M = 16, 1.3170,2.1407,-0.8237
b. M = 32, 1.3170, 2.1678, -0.8509
8.
a. M = 16, 0.4407, 0.7195,-0.2788
b. M = 32, 0.4407, 0.7271, -0.2864

You might also like