COMPUTER SCIENCE
349A
SAMPLE EXAM QUESTIONS
WITH SOLUTIONS
PARTS 1, 2
PART 1.
1.1
(a)
Define the term “ill-conditioned problem”.
(b)
Give an example of a polynomial that has ill-conditioned zeros.
1.2
Consider evaluation of
)
tanh(
1
1
)
(
x
x
f
−
=
,
where
x
x
x
x
e
e
e
e
x
−
−
+
−
=
)
tanh(
.
If
)
(
x
f
is to be evaluated in floating-point arithmetic (e.g.,
k
= 4 decimal digit, idealized,
rounding floating-point), for each of the following ranges of values of
x
, specify whether
the computed floating-point result will be accurate or inaccurate.
(a)
x
is large and positive (for example,
4
>
x
if
k
= 4)
(b)
x
is close to 0 (for example,
001
.
0
≤
x
if
k
= 4)
(c)
x
is large and negative (for example,
4
−
<
x
if
k
= 4)
1.3
Consider
0
,
)
1
sin(
)
1
sin(
)
(
≠
−
+
=
h
h
h
h
g
where the arguments for sin are in radians
.
When
h
is close to 0, evaluation of
)
(
h
g
is
inaccurate in floating-point arithmetic.
In (a) and (d) below, use 4 decimal digit,
idealized, rounding
floating-point arithmetic.
If
x
is a floating-point number, assume that
)
(sin
x
f
l
is determined by rounding the exact value of
x
sin
to 4 significant digits.
(a)
Evaluate
)
)
(
(
h
g
f
l
for
00351
.
0
=
h
.
Note that
L
843088
.
0
)
003
.
1
sin(
=
,
L
843625
.
0
)
004
.
1
sin(
=
and
L
841470
.
0
)
1
sin(
=
.
(b)
Taylor's Theorem can be expressed in two equivalent forms:
given any fixed
value
0
x
,

This
** preview**
has intentionally

**sections.**

*blurred***to view the full version.**

*Sign up*