HW 2 for CS 4220
You may (and probably should) talk about problems with the each other, with the TAs, and with me, providing attribution for any good ideas you might get. Your final write-up should be your own.
1: Box-Cox
The Box-Cox family of transformations is sometimes used in statistics to normalize non-negative data. The transformation has the form
The obvious implementation in Julia is
box_cox1 (generic function with 1 method)
Unfortunately, this is prone to large errors when
Explain why, and suggest an alternative with better error in this case, coded in the function box_cox2
. You may wish to use the function expm1
in your solution (though there are other approaches as well).
box_cox2 (generic function with 1 method)
If you have done this right, you should be able to recreate the plot above without the numerical artifact for small
2: Pi, see!
The following routine estimates
pi_estimator1 (generic function with 1 method)
Unfortunately, something goes catastrophically wrong with this computation in floating point.
Explain what goes wrong in this computation in floating point, and rewrite the problematic formula in pi_estimator2
to avoid the issue.
pi_estimator2 (generic function with 1 method)
3: Norm!
Let
In this exercise, we will consider the
You may also find it useful to recall that
case
Argue that for the norm induced by the
case
Argue that for the norm induced by the
case
For the
Explain why the facts above imply that
It turns out that as opnorm
function.
(You do not need to understand the Julia code to form
Lmatrix (generic function with 1 method)