Homework #1: MA 402 Mathematics of Scientific Computing Due: Wednesday, January 19
Homework #1: MA 402 Mathematics of Scientific Computing Due: Wednesday, January 19
Homework #1: MA 402 Mathematics of Scientific Computing Due: Wednesday, January 19
MA 402
Mathematics of Scientific Computing
Due: Wednesday, January 19
• You should in general submit two files: one for your writeup (preferably
PDF) and one (or more) containing any code you used (.m or .py).
• Describe the results of your code, including all numerical answers, in the
writeup.
• If the problem involves a short answer (such as the end of Problem 7),
include it in your writeup rather than as a comment in the code file.
• For more involved problems, if you wish to add further explanation about
the methods/algorithms you used, do so in the writeup. With rare ex-
ceptions, avoid copy-pasting large sections of your code into the writeup;
summarize it instead.
• When the code is run (e.g. the green “Run” button in the Matlab editor)
with a clean workspace (clear in Matlab), it should run correctly. Do
not “hard-code” the answers; the code should show how the answers were
obtained to begin with.
1
Problem 1. Fill out the Day 1 Questionnaire, and rate the Hilarious Jokes
(link available on Moodle). The Hilarious Jokes survey contains 42 jokes, so
may take about 20 minutes to fill out depending on how long you savor each
joke. The data will be used as part of one of the class projects later on.
Problem 2. The period T (in seconds) of a pendulum of length L (meters) can
be modeled by the equation s
L
T = 2π ,
g
where g ≈ 9.80665 m/s2 .
a) Suppose that when you time an event using a stopwatch, your recorded
time will be accurate to about ±0.2 seconds. If you time 1 full period of a
pendulum with length L = 1 meter, about how large can you expect the
relative error in your measurement Te to be?
b) How large are the absolute and relative errors in the resulting estimate g̃?
If you expect Te to fall in the interval [T − δT, T + δT ], you can try looking
at the values of g̃ that result from the endpoints T − δT and T + δT .
Include units, when appropriate.
c) How do the previous answers change if you let the pendulum swing for 15
periods instead of just one? Explain why they change the way they do.
d) If you try to conduct this experiment in practice, what do you expect to
happen in the limit as you let the number of periods tend to infinity?
Why?
Problem 3. In the 1965 song New Math, Tom Lehrer solves the problem
(342)8 − (173)8 . What is the solution to this problem, written in base 8? What
is the translation of this problem to base 10?
Problem 4. Exactly how many IEEE double precision floating point numbers
fall in the interval [6, 7] (including the endpoints)? What about [ 12 , 32 ]?
2
Problem 6. For (a) and (b), express the numbers in IEEE double precision.
For (c), do the reverse.
a) −10.125
b) 230
c) 0 10000000010 10110...0
| {z }
48
• Clearly label the x- and y-axes. All of the labels should have fontsize 18.
• The limits of the y-axis should be [0,110].
• Title the figure “Three-term recurrence”, with fontsize 20.
• The markers should be solid blue squares.
• Add a horizontal black dashed line at the predicted limit of 6, with line-
width 1.5.
• Add a horizontal red dashed line at the observed limit, with line-width
1.5.