0% found this document useful (0 votes)
163 views5 pages

Final Exam - Solution

The document is the final exam for a numerical methods course given in fall 2019/2020. It contains 5 questions worth a total of 45 points. Question 1 (8 points) involves analyzing the convergence of an iterative method. Question 2 (6 points) requires proving an interpolation formula. Question 3 (7 points) uses least squares to approximate a curve and find a value. Question 4 (17 points) derives a formula to approximate derivatives using finite differences and calculates the error. Question 5 (7 points) uses Simpson's rule to evaluate an integral numerically using given data points.

Uploaded by

omran97
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
163 views5 pages

Final Exam - Solution

The document is the final exam for a numerical methods course given in fall 2019/2020. It contains 5 questions worth a total of 45 points. Question 1 (8 points) involves analyzing the convergence of an iterative method. Question 2 (6 points) requires proving an interpolation formula. Question 3 (7 points) uses least squares to approximate a curve and find a value. Question 4 (17 points) derives a formula to approximate derivatives using finite differences and calculates the error. Question 5 (7 points) uses Simpson's rule to evaluate an integral numerically using given data points.

Uploaded by

omran97
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 5

College of Computing and Informatics

Department of Computer Science

1411370 Numerical Methods

Final Exam, Fall 2019/2020


DATE: Sunday December 15th, 2019; TIME: 11:00 - 13:00

Student Name: ___________________________________ ID#: _______________________

INSTRUCTIONS:
 Closed Books, Closed Notes,
 No E-Dictionaries, No Mobiles.

Marking Scheme:
Score Weight Part
8 Q. 1
6 Q. 2
7 Q. 3
17 Q. 4
7 Q. 5
45 Total

Outcomes:
Score Weight Questions Outcome
Analyze the propagation of errors in numerically
8 Q. 1 A.
calculated solutions.
Use different numerical techniques to solve
7 Q. 3 B.
mathematical problems.
Solve systems of linear and non-linear equations using
6 Q. 2 C.
both direct methods and iterative methods.

Use curve fitting techniques: interpolation /


17 Q. 4 D.
approximation / slpine to represent a given set of points.

7 Q. 5 Approximate the derivative / integral of a function. E.

Taylor’s series expansion of f around x0 is

' ( x−x 0)2


f ( x )=f ( x 0 ) + ( x−x 0 ) f ( x 0 )+ f ( {x} rsub {0} )+ {{( {x-x} rsub {0} )} ^ {3}} over {3!} {f} ^ {(3)} ( {x} rsub
2!
15 /
Q.1 The following iterative method generates a convergent sequence to the root  of a function f.

x n+1=3 x n−3 c x 2n+ c 2 x 3n , n = 0, 1, 2, …

ㄱ Find   0, where c  0.
ㄴ Find the order of convergence.

lim x n+1=¿ lim x n=α ¿


n→∞ n→∞

lim x n+1=lim [ 3 x n−3 c x2n+ c2 x 3n ]


n→∞ n→∞

α =3 α −3 c α 2 +c 2 α 3

c 2 α 3−3 c α 2+ 2α =0

α ( c 2 α 2−3 c α +2 ) =0

α ( c α −1 ) ( c α−2 ) =0
Since α ≠ 0, then α =1/c or α =2/c.

α =2/c α =1/c g ( x )=3 x−3 c x 2 +c 2 x 3


g' (2/c )≠ 0 g' (1/c)=0 g' (x)=3−6 c x+ 3 c 2 x 2
g ( 1/c )=0 g ( x )=−6 c +6 c 2 x
g ' ' ' ( 1/c ) ≠ 0 g ' ' ' ( x )=6 c 2
1 3 Order of convergance

Q.2 Prove that P3(x3) = f(x3) given that

q (q−1 ) 2 q ( q−1 ) (q−2) 3


P3 ( x )=f ( x 0 )+ q Δf ( x 0 )+ Δ f ( x 0 )+ Δ f ( x 0) ,
2! 25 / 3!
x−x 0
where q= .
h
x3 −x 0 x 0 +3 h−x 0
q= = =3
h h

3(3−1) 3 (3−1)(3−2)
P3 ( x3 ) =f ( x 0 ) +3 [ f ( x 1) −f ( x 0 ) ]+ f ( x )−2 f ( x1 ) + f ( x 0 ) ] + [ f ( x 3 )−3 f ( x 2 ) +3 f ( x1 ) −f ( x 0 ) ]
2! [ 2 3!

P3 ( x3 ) =( 1−3+ 3−1 ) f ( x 0 ) + ( 3−6+3 ) f ( x 1 ) + ( 3−3 ) f ( x 2) + f ( x 3 )=f ( x3 )

Q.3 Use the principle of least-squares to find the constant A if the curve of y(x) = A x1.5 is used to
approximate the following data:

xi 1 2 3 4 5
f(xi) -1 0 6 11 17
Find f(2.3).

The principle of least-squares minimizes the sum of errors square at all the given points, i.e.
4
2
minimize E ( A )=∑ [ f ( x i )− A x 1.5
i ]
i=0

4
dE
0= =2 ∑ [ f ( xi ) − A x 1.5 1.5
i ] [−x i ]
dA i=0

4 4
A ∑ x 3i =∑ x 1.5
i f ( xi )
i=0 i=0

∑ x 1.5
i f (xi )
A= i=0 4
=1.369967523
3
∑x i
i=0

y ( x ) =1.369967523 x 1.5

y ( 2.3 )=1.369967523 2.31.5=4.778614820

Q.4 Derive a formula to approximate f(xi), using f(xi-1), f(xi), and f(xi+2) where the points xi-1, xi, xi+1,
and xi+2 are equally spaced. Find the error in your formula.

Let
f ' ( x i )= Af ( xi−1 ) + B f ( x i ) +C f ( xi +2 ) +error

35 /
Using Taylor’s series expansion around x0
2 3
' ( x −x0 ) ( x−x 0 ) (3 )
f ( x )=f ( x 0 ) + ( x−x 0 ) f ( x 0 )+ f ( x0 )+ f ( x 0 )+ …
2! 3!
Replacing x by x0 - h, gives
' h2
f ( x 0 −h ) =f ( x 0 )−h f ( x 0 ) + f ( { x } rsub {0 } ) - {{h } ^ {3 }} over {3 ! } {f} ^ {left (3 right )} ( {x} rsub {0} )+
2!
and replacing x by x0 - h, gives
' 4 h2
f ( x 0 +2 h ) =f ( x 0 ) +2 h f ( x 0 ) + f ( { x } rsub { 0} ) + {{ 8 h } ^ {3 }} over {3 ! } {f} ^ {left (3 right )} ( {x} rsub {0
2!

A f ( x 0−h ) + B f ( x 0 ) +C f ( x 0 +2 h ) =¿

h2
{ '
A f ( x 0 )−h f ( x 0 ) +
2!
f ( { x } rsub {0 } ) - {{h } ^ {3 }} over {3 ! } {f} ^ {left (3 right )} ( {x} rsub {0} )+… right

2
' h (
¿ ( A+ B+C ) f ( x0 ) + h (−A +2C ) f ( x 0 ) + A +4 C ) f ( {x} rsub {0} )+ {{h} ^ {3}} over {3!} (-A+8C) {f} ^ {(3)} ( {x
2!

The constants A, B, and C in the right hand side of the equation can be chosen such that the coefficient
of f(x0) is zero, the coefficient of f (x0) is one and the coefficient of f (x0) to be zero, then

A+B+C=0
-A + 2C = 1/h
A + 4C = 0

−4 3 1
Producing the constants A= , B= , C= and so
6h 6h 6h
1 −h2 (3)
f ' ( x 0 )=
6h
[ −4 f ( x 0 −h ) +3 f ( x 0 ) + f ( x 0 +2 [
h ) ] 3 ! f ( x 0 ) +…
+ ]
Put in another form as
1
f ' ( x 0 )= −4 f ( x 0−h ) +3 f ( x 0 ) + f ( x 0 +2 h ) ]+ error
6h [
−h2 ( 3)
error = f (), x0 – h <  < x0 + 2h
3!

Q.5 Integrate the function f(x) along the interval [2, 2.4], using the Simpsons rule and the
following data:

xi 2 2.1 2.2 2.3 2.4


f(xi) 0.12306 0.105706 0.089584 0.074764 0.061277

45 /
x2
h
∫ f ( x ) dx ≈ 3 [ f ( x 0 ) + 4 f ( x 1 ) + f ( x 2)]
x0

2.4

∫ f ( x ) dx ≈ 0.1
3
( 0.12306+ 4∗0.105706+2∗0.089584+ 4∗0.074764+ 0.061277 )
2

2.4

∫ f ( x ) dx ≈ 0.0361795
2

55 /

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy