Math 309 HW1 - Adam Oberman Math

Math 309 HW1

Contents

Homework 1 due Friday Jan 15th

posted 5pm thursday jan 7.

Review Problems

  1. Find the local and global minimizers and maximizers of f(x) = x4 + 4x3 + 6x2 + 4x
  2. Find the local and global minimizers and maximizers of f(x) = x + sin(x)

Matlab Problems

These problems are practice exercises in MATLAB

  1. Using MATLAB, enter the matrix and right hand side vector for the quadratic fitting example (p.9 of section 1.3), and use backslash to solve for the variables x1, x2, x3. Submit the commands which assign A, b, and solver for x (about 3 commands).
  2. Plot the quadratic solution. (You will need to use a plotting command and evaluate the quadratic function). Mark the data points on the plot.
  3. Now solve the least squares data fitting problem (section 1.5) where the fourth point is (7,-15), and again with a fifth point (4,10). Matlab will automatically find the least squares solution if you use backslash. Submit the coefficients, and also plot the solutions as in the previous problem.

Example code

M = [1 2 3; 4 5 6; 7 8 9];
b = [5 7 6];
x = M/b

Theory Problems

Given m numbers b_1, ..., b_m, let f(x) = |x-b_1| + |x-b_2| + ... + |x - b_m| be the sum of the absolute values of the residuals.

  1. Minimize the sum of the absolute values of the residual for the vector b = (-2, -1, 0, 1, 3).
  2. Show that when b = (-2, -1, 0, 1) there are multiple minimizers. What are they?
  3. Prove that for m odd, the unique minimizer is the median.
  4. Exercise 5.1 on page 14 of the textbook.