Chapter 1 Ans
Chapter 1 Ans
EXERCICE 1:
a/ Use five iterations of Bisection method, with the initial bracket [0.5, 1], to approximate the positive
root of cos(x) − x = 0.
b/ Repeat with the Inverse Linear Interpolation method, using the same initial bracket.
EXERCICE 2:
In lesson class, we have seen the algorithm of Secant Method. We want to solve for the problem : Found
solution x∗ of sin x∗ = 1 in the interval [0, π]. Read the algorithm as will do the computer for 3 iterations,
line by line, and explicit what each variable represents. Take the initial points xa = 0 and xb = π4 , the
tolerance tol = 10−3 and N0 = 4.
The algorithm is :
INPUT :
• two initial points : xa and xb
• function f (x) : f onc
• tolerance : tol
• maximum number of iterations : N0
f a = f (xa)
f b = f (xb)
i=3
while (i ≤ N0 )
x = xb − f b fxb−xa
b−f a
xa = xb
xb = x
fa = fb
f b = f (x)
if (f b = 0 or |x − xa| < tol)
output : x
stop;
endif
i=i+1
endwhile
Error message (’Method failed after N0 − 2 iterations’)
EXERCICE 3:
1
2
EXERCICE 4:
Let’s do a game on numbers! The sum of 2 numbers is 20. If each number is added to its square root, the
product of the two sums is 155.55. Determine the 2 numbers to within 10−4 . Let the 2 numbers be ≥ 0.