Fill This Form To Receive Instant Help
Homework answers / question archive / MATH/CSCI 4650 Homework a Fee] free to work on the assignment with other students in the class, however please write up your own work and code
MATH/CSCI 4650 Homework a
Fee] free to work on the assignment with other students in the class, however please write up your own
work and code. All code must be turned in as a .IPYNB file AND a link to your Google Collab notebook.
Code will not be graded without both of these. When you are asked to create a function to solve some
problem, do not use some built-in function. Non-coding solutions may either be turned in as a PDF of
handwritten work or a PDF of a /TpXdocument. No file types other than PDF will be accepted. Please
show all of your work. All problems or parts of problems are worth 10 points.
1. (a) By hand, find the line of best fit for (0,0), (1,3), (2,3), (5, 6).
(b) (Coding) Double check your answer by using a built-in Python function.
2. (Some Coding) Assume that the height of a model rocket is measured at four times, and the measured
times and heights are (t,h) = (1, 135, (2, 265), (3, 385), (4,465) in seconds and meters. Fit the model
h=a-+ bt — 4.905¢ to estimate the eventual maximum height of the object and when it will return to
earth. You may use Python.
3. (Some Coding) In question 5 in the previous homework we examined Runge phenomena on the data
below describing world oil production. Figure out a better way to model the data. You may use
Python, but make sure to justify what model you pick. What does this predict that the oil production
should be in 2021? What was it actually?
[year | bbi/day (x10°) |
1994 67.052
1995 68.008
1996 69.803
1997 72.024
1998 73.400
1999 72.063
2000 74.669
2001 74.487
2002 74.065
2003 76.777
Table 1: Data for Question 3.
4. (a) Apply Gram-Schimidt Orthogonalization (by hand) to find the QR factorization of the following
matrix:
—-4 -4
—-4 7
4 —-5
(b) Use the factorization to solve the least squares problem
—-4 -4 x 3
-4 7 | = |9
4 —5| 0
5. (Coding) In this problem we will find the exponential of best fit (y = c,e°') through the points
(1, 2), (2, 2), (3, 7), (4, 10), (5, 17).
(a) Find the vector of equations r and the Jacobian Dr.
(b) Determine (with justification) some initial guess 2°.
1
(c) (Coding) Create a Python function that runs Newton-Gauss on this problem. You may terminate
when successive iterations have ||@**+1 — z*||, < 10~® using np.linalg.norm().
6. (Coding) Consider the data for number of transistor on a chips to illustrate Moore’s law, which is
given in the table below. Recall that we had an approximation of the exponential of best fit with
y = 1335.3e9-3°464t which had a doubling time of In(2)/cz = 1.95 years. We wish to compare this to
the true exponential of best fit. Use the built-in Python function scipy.optimize.curve_fit() to find this,
and state the new doubling time.
| year | transistors |
1971 2250
1972 2500
1973 5000
1974 29,000
1978 120,000
1982 275,000
1985 | 1,180,000
1993 | 3,100,000
1997 | 7,500,000
1999 | 24,000,000
2000 | 42,000,000
2002 | 220,000,000
2003 | 410,000,000
Table 2: Data for Question 6.
Extra Credit: One other interesting application of QR factorization is that it can be used to find eigen-
values. Do some research into this process and explain how and why it works.
2
Fee] free to work on the assignment with other students in the class, however please write up your own
work and code. All code must be turned in as a .IPYNB file AND a link to your Google Collab notebook.
Code will not be graded without both of these. When you are asked to create a function to solve some
problem, do not use some built-in function. Non-coding solutions may either be turned in as a PDF of
handwritten work or a PDF of a /TpXdocument. No file types other than PDF will be accepted. Please
show all of your work. All problems or parts of problems are worth 10 points.
1. Find the Lagrange interpolating polynomial through the points (0, 1), (2,3), (3, 0).
2. The estimated mean atmospheric concentration of carbon dioxide in earth’s atmosphere is given in the
table that follows, in part per million by volume. By hand, find the degree 3 interpolating polynomial
of the data and use it to estimate the CO>2 concentration in 1950. (The actual concentration in 1950
was 310 ppm).
[ Year | CO2 (ppm) |
1800 280
1850 283
1900 291
2000 370
Table 1: Data for Questions J os
3. Create a degree 2 Lagrange interpolating polynomial through the points (0,0), (7/2, 1), (7,0) to esti-
mate sin(x). Give your estimation of 7/4 and compare this with the true value.
4. Repeat the process for the previous question but instead use the three Chebyshev points in the interval
[0,1]. You may round all intermediate calculations to 4 decimal places.
5. (Coding) The total world oil production in millions of barrels per day is shown in the table that follows.
Using the built-in function scipy.interpolate.lagrange to determine the degree 9 polynomial through the
data. Plot this polynomial. Does Runge phenomenon occur in this example? In your opinion, is the
interpolating polynomial a good model of the data? Explain.
[year | Doi day (RIO) ]
1994 67.052
1995 68.008
1996 69.803
1997 72.024
1998 73.400
1999 72.063
2000 74.669
2001 74.487
2002 74.065
2003 76.777
Table 2: Data for Question 5.
6. Say that you wish to estimate In(z) on [1,e] using a Chebyshev interpolating polynomial. How many
data points would you need to guarantee that the error is less than 107!°.
7. (Coding) In this problem we will write code to create a program which takes as input 2 arrays of
numbers, (%1,%2,-..-,%n) and (y1,4y2,---,Yn), and outputs the equations of the natural cubic spline
between these points.
1
(a) Create a function which takes as an input these two arrays and outputs the matrix and solution
vector to find our vector c.
(b) Use a (built-in) linear system of equations solver to find the vector c based on the outputs from
(a).
(c) Use your vector c as well as your points x and y to find b and d.
8. (Coding) Repeat question 2 but instead use cubic splines and your code from the previous problem.
2
Please download the answer file using this link
https://drive.google.com/file/d/1msSGrV1XQjnD9a2Zi-JQs_IihTbrTHOe/view?usp=sharing