MAT-31101 Numeerinen analyysi 1 tentti 17.2.2010
MAT-31106 Numerical Analysis 1 Exäm 17.2.2010
Tentissä saa käyttää tavallista tai graafista/ohjelmoitavaa laskinta ja yhtä kaksipuolis-
ta käsinkirjoitettua A/-paperia muistiinpanoja (ei valokopio, ei tulostettu). Laskuissa
välivaiheet on kirjoitettava näkyviin.
You are allowed to use a plain or graphing/programmable calculator and one handurit-
ten two-sided A/ sheet of notes (not a photocopy, not a printout). Show all calculation
steps.
1. (a) Tiedetään, että sinh(1.234-10—15) = 3(e!28410"%— 61234105) & 1.934000000000313-
1071), mutta MATLAB laskee
>> x=1.234e-16;
>> y=(exp(x)-exp(-x))/2
y=
1.6653e-16
Mikä on tuloksen merkitsevien numeroiden lukumäärä? Perustele.
It is known that sinh(1.234-1075) = 5(e! 23410716 6123410") 1.234000000000313-
10716), but MATLAB gives the above result. What is the number of significant
digits in the result? Justify.
(b) Selitä, miksi (a)-kohdan MATLAB-lausekkeet laskevat funktion sinh(z) arvon
hyvin epätarkasti, ja kirjoita koodi uudelleen sellaiseen muotoon, että tulos
on tarkka tälle z-arvolle. (Ei saa käyttää MATLABRin sinh funktiota.)
Explain why the MATLAB command seguence in (a) computes sinh(z) so
inaccurately, and rewrite the code so that it produces an accurate result for
this x value. (Don't use MATLAB's sinh function.)
2. (a) Suorita kaksi sekanttimenetelmän iteraatiota aloitusarvoilla z, = 0.5 ja x; =
1 funktion f(x) = x — cos(z) nollakohdan laskemiseksi.
Do two iterations of the secant method with starting values z, = 0.5 and
Z1 = 1 to find a zero of f(z) = x — cos(z).
(b) Näytä, että [z, z1] = [0.5, 1.0] on funktion f nollakohdan haarukointiväli. Et-
si (tekemättä iteraatioita) puolittamismenetelmän iteraatioiden lukumäärä,
jolla voitaisiin laskea nollakohta kahdeksan merkitsevän numeron tarkkuudel-
la. (Yksi iteraatio vastaa yhtä funktion f arvon laskemista, ja ensimmäisenä
iteraationa olkoon arvon f(%%1) laskeminen.)
Show that [70,x1] = [0.5, 1.0] is a bracketing interval for a zero of f, and de-
termine (without doing any iterations) how many bisection method iterations
would be needed to compute an estimate that has 8 significant digits. (Count
each f evaluation as one iteration, and count the evaluation of f(1$2) as
the first iteration.)
3. Etsi Newtonin muodon polynomi, joka interpoloi kaikki taulukon pisteet. Etsi
(ilman uusia laskuja) astetta 2 oleva polynomi, joka interpoloi taulukon 3 en-
simmäistä pistettä. Etsi astetta 3 oleva polynomi, joka on taulokon datan paras
4.
3 WSsr Pelto Tan
juse [o pekiöä NAT BJUKTT
sovite pienimmän neliösumman mielessä.
x | 21 22 24 26
f(x) | 0.433157 1.008891 2.473362 0.466471
Find the Newton form of the polynomial that interpolates all the points in the
table. Without doing any further computation, find a polynomia! of degree 2 that
interpolates the first three points in the table. Find the polynomia] of degree 3
that is the best least-sguares fit of all the data in the table
(a) Näytä, että Po(x) = 1 ja Pi(z) = x — ? ovat ortogonaaliset skalaaritulon
(1.9) = £ xf(x)g(x) dx suhteen.
Show that P(x) = 1 and Pi(z) = x — 2 are orthogonal with respect to the
scalar product (f, g) = < zf(x)g(x) dz.
(b) Etsi polynomi p(z) = coPolz) + 1 Pi(z), joka on funktion f(z) = x”? pa-
ras approksimaatio pienimmän neliösumman mielessä välillä [0,1] ja painolla
W(t) = x.
Find the polynomia! p(z) = coPo(z) + i P:(z) that is the best least sguares
approximation of f(z) = x? on the interval [0,1] with weight w(z) = z.
(c) Selitä, miksi virhe |p(z) — f(z)| on isompi välin vasemalla puolella kuin välin
oikealla puolella.
Explain why the error |p(z) — f(z)| is larger in the left half of the interval
than in the right half.