Assignment 2 Nonlinear Equations Attempt Review PDF
Assignment 2 Nonlinear Equations Attempt Review PDF
b. No I do not agree
Question 2 You are using the bisection method to solve an equation with an initial guess a0 = −2.0 and
Incorrect b0 = 0.5 .
Mark 0.00 out of It is required to find the approximation of the root with an absolute error less than 0.1
1.00
How many iteration do you have to do at least in order to reach the set precision?
Flag question
Answer: 5
2
which is larger than 0.1.
After two iterations the error will be which is larger than 0.1.
1.25
2
2
After three iterations the error will be which is larger than 0.1.
1.25
3
2
After four iterations you have an error of which is less than 0.1.
1.25
4
2
c. a1 = 1 and b1 = 1.5
d. a1 = 1 and b1 = 1.263
Mark 0.00 out of Conduct three iterations (i.e. find x3 ) and report the approximation x3 of the root computed by the
1.00
algorithm.
Flag question
Use as many digits as possible.
Answer: 1.679273065
Question 5 We want to apply the fixed point method to solve the equation x = g(x) .
Partially correct
Choose among the following examples of functions g(x) which will lead to a converging fixed point
Mark 0.50 out of algorithm when using the intial guess x0 specified.
1.00
Flag question
Select one or more:
a. g(x) = x
2
− 3x cos x and x0 = 1
b. g(x) =
2
and x0 = 1
√x
c. g(x) = sin x + e
x
+ x − 4 and x0 = 0.5
d. g(x) = e
x
− 7 and x0 = −2
e. g(x) = sin x + e
x
and x0 = 0.5
Flag question
Indeed r = 0 is a root as er − r − 1 = 0 .
Define f (x) = e
x
− x − 1 .
Then f ′ (x) = e
x
− 1 .
As f ′ (r) = 0 the root is at least a double root.
b. 0.3748
c. 0.5473
d. 0.5965
Question 8 You are implementing on a computer a numerical algorithm to solve an equation of the form
Correct f (x) = 0.
Mark 1.00 out of In order to check your algorithm you decide to test it with the function f (x) .
= sin(x) − x
1.00
b. This is not a good choice for the function f (x) to test the programmed algorithm
Question 9
Find the absolute backward and forward error for the following functions, where the true root is \
Partially correct
(r=0.5\) and the approximated root is \(x_r=0.48\).
Mark 0.67 out of
1.00 Fill out the following table to answer the question (use as many digits as possible)
Flag question
\(f(x)\) Backward error Forward error
This problem illustrates once more that computing the backward error doesn't tell us anything
about the forward error.
Reference: lecture on forward and backward errors in Lesson 2 "Solving nonlinear equations"
Question 10 You have to solve an equation \(f(x)=0\) with a precision below a relative error of \(10^{-5}\).
Correct
If \(\left|\frac{f(x_r)}{x_r}\right|<10^{-5}\) then
Mark 1.00 out of
1.00
Select one:
Flag question
a. you can't conclude anything
c. you have found an approximation \(x_r\) to the specified precision as long as \(x_r \neq 0\)
d. you have found an approximation \(x_r\) to the specified precision if \(x_r\) is not a multiple
root
The quantity \(|f(x_r)|\), which is the backward error, doesn't tell you anything about \(|r-x_r|\) which
is the absolute error.
Similarly \(\left|\frac{f(x_r)}{x_r}\right| \) doesn't tell you anything about \( \left| \frac{r-x_r}{x_r}
\right|\) which is the relative error you want to have below the specified tolerance.
Reference: lecture on backward and forward errors in Lesson 2 "Solving nonlinear equations".
The correct answer is: you can't conclude anything
b. 0.005
c. 0.03
Consequently \( E_5 \simeq \lambda E_4^2 \simeq 0.13 \cdot 0.04^2 \simeq 0.002 \)
Reference: Lecture on order of convergence form Lesson 2 "Nonlinear equations"
The correct answer is: 0.0002
How much is the backward error (give the answer with one significant digit) ? 0.2
Estimate the absolute error \(|r-x_4|\) of \(x_4\) to one significant digit : 0.04
How many correct significant digits contains \(x_4\) if used to estimate the root of \(f\)? 2
To apply Newton's algorithm you need to compute the first derivative of \(f\):
\(f'(x)=e^x (-\sin (e^x - 2) - 1)\)
Iterating Newton's algorithm gives:
\(x_o=0.5\)
\(x_1=1.693096115738836\)
\(x_2=0.5541812360355938\)
\(x_3=1.501688006679172\)
\(x_4=1.046498587535354\)
The backward error is given by \(|f(x_4)|\).
A plot of \(y=f(x)\) shows that the root near \(x_4\) is of multiplicity \(m=1\).
To estimate the error of \(x_4\) one uses: \( |r-x_4| \simeq \left| \frac{ f(x_4)}{f'(x_4)} \right| \)
Based on the estimation of \( |r-x_4| \) one can immediately see how many digits in \(x_4\) are
correct.
Reference: lectures on backward/forward errors and challenging problems of Lesson 2 "Solving
nonlinear equations"
How much is the backward error (give the answer with one significant digit) ? 0
Define \(f(x)=x^2-2xe^{-x}+e^{-2x}\).
The backward error is given by \(|f(x_r)|\).
A plot of \(y=f(x)\) shows that the root near \(x_r\) is of multiplicity \(m>1\) and must be of even
multiplicity.
Computing \(f'(x_r)\), \(f^{(2)}(x_r)\) and \(f^{(3)}(x_r)\) allows to conclude that the multiplicity is \
(m=2\)
To estimate the error of \(x_r\) one uses: \( |r-x_r| \simeq \left| \frac{m! \cdot f(x_r)}{f^{(m)}(x_r)}
\right| ^ {1/m} \) with \(m=2\)
Based on the estimation of \( |r-x_r| \) one can immediately see how many digits in \(x_r\) are correct.
Reference: lectures on backward/forward errors and challenging problems of Lesson 2 "Solving
nonlinear equations"
Flag question
Answer: 2.370686918
Regardless on which technique you use and which initial guess, you need to perform enough
iterations until reaching the asked precision.
For this you need in each iteration to estimate your error and check if it falls or not below the target
precision.
It is recommended to go a few iterations more to double check and ideally try with more than one
method to verify the answer
First we note based on a plot of \(y=f(x)\) that the root is of multiplicity \(m=1\) (needed to know in
order to estimate correctly the error).
The plot allows us as well to choose an initial guess to start the algorithm
\(x_o=2\)
\(x_1=2.550769198432895\)
\(x_2=2.371358512514945\)
\(x_3=2.370687056826609\)
\(x_4=2.370686917662268\)
We see that in iteration 4 we have an estimated absolute error of
\( |r-x_r| \simeq \left| \frac{f(x_4)}{f'(x_4)} \right| \simeq 6 \cdot 10^{-15} \)
Consequently \(x_4\) is an approximation to the root with an absolute error less than \(10^{-10}\).
Flag question
Answer: 3.733079029
Regardless on which technique you use and which initial guess, you need to perform enough
iterations until reaching the asked precision.
For this you need in each iteration to estimate your error and check if it falls or not below the target
precision.
It is recommended to go a few iterations more to double check and ideally try with more than one
method to verify the answer
The plot allows us as well to choose an initial guess to start the algorithm
\(x_o=4\)
\(x_1=3.784361145167370\)
\(x_2=3.735379375079544\)
\(x_3=3.733083897874097\)
\(x_4=3.733079028654685\)
\(x_5=3.733079028632814\)
We see that in iteration 5 we have an estimated absolute error of
How much is the backward error (give the answer with one significant digit) ? 0.0002
Estimate the absolute error \(|r-x_r|\) of \(x_r\) to one significant digit : 0.00005
Define \(f(x)=2+\cos(e^x-2)-e^x\).
The backward error is given by \(|f(x_r)|\).
A plot of \(y=f(x)\) shows that the root near \(x_r\) is of multiplicity \(m=1\).
To estimate the error of \(x_r\) one uses: \( |r-x_r| \simeq \left| \frac{m! \cdot f(x_r)}{f^{(m)}(x_r)}
\right| ^ {1/m} \) with \(m=1\)
Based on the estimation of \( |r-x_r| \) one can immediately see how many digits in \(x_r\) are correct.
Reference: lectures on backward/forward errors and challenging problems of Lesson 2 "Solving
nonlinear equations"
Correct
\((x-2)^2-\ln x = 0\).
https://www.coursehero.com/file/117424965/Assignment-2-Nonlinear-Equations-Attempt-reviewpdf/
How much is the backward error (give the answer with one significant digit) ? 0.000006
Estimate the absolute error \(|r-x_r|\) of \(x_r\) to one significant digit : 0.000004
Based on the estimation of \( |r-x_r| \) one can immediately see how many digits in \(x_r\) are correct.
Reference: lectures on backward/forward errors and challenging problems of Lesson 2 "Solving
nonlinear equations"
Finish review
◄ Assignment 1 - Introduction
Jump to... Assignment 3 - Linear Equations ►
(Not for grade)