[General boards] [Winter 2023 courses] [Fall 2022 courses] [Summer 2022 courses] [Older or newer terms]

A1 some notes

Some notes on A1, following the questions I got
during office hours.

Q2a A bit more elaboration on parts of this question:
Find condition number and for what x’s (say x1, x2, x3, …)
it becomes infinity.
Then assume you are at x1+delta, (then x2+delta, …),
for |delta| small.
Substitute x1+delta for x in the condition number. Simplify,
following the rule that higher orders of delta can be ignored
next to lower orders. Arrive at a (fairly simple) expression
that involves delta.
Find for what delta this expression is greater than 1/Emach.

Q2b A bit more elaboration on parts of this question:
Generically state what problems may occur in expression given
when x ~ 0.
Give mathematically equivalent expression that does not suffer
from problems above, when x ~ 0.
Find x for which the first expression, when computed on floating-point system
gives a very wrong result, and
for which the second expression, when computed on floating-point system
gives a reasonable (still approximate) result, and explain.
It is ok to get ideas from matlab or other computing, but you need to explain.

Q2c Do not alter the output format, as stated.
Only nicely aligned and correct results will get full marks.
(If you use python, you must find a compatible format for output.)

Q3d (and b) Keep in mind that Taylor series of cos(x) about 0
converges faster (with smaller number of terms), when |x| is small.
Use (the easy) properties of cosine, so that the number of terms
you need for the x’s indicated remains small.
The cases x = 1, x = 2, x = 4, x = 6, should be seen
as indicative cases, to think about. I could have asked for
x = 1.5, x = 3, x = 3.5, x = 5 or
x = 1.2, x = 2.5, x = 4.5, x = 6.1 (and many more other cases).

you said ‘do not alter the output format’, but the default format for matlab plots is .fig, and it is not supported for inclusion into LaTeX as an image. So what format do you want?

Please use a different topic for something like a question on format.

By output format I meant the fprintf statement I give in the assignment.
Do not alter that.
The plots can be saved in eps (supported by latex, pdflatex, etc),
or png, etc (supported by pdflatex).

“Find x for which the first expression, when computed on floating-point system
gives a very wrong result, and
for which the second expression, when computed on floating-point system
gives a reasonable (still approximate) result, and explain.
It is ok to get ideas from matlab or other computing, but you need to explain.”

To quantify a wrong result, is it okay if we assume a certain floating-point system such as .dd ×10d?

I am afraid that it can lead you to the wrong answer if you assume a specific system.
The answer to x is to be given in terms of Emach,
and the .dd x 10^d already assumes a specific Emach.
You should be able to handle it irrespectively of number of digits.

To give you some ideas, think of the case that a^2 -2ab +b^2 is computed as negative. You do not need quantification.
The computed result is garbage, period.

  [General boards] [Winter 2023 courses] [Fall 2022 courses] [Summer 2022 courses] [Older or newer terms]