0% found this document useful (0 votes)
319 views24 pages

Solucionario Metodos Numericos V 3

This document is a sample student solutions manual for the numerical methods textbook "Numerical Methods, Third Edition" by Faires and Burden. It contains worked out solutions to exercises from Chapter 1 on mathematical preliminaries and error analysis. The full student solutions manual would contain solutions for exercises throughout the entire textbook. It is intended to help students learn the techniques without having to solve all the problems by hand. The publisher's website is provided for purchasing the full manual.
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
319 views24 pages

Solucionario Metodos Numericos V 3

This document is a sample student solutions manual for the numerical methods textbook "Numerical Methods, Third Edition" by Faires and Burden. It contains worked out solutions to exercises from Chapter 1 on mathematical preliminaries and error analysis. The full student solutions manual would contain solutions for exercises throughout the entire textbook. It is intended to help students learn the techniques without having to solve all the problems by hand. The publisher's website is provided for purchasing the full manual.
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 24

Sample

Student Solutions Manual


to accompany
NUMERICAL METHODS, Third Edition
J. Douglas Faires and Richard L. Burden
Youngstown State University
September 22, 2002
ii
Contents
1 Mathematical Preliminaries 1
EXERCISE SET 1.2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
EXERCISE SET 1.3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
EXERCISE SET 1.4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
iii
iv CONTENTS
This is a Sample of the Student Solutions Manual for Numerical Methods, Third
Edition, by Faires and Burden. It contains worked out exercises for all the techniques
discussed in the rst Chapter of the book. The full Student Solutions Manual contains
worked out exercises for all the techniques discussed in the entire book. The answers
to the odd exercises are in the back of the text, but the results listed in this Study
Guide go well beyond the answers listed in the text, and the exercises that are solved
in this Student Solutions Manual were carefully chosen as those requiring insight into
the methods presented in the text.
In addition to the solutions to numerous exercises, the Student Solutions Manual
contains a listing of the instructions for the program disk that accompanies Numerical
Methods, together with a copy of the CD that contains the programs in the program-
ming languages C, Pascal, and FORTRAN and for the Computer Algebra Systems
Maple, Mathematica, and Matlab. These programs can be extremely valuable in your
study of approximation techniques since they permit you to see the calculations that
need to be performed without the necessity of performing the calculations by hand.
If you are interested in obtaining the entire Student Solutions Manual, it can likely
be obtained at your local bookstore. If not, you can obtain a copy from the publisher
at
http://www.brookscole.com/math d/
J. Douglas Faires
[email protected]
Richard L. Burden Youngstown State University
[email protected] September 22, 2002
Chapter 1
Mathematical Preliminaries and
Error Analysis
EXERCISE SET 1.2 (Page 13 )
1. d. Show that the equation
x (ln x)
x
= 0
has at least one solution in the interval [4, 5].
Solution: It is not possible to algebraically solve for the solution x, but this is not
required in the problem, we must only show that a solution exists. Let
f (x) = x (ln x)
x
= x exp(x(ln(ln x))).
Since f is continuous on [4, 5] with f (4) 0.3066 and f (5) 5.799, the Interme-
diate Value Theorem implies that a number x must exist in (4, 5) with
0 = f (x) = x (ln x)
x
.
2. c. Find intervals that contain a solution to
x
3
2x
2
4x + 3 = 0.
1
2 CHAPTER 1. MATHEMATICAL PRELIMINARIES
Solution: Let
f (x) = x
3
2x
2
4x + 3.
The critical points of f occur when
0 = f

(x) = 3x
2
4x 4 = (3x + 2)(x 2),
that is, when x =
2
3
and x = 2. Relative maximum and minimum values of f
can occur only at these values. There are at most three solutions to f (x) = 0, since
f (x) is a polynomial of degree three. Since f (2) = 5 and f (1) = 4; f (0) = 3
and f (1) = 2 and f (2) = 5 and f (4) = 19, solutions lie in the intervals [2, 1],
[0, 1], and [2, 4].
4. a. Find max
0x1
| f (x)| when
f (x) =
2 e
x
+ 2x
3
.
Solution: First note that
f

(x) = (e
x
+ 2)/3
so the only critical point of f occurs at x = ln 2, which lies in the interval [0, 1]. The
maximum for | f (x)| must consequently be
max{| f (0)|, | f (ln 2)|, | f (1)|} =max{1/3, (2 ln 2)/3, (4 e)/3}
=(2 ln 2)/3 0.4620981.
7. Find the second Taylor polynomial for
f (x) = e
x
cos x
about x
0
= 0.
Solution: Since
f

(x) = e
x
(cos x sin x), f

(x) = 2e
x
(sin x),
and
f

(x) = 2e
x
(sin x + cos x),
we have f (0) = 1, f

(0) = 1, and f

(0) = 0. So
P
2
(x) = 1 + x and R
2
(x) =
2e

(sin + cos )
3!
x
3
.
EXERCISE SET 1.2 3
a. Use P
2
(0.5) to approximate f (0.5), nd an upper bound for
| f (0.5) P
2
(0.5)|,
and compare this to the actual error.
Solution: P
2
(0.5) = 1 + 0.5 = 1.5 and
| f (0.5) P
2
(0.5)| max
[0.0.5]

2e

(sin + cos )
3!
(0.5)
2

1
3
(0.5)
2
max
[0,0.5]
|e

(sin + cos )|.


To maximize this quantity on [0, 0.5], rst note that
D
x
e
x
(sin x + cos x) = 2e
x
cos x > 0
for all x in [0, 0.5]. This implies that the maximum and minimum values of e
x
(sin x +
cos x) on [0, 0.5] occur at the endpoints of the interval, and
e
0
(sin 0 + cos 0) = 1 < e
0.5
(sin 0.5 + cos 0.5) 2.2373.
Hence
| f (0.5) P
2
(0.5)|
1
3
(0.5)
3
(2.273) 0.093222.
Since P
2
(0.5) = 1.5 and f (0.5) = 1.446889, the actual error is 0.053111.
b. Find a bound for the error | f (x) P
2
(x)|| for x in [0, 1]
Solution: A similar analysis to that in part (a) gives
| f (x) P
2
(x)|
1
3
(1.0)
3
e
1
(sin 1 + cos 1) 1.252.
c. Approximate
_
1
0
f (x) dx using
_
1
0
P
2
(x) dx.
4 CHAPTER 1. MATHEMATICAL PRELIMINARIES
Solution:
_
1
0
f (x) dx
_
1
0
1 + x dx =
_
x +
x
2
2
_
1
0
= 1.5.
d. Find an upper bound for the error in part (c).
Solution: From part (b),
_
1
0
|R
2
(x)| dx
_
1
0
1
3
e
1
(cos 1 + sin 1)x
3
dx =
_
1
0
1.252x
3
dx = 0.313.
Since
_
1
0
e
x
cos x dx =
_
e
x
2
(cos x + sin x)
_
1
0
=
e
2
(cos 1 + sin 1)
1
2
(1 + 0) 1.378,
the actual error is |1.378 1.5| 0.12.
9. Use the error term of a Taylor polynomial to estimate the error involved
in using
sin x x
to approximate sin 1

.
Solution: First we need to convert the degree measure for the sine function to radians.
We have 180

= radians, so 1

=

180
radians. Since,
f (x) = sin x, f

(x) = cos x, f

(x) = sin x, and f

(x) = cos x,
we have f (0) = 0, f

(0) = 1, and f

(0) = 0. The approximation sin x x is given by
f (x) P
2
(x), and R
2
(x) =
cos
3!
x
3
.
If we use the bound | cos | 1, then

sin

180


180

R
2
_

180
_

cos
3!
_

180
_
3

8.86 10
7
.
11. a. Let
f (x) = e
x/2
sin
x
3
.
Use Maple to determine the third Maclaurin polynomial P
3
(x).
EXERCISE SET 1.2 5
Solution: Dene f (x) with
>f:=exp(x/2)*sin(x/3);
f := e
(1/2x)
sin
_
1
3
x
_
Find the rst three terms of the Taylor series with
>g:=taylor(f,x=0,4);
g :=
1
3
x +
1
6
x
2
+
23
648
x
3
+ O(x
4
)
Extract the third Maclaurin polynomial with
>p3:=convert(g,polynom);
p3 :=
1
3
x +
1
6
x
2
+
23
648
x
3
b. Determine f
(4)
(x), and bound the error | f (x) P
3
(x)| on [0, 1].
Solution: First we determine the fourth derivative.
>f4:=diff(f,x,x,x,x);
f 4 :=
119
1296
e
(x/2)
sin
_
1
3
x
_
+
5
54
e
(x/2)
cos
_
1
3
x
_
Next we nd the fth derivative.
>f5:=diff(f4,x);
f 5 :=
199
2592
e
(x/2)
sin
_
1
3
x
_
+
61
3888
e
(x/2)
cos
_
1
3
x
_
Then we see if the fourth derivative has any critical points in [0, 1].
>p:=fsolve(f5=0,x,0..1);
p := .6047389076
The extreme values of the fourth derivative will occur at x = 0, 1, or p.
>c1:=evalf(subs(x=p,f4));
c1 := .09787176213
6 CHAPTER 1. MATHEMATICAL PRELIMINARIES
>c2:=evalf(subs(x=0,f4));
c2 := .09259259259
>c3:=evalf(subs(x=1,f4));
c3 := .09472344463
The maximum absolute value of f
(4)
(x) is c
1
and the error is given by
>err:=c1/24;
err := .004077990089
EXERCISE SET 1.3 (Page 20 )
3. e. Use three-digit rounding arithmetic to compute
13
14

6
7
2e 5.4
and determine the absolute and relative errors.
Solution: Using three-digit rounding arithmetic gives
13
14
= 0.929,
6
7
= 0.857, and
e = 2.72. So
13
14

6
7
= 0.0720 and 2e 5.4 = 5.44 5.40 = 0.0400.
Hence,
13
14

6
7
2e 5.4
=
0.0720
0.0400
= 1.80.
The correct value is approximately 1.954, so the absolute and relative errors to three
digits are
|1.80 1.954| = 0.154 and
|1.80 1.954|
1.954
= 0.0788,
respectively.
EXERCISE SET 1.3 7
7. a. Use the rst three terms of the Maclaurin series for the arctangent function
to approximate
= 4
_
arctan
1
2
+ arctan
1
3
_
and determine the absolute and relative errors.
Solution: Let P(x) = x
1
3
x
3
+
1
5
x
5
. Then P
_
1
2
_
= 0.464583 and P
_
1
3
_
= 0.3218107,
so
= 4
_
arctan
1
2
+ arctan
1
3
_
3.145576.
The absolute and relative errors are, respectively,
| 3.145576| 3.983 10
3
and
| 3.145576|
||
1.268 10
3
.
10. The Taylor polynomial of degree n for
f (x) = e
x
is
n

i =0
x
i
i !
.
Use the Taylor polynomial of degree nine and three-digit chopping
arithmetic to nd an approximation to e
5
by each of the following
methods. Which formula, (a) or (b), gives the most accuracy, and
why?
a. e
5

i =0
(5)
i
i !
=
9

i =0
(1)
i
5
i
i !
Solution: The Taylor polynomial of degree nine gives
e
5

i =0
(1)
i
5
i
i !
= 1 5 +
25
2

125
6
+
625
24

3120
120
+
15600
720

78000
5040
+
390000
40300

1950000
362000
8 CHAPTER 1. MATHEMATICAL PRELIMINARIES
= 1 5 + 12.5 20.8 + 26.0 26.0 + 21.6 15.4 + 9.67 5.38
= 1.81
b. e
5
=
1
e
5

1

9
i =0
5
i
i !
.
Solution: The reciprocal of the Taylor polynomial of degree nine gives
e
5

9
i =0
5
i
i !
=
1
1 + 5 + 12.5 + 20.8 + 26.0 + 26.0 + 21.6 + 15.4 + 9.67 + 5.38
=
1
141
= 7.09 10
3
An approximate value of e
5
correct to three digits is 6.74 10
3
. Part (b) is more
accurate since subtraction is not involved.
11. A rectangular parallelepiped has sides 3 cm, 4 cm, and 5 cm, measured
to the nearest centimeter.
Solution: Let the sides be x, y, and z, and suppose that the measurements give
x

= 3 cm, y

= 4 cm, and z

= 5 cm. Since the measurements are accurate to the


nearest centimeter, it follows that the actual values satisfy the inequalities
2.5 x 3.5, 3.5 y 4.5, and 4.5 z 5.5
a. What are the best upper and lower bounds for the volume of this paral-
lelepiped?
Solution: Since the volume is V = xyz we have
(2.5)(3.5)(4.5) V (3.5)(4.5)(5.5) and 39.375 V 86.625
b. What are the best upper and lower bounds for the surface area?
Solution: Since the surface area is S = 2xy + 2xz + 2yz we have
2(2.5)(3.5) + 2(2.5)(4.5) + 2(3.5)(4.5) S
EXERCISE SET 1.4 9
and
S 2(3.5)(4.5) + 2(3.5)(5.5) + 2(4.5)(5.5),
so 71.5 S 119.50.
EXERCISE SET 1.4 (Page 27 )
1. c. (i) Use four-digit rounding arithmetic and the formulas of Example 1 to
nd the most accurate approximations to the roots of
1.002x
2
11.01x + 0.01265 = 0.
(ii) Compute the absolute error and relative error.
Solution: Since b = 11.01 is negative, we use the formulas
x
1
=
b +

b
2
4ac
2a
and x
2
=
2c
b

b
2
4ac
to avoid the subtraction of nearly equal numbers. Using four-digit rounding arithmetic
gives
x
1
=
b +

b
2
4ac
2a
=
(11.01) +
_
(11.01)
2
4(1.002)(0.01265)
2a
=
11.01 +

121.2 4.008(0.01265)
2.004
=
11.01 +

121.2 0.05070
2.004
=
11.01 +

121.1
2.004
=
11.01 + 11.00
2.004
=
22.01
2.004
= 10.98
The actual root is 10.98687488, so the absolute error is |10.98687488 10.98| =
6.87488 10
3
, and the relative error is
6.87488 10
3
10.98687488
= 6.25736 10
4
.
Also,
x
2
=
2c
b

b
2
4ac
=
2(0.01265)
11.01
_
(11.01)
2
4(1.002)(0.01265)
10 CHAPTER 1. MATHEMATICAL PRELIMINARIES
=
0.02530
11.01 11.00
=
0.02530
22.01
= 0.001149.
The actual root is 0.001149076 so the absolute error of this approximation is
|0.001149076 0.001149| = 7.566 10
8
,
and the relative error is
7.566 10
8
0.001149076
= 6.5844 10
5
.
2. c. Repeat Exercise 1 using four-digit chopping arithmetic.
Solution: Since b = 11.01 is negative, we use the formulas
x
1
=
b +

b
2
4ac
2a
and x
2
=
2c
b

b
2
4ac
to avoid the subtraction of nearly equal numbers. Using four-digit chopping arithmetic
gives
x
1
=
b +

b
2
4ac
2a
=
(11.01) +
_
(11.01)
2
4(1.002)(0.01265)
2a
=
11.01 +

121.2 4.008(0.01265)
2.004
=
11.01 +

121.2 0.05070
2.004
=
11.01 +

121.1
2.004
=
11.01 + 11.00
2.004
=
22.01
2.004
= 10.98
The actual root is 10.98687488, so the absolute error is |10.98687488 10.98| =
6.87488 10
3
, and the relative error is
6.87488 10
3
10.98687488
= 6.25736 10
4
.
Also,
x
2
=
2c
b

b
2
4ac
=
2(0.01265)
11.01
_
(11.01)
2
4(1.002)(0.01265)
=
0.02530
11.01 11.00
=
0.02530
22.01
= 0.001149.
EXERCISE SET 1.4 11
The actual root is 0.001149076 so the absolute error of this approximation is
|0.001149076 0.001149| = 7.566 10
8
,
and the relative error is
7.566 10
8
0.001149076
= 6.5844 10
5
.
5. The fth Maclaurin polynomials for e
2x
and e
2x
are
P
5
(x) =
____
4
15
x +
2
3
_
x +
4
3
_
x + 2
_
x + 2
_
x + 1
and

P
5
(x) =
____

4
15
x +
2
3
_
x
4
3
_
x + 2
_
x 2
_
x + 1
a. Approximate e
0.98
using

P
5
(0.49) and four-digit rounding arithmetic.
Solution: Using four-digit rounding arithmetic to evaluate

P
5
(0.49) gives

P
5
(0.49) = (((((0.2667)(0.49) + 0.6667)(0.49) 1.333)(0.49) + 2)(0.49)
2)(0.49) + 1
= ((((0.1307 + 0.6667)(0.49) 1.333)(0.49) + 2)(0.49)
2)(0.49) + 1
= ((((0.5360)(0.49) 1.333)(0.49) + 2)(0.49) 2)(0.49) + 1
= (((0.2626 1.333)(0.49) + 2)(0.49) 2)(0.49) + 1
= (((1.070)(0.49) + 2)(0.49) 2)(0.49) + 1
= (((0.5243) + 2)(0.49) 2)(0.49) + 1
= ((1.476)(0.49) 2)(0.49) + 1
= (0.7232 2)(0.49) + 1
= (1.277)(0.49) + 1
= 0.6257 + 1
= 0.3743
12 CHAPTER 1. MATHEMATICAL PRELIMINARIES
b. Compute the absolute and relative error for the approximations in part
(a).
Solution: The absolute error is |e
0.98
0.3743| = 1.011 10
3
, and the relative
error is
1.011 10
3
e
0.98
= 2.694 10
3
.
c. Approximate e
0.98
using 1/P
5
(0.49) and four-digit rounding arithmetic.
Solution: We have
1
P
5
(0.49)
=
1
(((((0.2667)(0.49) + 0.6667)(0.49) + 1.333)(0.49) + 2)(0.49) + 2)(0.49) + 1
=
1
2.663
= 0.3755.
d. Compute the absolute and relative errors for the approximations in part
(c).
Solution: The absolute error is
|e
0.98
0.3755| = 1.889 10
4
,
and the relative error is
1.889 10
4
e
0.98
= 5.033 10
4
.
6. a. Show that the polynomial nesting technique can be used to evaluate
f (x) = 1.01e
4x
4.62e
3x
3.11e
2x
+ 12.2e
x
1.99.
Solution: Since e
nx
= (e
x
)
n
, we can write
f (x) = ((((1.01)e
x
4.62)e
x
3.11)e
x
+ 12.2)e
x
1.99.
EXERCISE SET 1.4 13
b. Use three-digit rounding arithmetic and the formula given in the state-
ment of part (a) to evaluate f (1.53).
Solution: Using e
1.53
= 4.62 and three-digit rounding gives e
2(1.53)
= (4.62)
2
=
21.3, e
3(1.53)
= (4.62)
2
(4.62) = (21.3)(4.62) = 98.4, and e
4(1.53)
= (98.4)(4.62) = 455.
So
f (1.53) = 1.01(455) 4.62(98.4) 3.11(21.3) + 12.2(4.62) 1.99
= 460 455 66.2 + 56.4 1.99
= 5.00 66.2 + 56.4 1.99
= 61.2 + 56.4 1.99 = 4.80 1.99 = 6.79.
c. Redo the calculations in part (b) using the nesting form of f (x) that was
found in part (a).
Solution:
f (1.53) = (((1.01)4.62 4.62)4.62 3.11)4.62 + 12.2)4.62 1.99
= (((4.67 4.62)4.62 3.11)4.62 + 12.2)4.62 1.99
= ((0.231 3.11)4.62 + 12.2)4.62 1.99
= (13.3 + 12.2)4.62 1.99 = 7.07.
d. Compare the approximations in parts (b) and (c).
Solution: The exact result is 7.61, so the absolute errors in parts (b) and (c) are,
respectively, | 6.79 + 7.61| = 0.82 and | 7.07 + 7.61| = 0.54. The relative errors
are, respectively, 0.108 and 0.0710.
14 CHAPTER 1. MATHEMATICAL PRELIMINARIES
7. Use three-digit chopping arithmetic to compute the sum
10

i =1
1
i
2
rst by
1
1
+
1
4
+ +
1
100
and then by
1
100
+
1
81
+ +
1
1
,
adding left to right. Which method is more accurate, and why?
Solution: Using three-digit chopping arithmetic on

10
i =1
1
i
2
in the order 1+
1
4
+ +
1
100
gives
1.00 + 0.250 + 0.111 + 0.0625 + 0.0400 + 0.0277
+ 0.0204 + 0.0156 + 0.0123 + 0.0100
= 1.25 + 0.111 + 0.0625 + 0.0400 + 0.0277 + 0.0204 + 0.0156 + 0.0123 + 0.0100
= 1.36 + 0.0625 + 0.0400 + 0.0277 + 0.0204 + 0.0156 + 0.0123 + 0.0100
= 1.42 + 0.0400 + 0.0277 + 0.0204 + 0.0156 + 0.0123 + 0.0100
= 1.46 + 0.0277 + 0.0204 + 0.0156 + 0.0123 + 0.0100
= 1.48 + 0.0204 + 0.0156 + 0.0123 + 0.0100
= 1.50 + 0.0156 + 0.0123 + 0.0100
= 1.51 + 0.0123 + 0.0100
= 1.52 + 0.0100
= 1.53.
In the reverse order we sum
1
100
+
1
81
+ +
1
4
+ 1 as
0.0100+.0123+0.0156+0.0204+0.0277+0.0400+0.0625+0.111+0.25+1.00 = 1.54
The actual value is 1.549. The problem of adding a very small number to an accumu-
lated sum causes signicant round-o errors in the rst method.
EXERCISE SET 1.4 15
8. a. Determine the number n of terms of the series
arctan x = lim
n
P
n
(x) =

i =1
(1)
i +1
x
2i 1
(2i 1)
that are required to ensure that |4P
n
(1) | < 10
3
.
Solution: Since the terms of the series
= 4 arctan 1 = 4

i =1
(1)
i +1
1
2i 1
alternate in sign, the error produced by truncating the series at any term is less than
the magnitude of the next term. To ensure signicant accuracy we need to choose n
so that
4
2(n + 1) 1
< 10
3
or 4000 < 2n + 1.
To ensure this accuracy requirement we need n 2000.
b. How many terms are required to ensure the 10
10
accuracy needed for an
approximation to ?
Solution: In this case we need
4
2(n + 1) 1
< 10
10
or n > 20, 000, 000, 000.
Clearly, a more rapidly convergent method is needed for this approximation.
10. b. Find the rate of convergence of
lim
n
sin
_
1
n
2
_
= 0
as n .
Solution: The second Taylor polynomial for f (x) = sin x about x
0
= 0 and its
remainder term are sin x = x
1
6
(cos
x
)x
3
. We let x =
1
n
2
to obtain
sin
1
n
2
=
1
n
2

_
1
6
cos
__
1
n
2
_
3
16 CHAPTER 1. MATHEMATICAL PRELIMINARIES
where is between 0 and
1
n
2
. Since | cos | 1 we have

1
n
2

_
1
6
cos
_
1
n
6


2
n
2
.
Thus,

sin
1
n
2
0

1
n
2

and the rate of convergence of sin


1
n
2
is O
_
1
n
2
_
.
12. a. How many calculations are needed to determine a sum of the form
n

i =1
i

j =1
a
i
b
j
?
Solution: For each i the inner sum

i
j =1
a
i
b
j
requires i multiplications and i 1
additions, for a total of
n

i =1
i =
n(n + 1)
2
Multiplications
and
n

i =1
i 1 =
n(n + 1)
2
n Additions.
Once the n inner sums are computed, n 1 additions are required for the nal sum.
The nal total is:
n(n + 1)
2
Multiplications and
(n + 2)(n 1)
2
Additions.
b. Re-express the series in a way that will reduce the number of calculations
needed to determine this sum.
Solution: By rewriting the sum as
n

i =1
i

j =1
a
i
b
j
=
n

i =1
a
i
i

j =1
b
j
EXERCISE SET 1.4 17
we can signicantly reduce the amount of calculation. For each i we now need i 1
additions to sum b
j
s for a total of
n

i =1
i 1 =
n(n + 1)
2
n Additions.
Once the b
j
s are summed we need n multiplications by the a
i
s, followed by n 1
additions of the products.
The total additions by this method is still
(n+2)(n1)
2
, but the number of multipli-
cations has been reduced from
n(n+1)
2
to n.
13. Consider the Fibonacci sequence dened by
F
0
= 1, F
1
= 1, and F
n+2
= F
n+1
+ F
n
, if n 0,
and dene
x
n
= F
n+1
/F
n
.
Assuming that
lim
n
x
n
= x
converges, show that the limit is the golden ratio:
x =
1 +

5
2
.
Solution: Since
lim
n
x
n
= lim
n
x
n+1
= x and x
n+1
= 1 +
1
x
n
,
we have
x = 1 +
1
x
which implies that x
2
x 1 = 0.
The only positive solution to this quadratic equation is x = (1 +

5)/2.
14. The Fibonacci sequence also satises the equation
F
n


F
n
=
1

5
__
1 +

5
2
_
n

_
1

5
2
_
n
_
.
18 CHAPTER 1. MATHEMATICAL PRELIMINARIES
a. Write a Maple procedure to calculate F
100
.
Solution: We have
>n:=98;f:=1;s:=1;
n :=98
f :=1
s :=1
>for i from 1 to n do
> l:=f+s;f:=s;s:=l;
>od;
l :=2
f :=1
s :=2
l :=3
f :=2
s :=3
l :=5
.
.
.
l :=218922995834555169026
f :=135301852344706746049
s :=218922995834555169026
l :=354224848179261915075
b. Use Maple with the default value of Digits followed by evalf to calculate

F
100
.
Solution: We have
> F100:=(((1+sqrt(5))/2)^100-((1-sqrt(5))/2)^100)/sqrt(5);
F100 :=
1
5
_
_
1
2
+
1
2

5
_
100

_
1
2

1
2

5
_
100
_

5
EXERCISE SET 1.4 19
>evalf(F100);
.3542248538 10
21
c. Why is the result from part (a) more accurate than the result from part
(b)?
Solution: The result in part (a) is computed using exact integer arithmetic, and the
result in part (b) is computed using 10-digit rounding arithmetic.
d. Why is the result from part (b) obtained more rapidly than the result
from part (a)?
Solution: The result in part (a) required traversing a loop 98 times.
e. What results when you use the command simplify instead of evalf to
compute

F
100
?
Solution: The result is the same as the result in part (a).
15. The harmonic series
1 +
1
2
+
1
3
+
1
4
+
diverges, but the sequence

n
= 1 +
1
2
+ +
1
n
ln n
converges, since {
n
} is a bounded, nonincreasing sequence. The limit
0.5772156649 . . . of the sequence {
n
} is called Eulers constant.
a. Use the default value of Digits in Maple to determine the value of n for
to be within 10
2
.
b. Use the default value of Digits in Maple to determine the value of n for
to be within 10
3
.
20 CHAPTER 1. MATHEMATICAL PRELIMINARIES
c. What happens if you use the default value of Digits in Maple to deter-
mine the value of n for to be within 10
4
?
Solution: The following Maple procedure is used:
>g:=proc(t);
> dne:=1;
> n:=1;
> sm:=0;
> while dne=1 do
> sm:=sm+evalf(1/n);
> gam:=evalf(sm-ln(n));
> err:=abs(evalf(gamma)-gam);
> if err<t then dne:=0
> else n:=n+1;
> fi;
> od;
> n;
>end;
>g(0.01);
>g(0.001);
>g(0.0001);
The results from the procedure are
a. n = 50, b. n = 500, and c. n = 5001.
If a procedure is not used, as in the following code, the program fails.
>restart;
>tol:=0.0001;
>dne:=1;
>n:=1;
>sm:=0;
>while dne=1 do
> sm:=sm+evalf(1/n);
> gam:=evalf(sm-ln(n));
> err:=abs(evalf(gamma)-gam);
> if err<tol then dne:=0
> else n:=n+1;
> fi;
>od;
>n;

You might also like